diff --git a/integration/test_dynamic_routes.py b/integration/test_dynamic_routes.py index 23523246175..0ce4ef2c91b 100644 --- a/integration/test_dynamic_routes.py +++ b/integration/test_dynamic_routes.py @@ -23,6 +23,7 @@ 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'}") @@ -46,7 +47,7 @@ def index(): is_read_only=True, id="token", ), - rc.input(value=rx.State.page_id, is_read_only=True, id="page_id"), # type: ignore + rc.input(value=DynamicState.page_id, is_read_only=True, id="page_id"), rc.input( value=DynamicState.router.page.raw_path, is_read_only=True, @@ -73,9 +74,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 491eba53866..a3d90e64523 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 6604a361a22..0ef22ebd42e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -126,13 +126,13 @@ files = [ [[package]] name = "build" -version = "1.2.2" +version = "1.2.1" description = "A simple, correct Python build frontend" optional = false python-versions = ">=3.8" files = [ - {file = "build-1.2.2-py3-none-any.whl", hash = "sha256:277ccc71619d98afdd841a0e96ac9fe1593b823af481d3b0cea748e8894e0613"}, - {file = "build-1.2.2.tar.gz", hash = "sha256:119b2fb462adef986483438377a13b2f42064a2a3a4161f24a0cca698a07ac8c"}, + {file = "build-1.2.1-py3-none-any.whl", hash = "sha256:75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4"}, + {file = "build-1.2.1.tar.gz", hash = "sha256:526263f4870c26f26c433545579475377b2b7588b6f1eac76a001e873ae3e19d"}, ] [package.dependencies] @@ -162,78 +162,78 @@ files = [ [[package]] name = "cffi" -version = "1.17.1" +version = "1.17.0" description = "Foreign Function Interface for Python calling C code." optional = false python-versions = ">=3.8" files = [ - {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"}, + {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"}, ] [package.dependencies] @@ -463,38 +463,38 @@ toml = ["tomli"] [[package]] name = "cryptography" -version = "43.0.1" +version = "43.0.0" 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.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"}, + {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"}, ] [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.1)", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] +test = ["certifi", "cryptography-vectors (==43.0.0)", "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.114.0" +version = "0.112.2" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" files = [ - {file = "fastapi-0.114.0-py3-none-any.whl", hash = "sha256:fee75aa1b1d3d73f79851c432497e4394e413e1dece6234f68d3ce250d12760a"}, - {file = "fastapi-0.114.0.tar.gz", hash = "sha256:9908f2a5cc733004de6ca5e1412698f35085cefcbfd41d539245b9edf87b73c1"}, + {file = "fastapi-0.112.2-py3-none-any.whl", hash = "sha256:db84b470bd0e2b1075942231e90e3577e12a903c4dc8696f0d206a7904a7af1c"}, + {file = "fastapi-0.112.2.tar.gz", hash = "sha256:3d4729c038414d5193840706907a41839d839523da6ed0c2811f1168cac1798c"}, ] [package.dependencies] @@ -1098,13 +1098,13 @@ files = [ [[package]] name = "more-itertools" -version = "10.5.0" +version = "10.4.0" description = "More routines for operating on iterables, beyond itertools" optional = false python-versions = ">=3.8" files = [ - {file = "more-itertools-10.5.0.tar.gz", hash = "sha256:5482bfef7849c25dc3c6dd53a6173ae4795da2a41a80faea6700d9f5846c5da6"}, - {file = "more_itertools-10.5.0-py3-none-any.whl", hash = "sha256:037b0d3203ce90cca8ab1defbbdac29d5f993fc20131f3664dc8d6acfa872aef"}, + {file = "more-itertools-10.4.0.tar.gz", hash = "sha256:fe0e63c4ab068eac62410ab05cccca2dc71ec44ba8ef29916a0090df061cf923"}, + {file = "more_itertools-10.4.0-py3-none-any.whl", hash = "sha256:0f7d9f83a0a8dcfa8a2694a770590d98a67ea943e3d9f5298309a484758c4e27"}, ] [[package]] @@ -1236,64 +1236,63 @@ files = [ [[package]] name = "numpy" -version = "2.1.1" +version = "2.1.0" description = "Fundamental package for array computing in Python" optional = false python-versions = ">=3.10" files = [ - {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"}, + {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"}, ] [[package]] @@ -1695,123 +1694,122 @@ files = [ [[package]] name = "pydantic" -version = "2.9.0" +version = "2.8.2" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.9.0-py3-none-any.whl", hash = "sha256:f66a7073abd93214a20c5f7b32d56843137a7a2e70d02111f3be287035c45370"}, - {file = "pydantic-2.9.0.tar.gz", hash = "sha256:c7a8a9fdf7d100afa49647eae340e2d23efa382466a8d177efcd1381e9be5598"}, + {file = "pydantic-2.8.2-py3-none-any.whl", hash = "sha256:73ee9fddd406dc318b885c7a2eab8a6472b68b8fb5ba8150949fc3db939f23c8"}, + {file = "pydantic-2.8.2.tar.gz", hash = "sha256:6f62c13d067b0755ad1c21a34bdd06c0c12625a22b0fc09c6b149816604f7c2a"}, ] [package.dependencies] annotated-types = ">=0.4.0" -pydantic-core = "2.23.2" +pydantic-core = "2.20.1" 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.23.2" +version = "2.20.1" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" files = [ - {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"}, + {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"}, ] [package.dependencies] @@ -2016,13 +2014,13 @@ dev = ["atomicwrites (==1.4.1)", "attrs (==23.2.0)", "coverage (==7.4.1)", "hatc [[package]] name = "python-socketio" -version = "5.11.4" +version = "5.11.3" description = "Socket.IO server and client for Python" optional = false python-versions = ">=3.8" files = [ - {file = "python_socketio-5.11.4-py3-none-any.whl", hash = "sha256:42efaa3e3e0b166fc72a527488a13caaac2cefc76174252486503bd496284945"}, - {file = "python_socketio-5.11.4.tar.gz", hash = "sha256:8b0b8ff2964b2957c865835e936310190639c00310a47d77321a594d1665355e"}, + {file = "python_socketio-5.11.3-py3-none-any.whl", hash = "sha256:2a923a831ff70664b7c502df093c423eb6aa93c1ce68b8319e840227a26d8b69"}, + {file = "python_socketio-5.11.3.tar.gz", hash = "sha256:194af8cdbb7b0768c2e807ba76c7abc288eb5bb85559b7cddee51a6bc7a65737"}, ] [package.dependencies] @@ -2157,13 +2155,13 @@ ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)" [[package]] name = "reflex-chakra" -version = "0.6.0a5" +version = "0.6.0a1" description = "reflex using chakra components" optional = false python-versions = "<4.0,>=3.8" files = [ - {file = "reflex_chakra-0.6.0a5-py3-none-any.whl", hash = "sha256:9d502ddf3bd606baef4f0ff6453dcefb5e19dab4cfaf7c23df069fab70687a63"}, - {file = "reflex_chakra-0.6.0a5.tar.gz", hash = "sha256:b44e73478462052f09c9677d3fd7726891b4af87711b4b6a2171f010049308c9"}, + {file = "reflex_chakra-0.6.0a1-py3-none-any.whl", hash = "sha256:68c22e00591530c38acedb20ee9c192109a3591f3e58fb3a51c9e939b13c66ad"}, + {file = "reflex_chakra-0.6.0a1.tar.gz", hash = "sha256:9061790bb59134cf2200461de45f582987cef29032f82864165a3c5badb86cf5"}, ] [package.dependencies] @@ -2398,60 +2396,60 @@ files = [ [[package]] name = "sqlalchemy" -version = "2.0.34" +version = "2.0.32" description = "Database Abstraction Library" optional = false python-versions = ">=3.7" files = [ - {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"}, + {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"}, ] [package.dependencies] @@ -2485,13 +2483,13 @@ sqlcipher = ["sqlcipher3_binary"] [[package]] name = "sqlmodel" -version = "0.0.22" +version = "0.0.21" description = "SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness." optional = false python-versions = ">=3.7" files = [ - {file = "sqlmodel-0.0.22-py3-none-any.whl", hash = "sha256:a1ed13e28a1f4057cbf4ff6cdb4fc09e85702621d3259ba17b3c230bfb2f941b"}, - {file = "sqlmodel-0.0.22.tar.gz", hash = "sha256:7d37c882a30c43464d143e35e9ecaf945d88035e20117bf5ec2834a23cbe505e"}, + {file = "sqlmodel-0.0.21-py3-none-any.whl", hash = "sha256:eca104afe8a643f0764076b29f02e51d19d6b35c458f4c119942960362a4b52a"}, + {file = "sqlmodel-0.0.21.tar.gz", hash = "sha256:b2034c23d930f66d2091b17a4280a9c23a7ea540a71e7fcf9c746d262f06f74a"}, ] [package.dependencies] @@ -2500,13 +2498,13 @@ SQLAlchemy = ">=2.0.14,<2.1.0" [[package]] name = "starlette" -version = "0.38.4" +version = "0.38.2" description = "The little ASGI library that shines." optional = false python-versions = ">=3.8" files = [ - {file = "starlette-0.38.4-py3-none-any.whl", hash = "sha256:526f53a77f0e43b85f583438aee1a940fd84f8fd610353e8b0c1a77ad8a87e76"}, - {file = "starlette-0.38.4.tar.gz", hash = "sha256:53a7439060304a208fea17ed407e998f46da5e5d9b1addfea3040094512a6379"}, + {file = "starlette-0.38.2-py3-none-any.whl", hash = "sha256:4ec6a59df6bbafdab5f567754481657f7ed90dc9d69b0c9ff017907dd54faeff"}, + {file = "starlette-0.38.2.tar.gz", hash = "sha256:c7c0441065252160993a1a37cf2a73bb64d271b17303e0b0c1eb7191cfb12d75"}, ] [package.dependencies] diff --git a/reflex/.templates/jinja/web/pages/utils.js.jinja2 b/reflex/.templates/jinja/web/pages/utils.js.jinja2 index e0311a79a7c..4e3546070e1 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 }})) { + switch (JSON.stringify({{ component.cond._var_name_unwrapped }})) { {% for case in component.match_cases %} {% for condition in case[:-1] %} - case JSON.stringify({{ condition._var_name }}): + case JSON.stringify({{ condition._var_name_unwrapped }}): {% 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 819abd23223..a647a35b3c7 100644 --- a/reflex/.templates/jinja/web/utils/theme.js.jinja2 +++ b/reflex/.templates/jinja/web/utils/theme.js.jinja2 @@ -1 +1 @@ -export default {{ theme }} \ No newline at end of file +export default {{ theme|json_dumps }} \ No newline at end of file diff --git a/reflex/compiler/compiler.py b/reflex/compiler/compiler.py index 55602d2b2da..00d4acc221c 100644 --- a/reflex/compiler/compiler.py +++ b/reflex/compiler/compiler.py @@ -17,12 +17,13 @@ StatefulComponent, ) from reflex.config import get_config -from reflex.ivars.base import ImmutableVar, LiteralVar +from reflex.ivars.base import 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: @@ -57,7 +58,7 @@ def _compile_app(app_root: Component) -> str: ) -def _compile_theme(theme: str) -> str: +def _compile_theme(theme: dict) -> str: """Compile the theme. Args: @@ -320,7 +321,7 @@ def _compile_tailwind( def compile_document_root( head_components: list[Component], html_lang: Optional[str] = None, - html_custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + html_custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, ) -> tuple[str, str]: """Compile the document root. @@ -377,7 +378,7 @@ def compile_theme(style: ComponentStyle) -> tuple[str, str]: theme = utils.create_theme(style) # Compile the theme. - code = _compile_theme(str(LiteralVar.create(theme))) + code = _compile_theme(theme) return output_path, code diff --git a/reflex/compiler/utils.py b/reflex/compiler/utils.py index 942faa05872..cbb402047dd 100644 --- a/reflex/compiler/utils.py +++ b/reflex/compiler/utils.py @@ -7,7 +7,6 @@ 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: @@ -33,6 +32,7 @@ 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[ImmutableVar, str]]] = None, + html_custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, ) -> Component: """Create the document root. diff --git a/reflex/components/base/app_wrap.pyi b/reflex/components/base/app_wrap.pyi index 90fc646e846..576f8cd69a5 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,51 +21,41 @@ class AppWrap(Fragment): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AppWrap": diff --git a/reflex/components/base/bare.py b/reflex/components/base/bare.py index 8fa053a5bdd..2ed0cb59025 100644 --- a/reflex/components/base/bare.py +++ b/reflex/components/base/bare.py @@ -28,6 +28,8 @@ 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 @@ -37,7 +39,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[ImmutableVar]: + def _get_vars(self, include_children: bool = False) -> Iterator[Var]: """Walk all Vars used in this component. Args: diff --git a/reflex/components/base/body.pyi b/reflex/components/base/body.pyi index b0b51467402..57ff1b7b7ab 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,51 +21,41 @@ class Body(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Body": diff --git a/reflex/components/base/document.pyi b/reflex/components/base/document.pyi index db736e0b78a..77065d84504 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,51 +21,41 @@ class NextDocumentLib(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "NextDocumentLib": @@ -98,51 +88,41 @@ class Html(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Html": @@ -174,51 +154,41 @@ class DocumentHead(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DocumentHead": @@ -250,51 +220,41 @@ class Main(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Main": @@ -326,51 +286,41 @@ class NextScript(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "NextScript": diff --git a/reflex/components/base/error_boundary.py b/reflex/components/base/error_boundary.py index a532b682fe5..058976498a8 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 | ImmutableVar]: + def add_hooks(self) -> List[str | Var]: """Add hooks for the component. Returns: diff --git a/reflex/components/base/error_boundary.pyi b/reflex/components/base/error_boundary.pyi index 0fecd063ae3..4777b09e992 100644 --- a/reflex/components/base/error_boundary.pyi +++ b/reflex/components/base/error_boundary.pyi @@ -7,14 +7,13 @@ 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 | ImmutableVar]: ... + def add_hooks(self) -> List[str | Var]: ... def add_custom_code(self) -> List[str]: ... @overload @classmethod @@ -27,54 +26,42 @@ class ErrorBoundary(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ErrorBoundary": diff --git a/reflex/components/base/fragment.pyi b/reflex/components/base/fragment.pyi index 08cc28ea812..fae72cc9c62 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,51 +21,41 @@ class Fragment(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Fragment": diff --git a/reflex/components/base/head.pyi b/reflex/components/base/head.pyi index eff4427b251..04145713781 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,51 +21,41 @@ class NextHeadLib(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "NextHeadLib": @@ -97,51 +87,41 @@ class Head(NextHeadLib, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Head": diff --git a/reflex/components/base/link.pyi b/reflex/components/base/link.pyi index 0889a06b1dc..80388a32724 100644 --- a/reflex/components/base/link.pyi +++ b/reflex/components/base/link.pyi @@ -7,7 +7,6 @@ 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 @@ -24,51 +23,41 @@ class RawLink(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RawLink": @@ -109,51 +98,41 @@ class ScriptTag(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ScriptTag": diff --git a/reflex/components/base/meta.pyi b/reflex/components/base/meta.pyi index 185425ff1cd..372d202f9dc 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,51 +22,41 @@ class Title(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Title": @@ -103,51 +93,41 @@ class Meta(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Meta": @@ -189,51 +169,41 @@ class Description(Meta): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Description": @@ -275,51 +245,41 @@ class Image(Meta): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Image": diff --git a/reflex/components/base/script.pyi b/reflex/components/base/script.pyi index 6a1033f7d48..311485b660a 100644 --- a/reflex/components/base/script.pyi +++ b/reflex/components/base/script.pyi @@ -7,7 +7,6 @@ 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 @@ -29,60 +28,44 @@ class Script(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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_load: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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_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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Script": diff --git a/reflex/components/component.py b/reflex/components/component.py index e838c86d1af..6d4fdded1a0 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -46,15 +46,9 @@ 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 ( - ImmutableParsedImportDict, - ImportDict, - ImportVar, - ParsedImportDict, - parse_imports, -) +from reflex.utils.imports import ImportDict, ImportVar, ParsedImportDict, parse_imports from reflex.utils.serializers import serializer -from reflex.vars import Var, VarData +from reflex.vars import BaseVar, ImmutableVarData, Var, VarData class BaseComponent(Base, ABC): @@ -177,7 +171,7 @@ class Component(BaseComponent, ABC): style: Style = Style() # A mapping from event triggers to event chains. - event_triggers: Dict[str, Union[EventChain, ImmutableVar]] = {} + event_triggers: Dict[str, Union[EventChain, Var]] = {} # The alias for the tag. alias: Optional[str] = None @@ -195,7 +189,7 @@ class Component(BaseComponent, ABC): class_name: Any = None # Special component props. - special_props: Set[ImmutableVar] = set() + special_props: Set[Var] = set() # Whether the component should take the focus once the page is loaded autofocus: bool = False @@ -213,7 +207,7 @@ class Component(BaseComponent, ABC): _rename_props: Dict[str, str] = {} # custom attribute - custom_attrs: Dict[str, Union[ImmutableVar, str]] = {} + custom_attrs: Dict[str, Union[Var, str]] = {} # When to memoize this component and its children. _memoization_mode: MemoizationMode = MemoizationMode() @@ -249,7 +243,7 @@ def add_imports(self) -> ImportDict | list[ImportDict]: """ return {} - def add_hooks(self) -> list[str | ImmutableVar]: + def add_hooks(self) -> list[str | Var]: """Add hooks inside the component function. Hooks are pieces of literal Javascript code that is inserted inside the @@ -404,7 +398,7 @@ def __init__(self, *args, **kwargs): passed_types = None try: # Try to create a var from the value. - if isinstance(value, ImmutableVar): + if isinstance(value, Var): kwargs[key] = value else: kwargs[key] = LiteralVar.create(value) @@ -447,9 +441,7 @@ 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, ImmutableVar) else value - ) + value_name = value._var_name if isinstance(value, Var) 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}." ) @@ -501,7 +493,7 @@ def _create_event_chain( value: Union[ Var, EventHandler, EventSpec, List[Union[EventHandler, EventSpec]], Callable ], - ) -> Union[EventChain, ImmutableVar]: + ) -> Union[EventChain, Var]: """Create an event chain from a variety of input types. Args: @@ -515,7 +507,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, ImmutableVar): + if isinstance(value, Var): if value._var_type is not EventChain: raise ValueError( f"Invalid event chain: {repr(value)} of type {type(value)}" @@ -539,7 +531,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, ImmutableVar): + if isinstance(result, Var): raise ValueError( f"Invalid event chain: {v}. Cannot use a Var-returning " "lambda inside an EventChain list." @@ -551,7 +543,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, ImmutableVar): + if isinstance(result, Var): # Recursively call this function if the lambda returned an EventChain Var. return self._create_event_chain(args_spec, result) events = result @@ -569,7 +561,7 @@ def _create_event_chain( event_actions.update(e.event_actions) # Return the event chain. - if isinstance(args_spec, ImmutableVar): + if isinstance(args_spec, Var): return EventChain( events=events, args_spec=None, @@ -882,7 +874,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, ImmutableVar): + if isinstance(self.style, Var): return {"css": self.style} emotion_style = format_as_emotion(self.style) return ( @@ -998,8 +990,8 @@ def validate_child(child): @staticmethod def _get_vars_from_event_triggers( - event_triggers: dict[str, EventChain | ImmutableVar], - ) -> Iterator[tuple[str, list[ImmutableVar]]]: + event_triggers: dict[str, EventChain | Var], + ) -> Iterator[tuple[str, list[Var]]]: """Get the Vars associated with each event trigger. Args: @@ -1009,7 +1001,7 @@ def _get_vars_from_event_triggers( tuple of (event_name, event_vars) """ for event_trigger, event in event_triggers.items(): - if isinstance(event, ImmutableVar): + if isinstance(event, Var): yield event_trigger, [event] elif isinstance(event, EventChain): event_args = [] @@ -1018,7 +1010,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[ImmutableVar]: + def _get_vars(self, include_children: bool = False) -> list[Var]: """Walk all Vars used in this component. Args: @@ -1038,20 +1030,16 @@ def _get_vars(self, include_children: bool = False) -> list[ImmutableVar]: # Get Vars associated with component props. for prop in self.get_props(): prop_var = getattr(self, prop) - if isinstance(prop_var, ImmutableVar): + if isinstance(prop_var, Var): 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, ImmutableVar) - ): + if isinstance(self.style, dict) and self.style or isinstance(self.style, Var): vars.append( ImmutableVar( _var_name="style", _var_type=str, - _var_data=VarData.merge(self.style._var_data), + _var_data=ImmutableVarData.merge(self.style._var_data), ) ) @@ -1066,7 +1054,7 @@ def _get_vars(self, include_children: bool = False) -> list[ImmutableVar]: self.autofocus, *self.custom_attrs.values(), ): - if isinstance(comp_prop, ImmutableVar): + if isinstance(comp_prop, Var): vars.append(comp_prop) elif isinstance(comp_prop, str): # Collapse VarData encoded in f-strings. @@ -1095,7 +1083,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, ImmutableVar) and trigger._var_state: + elif isinstance(trigger, Var) and trigger._var_state: return True return False @@ -1287,7 +1275,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, ImmutableVar) + if user_hooks is not None and isinstance(user_hooks, Var) else None ) if user_hooks_data is not None: @@ -1315,15 +1303,9 @@ 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: List[ImmutableParsedImportDict] = list( - map( - lambda var_data: var_data.imports, - filter( - None, - var_datas, - ), - ) - ) + var_imports = [ + var_data.imports for var_data in var_datas if var_data is not None + ] added_import_dicts: list[ParsedImportDict] = [] for clz in self._iter_parent_classes_with_method("add_imports"): @@ -1370,9 +1352,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 = str(LiteralVar.create(on_mount)) + "()" + on_mount = format.format_event_chain(on_mount) if on_unmount is not None: - on_unmount = str(LiteralVar.create(on_unmount)) + "()" + on_unmount = format.format_event_chain(on_unmount) if on_mount is not None or on_unmount is not None: return f""" useEffect(() => {{ @@ -1453,7 +1435,7 @@ def _get_added_hooks(self) -> dict[str, ImportDict]: """ code = {} - def extract_var_hooks(hook: ImmutableVar): + def extract_var_hooks(hook: Var): _imports = {} var_data = VarData.merge(hook._get_all_var_data()) if var_data is not None: @@ -1470,7 +1452,7 @@ def extract_var_hooks(hook: ImmutableVar): # 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, ImmutableVar): + if isinstance(hook, Var): extract_var_hooks(hook) else: code[hook] = {} @@ -1531,7 +1513,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, ImmutableVar): + if self.id is None or isinstance(self.id, (BaseVar, ImmutableVar)): return None return format.format_ref(self.id) @@ -1786,7 +1768,7 @@ def get_prop_vars(self) -> List[ImmutableVar]: for name, prop in self.props.items() ] - def _get_vars(self, include_children: bool = False) -> list[ImmutableVar]: + def _get_vars(self, include_children: bool = False) -> list[Var]: """Walk all Vars used in this component. Args: @@ -1797,7 +1779,7 @@ def _get_vars(self, include_children: bool = False) -> list[ImmutableVar]: """ return ( super()._get_vars(include_children=include_children) - + [prop for prop in self.props.values() if isinstance(prop, ImmutableVar)] + + [prop for prop in self.props.values() if isinstance(prop, Var)] + self.get_component(self)._get_vars(include_children=include_children) ) @@ -1968,7 +1950,7 @@ def create(cls, component: Component) -> StatefulComponent | None: should_memoize = True break child = cls._child_var(child) - if isinstance(child, ImmutableVar) and child._get_all_var_data(): + if isinstance(child, Var) and child._get_all_var_data(): should_memoize = True break @@ -2124,7 +2106,7 @@ def _get_hook_deps(hook: str) -> list[str]: def _get_memoized_event_triggers( cls, component: Component, - ) -> dict[str, tuple[ImmutableVar, str]]: + ) -> dict[str, tuple[Var, str]]: """Memoize event handler functions with useCallback to avoid unnecessary re-renders. Args: @@ -2148,7 +2130,9 @@ def _get_memoized_event_triggers( # Get the actual EventSpec and render it. event = component.event_triggers[event_trigger] - rendered_chain = str(LiteralVar.create(event)) + rendered_chain = format.format_prop(event) + if isinstance(rendered_chain, str): + rendered_chain = rendered_chain.strip("{}") # Hash the rendered EventChain to get a deterministic function name. chain_hash = md5(str(rendered_chain).encode("utf-8")).hexdigest() @@ -2157,10 +2141,9 @@ 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: - var_data = arg._get_all_var_data() - if var_data is None: + if arg._get_all_var_data() is None: continue - for hook in var_data.hooks: + for hook in arg._get_all_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 834d59a8333..4c4f587eef5 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 Var, VarData +from reflex.vars import ImmutableVarData, 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=VarData( + _var_data=ImmutableVarData( 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 | ImmutableVar]: + def add_hooks(self) -> list[str | Var]: """Add the hooks for the connection toaster. Returns: diff --git a/reflex/components/core/banner.pyi b/reflex/components/core/banner.pyi index 0a4072c3130..6327afe0b3d 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 | ImmutableVar]: ... + def add_hooks(self) -> list[str | Var]: ... @overload @classmethod def create( # type: ignore @@ -75,51 +75,41 @@ class ConnectionToaster(Toaster): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ConnectionToaster": @@ -165,51 +155,41 @@ class ConnectionBanner(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ConnectionBanner": @@ -234,51 +214,41 @@ class ConnectionModal(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ConnectionModal": @@ -304,51 +274,41 @@ class WifiOffPulse(Icon): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "WifiOffPulse": @@ -407,51 +367,41 @@ class ConnectionPulser(Div): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ConnectionPulser": diff --git a/reflex/components/core/client_side_routing.py b/reflex/components/core/client_side_routing.py index 33e54f22773..618467f3909 100644 --- a/reflex/components/core/client_side_routing.py +++ b/reflex/components/core/client_side_routing.py @@ -13,10 +13,9 @@ 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 = ImmutableVar.create_safe(constants.ROUTE_NOT_FOUND) +route_not_found: Var = Var.create_safe(constants.ROUTE_NOT_FOUND, _var_is_string=False) class ClientSideRouting(Component): diff --git a/reflex/components/core/client_side_routing.pyi b/reflex/components/core/client_side_routing.pyi index 57d1e1ae47a..605293ee812 100644 --- a/reflex/components/core/client_side_routing.pyi +++ b/reflex/components/core/client_side_routing.pyi @@ -7,7 +7,6 @@ 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 @@ -26,51 +25,41 @@ class ClientSideRouting(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ClientSideRouting": @@ -105,51 +94,41 @@ class Default404Page(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Default404Page": diff --git a/reflex/components/core/clipboard.py b/reflex/components/core/clipboard.py index abc1b5b4a16..9b0edcc2934 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)" % ( - str(self.targets), - str(self.on_paste_event_actions), + self.targets._var_name_unwrapped, + self.on_paste_event_actions._var_name_unwrapped, on_paste, ) ] diff --git a/reflex/components/core/clipboard.pyi b/reflex/components/core/clipboard.pyi index 3ffaad29338..aaeac985c3c 100644 --- a/reflex/components/core/clipboard.pyi +++ b/reflex/components/core/clipboard.pyi @@ -7,7 +7,6 @@ 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 @@ -27,54 +26,42 @@ class Clipboard(Fragment): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Clipboard": diff --git a/reflex/components/core/cond.py b/reflex/components/core/cond.py index 33e145f4109..6e6272665af 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({str(self.cond)})", + cond_state=f"isTrue({self.cond._var_full_name})", ) def add_imports(self) -> ImportDict: @@ -103,11 +103,10 @@ def add_imports(self) -> ImportDict: Returns: The import dict for the component. """ - 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} + 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} @overload @@ -136,6 +135,8 @@ 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 b11bb120b82..4dc7c14a179 100644 --- a/reflex/components/core/debounce.py +++ b/reflex/components/core/debounce.py @@ -7,7 +7,6 @@ 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 @@ -107,20 +106,23 @@ 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"] = ImmutableVar.create_safe(child_ref) + props["input_ref"] = Var.create_safe( + child_ref, _var_is_local=False, _var_is_string=False + ) props["id"] = child.id # Set the child element to wrap, including any imports/hooks from the child. props.setdefault( "element", - ImmutableVar( - _var_name=str(child.alias or child.tag), - _var_type=Type[Component], + Var.create_safe( + "{%s}" % (child.alias or child.tag), + _var_is_local=False, + _var_is_string=False, _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 ca740f85d0f..486fcc28425 100644 --- a/reflex/components/core/debounce.pyi +++ b/reflex/components/core/debounce.pyi @@ -7,7 +7,6 @@ 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 @@ -31,54 +30,42 @@ class DebounceInput(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DebounceInput": diff --git a/reflex/components/core/foreach.py b/reflex/components/core/foreach.py index a87e0022de9..78e8933d99a 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 `{str(iterable)}` of type Any. " + f"Could not foreach over var `{iterable._var_full_name}` 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=str(tag.iterable), + iterable_state=tag.iterable._var_full_name, arg_name=tag.arg_var_name, arg_index=tag.get_index_var_arg(), - iterable_type=tag.iterable.upcast()._var_type.mro()[0].__name__, + iterable_type=tag.iterable._var_type.mro()[0].__name__, ) diff --git a/reflex/components/core/html.pyi b/reflex/components/core/html.pyi index ab4cfecc86b..c3d2ed06fa4 100644 --- a/reflex/components/core/html.pyi +++ b/reflex/components/core/html.pyi @@ -7,7 +7,6 @@ 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 @@ -49,51 +48,41 @@ class Html(Div): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Html": diff --git a/reflex/components/core/match.py b/reflex/components/core/match.py index 38d56f8626b..3ddef38c63d 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 Var, VarData +from reflex.vars import ImmutableVarData, Var, VarData class Match(MemoizationLeaf): @@ -27,7 +27,7 @@ class Match(MemoizationLeaf): default: Any @classmethod - def create(cls, cond: Any, *cases) -> Union[Component, ImmutableVar]: + def create(cls, cond: Any, *cases) -> Union[Component, Var]: """Create a Match Component. Args: @@ -56,7 +56,7 @@ def create(cls, cond: Any, *cases) -> Union[Component, ImmutableVar]: ) @classmethod - def _create_condition_var(cls, cond: Any) -> ImmutableVar: + def _create_condition_var(cls, cond: Any) -> Var: """Convert the condition to a Var. Args: @@ -77,7 +77,7 @@ def _create_condition_var(cls, cond: Any) -> ImmutableVar: @classmethod def _process_cases( cls, cases: List - ) -> Tuple[List, Optional[Union[ImmutableVar, BaseComponent]]]: + ) -> Tuple[List, Optional[Union[Var, 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[ImmutableVar]]: + def _process_match_cases(cls, cases: List) -> List[List[Var]]: """Process the individual match cases. Args: @@ -157,7 +157,7 @@ def _process_match_cases(cls, cases: List) -> List[List[ImmutableVar]]: if not isinstance(element, BaseComponent) else element ) - if not isinstance(el, (ImmutableVar, BaseComponent)): + if not isinstance(el, (Var, 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[ImmutableVar]]: return match_cases @classmethod - def _validate_return_types(cls, match_cases: List[List[ImmutableVar]]) -> None: + def _validate_return_types(cls, match_cases: List[List[Var]]) -> None: """Validate that match cases have the same return types. Args: @@ -180,24 +180,24 @@ def _validate_return_types(cls, match_cases: List[List[ImmutableVar]]) -> None: if types._isinstance(first_case_return, BaseComponent): return_type = BaseComponent - elif types._isinstance(first_case_return, ImmutableVar): - return_type = ImmutableVar + elif types._isinstance(first_case_return, Var): + return_type = Var 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], ImmutableVar) else textwrap.shorten(str(case[-1]), width=250)}`" + f"value `{case[-1]._var_name if isinstance(case[-1], Var) 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: ImmutableVar, - match_cases: List[List[ImmutableVar]], - default: Optional[Union[ImmutableVar, BaseComponent]], - ) -> Union[Component, ImmutableVar]: + match_cond_var: Var, + match_cases: List[List[Var]], + default: Optional[Union[Var, BaseComponent]], + ) -> Union[Component, Var]: """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=str(match_cond_var), - match_cases=match_cases, + cond=match_cond_var._var_name_unwrapped, + match_cases=match_cases, # type: ignore default=default, # type: ignore ), _var_type=default._var_type, # type: ignore - _var_data=VarData.merge( + _var_data=ImmutableVarData.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,8 +267,7 @@ def add_imports(self) -> ImportDict: Returns: The import dict. """ - var_data = VarData.merge(self.cond._get_all_var_data()) - return var_data.old_school_imports() if var_data else {} + return getattr(VarData.merge(self.cond._get_all_var_data()), "imports", {}) match = Match.create diff --git a/reflex/components/core/upload.py b/reflex/components/core/upload.py index b6fe1024ae1..df9146c4d9f 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, LiteralVar +from reflex.ivars.base import ImmutableCallableVar, ImmutableVar from reflex.ivars.sequence import LiteralStringVar from reflex.utils.imports import ImportVar -from reflex.vars import Var, VarData +from reflex.vars import ImmutableVarData, 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=VarData.merge( + _var_data=ImmutableVarData.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=VarData.merge( + _var_data=ImmutableVarData.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[{str(LiteralVar.create(upload_id))}]?.abort()" + f"upload_controllers[{Var.create_safe(upload_id, _var_is_string=True)._var_name_unwrapped}]?.abort()" ) @@ -132,15 +132,16 @@ def get_upload_dir() -> Path: return uploaded_files_dir -uploaded_files_url_prefix = ImmutableVar( - _var_name="getBackendURL(env.UPLOAD)", +uploaded_files_url_prefix: Var = Var.create_safe( + "${getBackendURL(env.UPLOAD)}", + _var_is_string=False, _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]: @@ -154,7 +155,9 @@ def get_upload_url(file_path: str) -> Var[str]: """ Upload.is_used = True - return uploaded_files_url_prefix + "/" + file_path + return Var.create_safe( + f"{uploaded_files_url_prefix}/{file_path}", _var_is_string=True + ) def _on_drop_spec(files: Var): @@ -248,7 +251,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. @@ -258,7 +261,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. @@ -287,9 +290,7 @@ def create(cls, *children, **props) -> Component: ) @classmethod - def _update_arg_tuple_for_on_drop( - cls, arg_value: tuple[ImmutableVar, ImmutableVar] - ): + def _update_arg_tuple_for_on_drop(cls, arg_value: tuple[Var, Var]): """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 67b350c8df2..ff5085514c2 100644 --- a/reflex/components/core/upload.pyi +++ b/reflex/components/core/upload.pyi @@ -7,7 +7,6 @@ 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, @@ -15,7 +14,6 @@ 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 @@ -30,15 +28,7 @@ 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 = 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) +uploaded_files_url_prefix: Var def get_upload_url(file_path: str) -> Var[str]: ... @@ -53,51 +43,41 @@ class UploadFilesProvider(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "UploadFilesProvider": @@ -140,54 +120,42 @@ class Upload(MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Upload": @@ -237,54 +205,42 @@ class StyledUpload(Upload): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "StyledUpload": @@ -334,54 +290,42 @@ class UploadNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "StyledUpload": diff --git a/reflex/components/datadisplay/code.py b/reflex/components/datadisplay/code.py index 96f91a36e5f..779d4c5d3ad 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"], ImmutableVar): + if "theme" in props and not isinstance(props["theme"], Var): 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"], ImmutableVar): + if not isinstance(props["code"], Var): 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.upcast()._replace( + theme = self.theme._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 63209ec8a85..015cc0708ad 100644 --- a/reflex/components/datadisplay/code.pyi +++ b/reflex/components/datadisplay/code.pyi @@ -8,7 +8,6 @@ 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 @@ -1032,51 +1031,41 @@ class CodeBlock(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CodeBlock": diff --git a/reflex/components/datadisplay/dataeditor.py b/reflex/components/datadisplay/dataeditor.py index 006a2472feb..f3296e0b70c 100644 --- a/reflex/components/datadisplay/dataeditor.py +++ b/reflex/components/datadisplay/dataeditor.py @@ -10,7 +10,6 @@ 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 @@ -299,8 +298,8 @@ def add_hooks(self) -> list[str]: code = [f"function {data_callback}([col, row])" "{"] - columns_path = str(self.columns) - data_path = str(self.data) + columns_path = f"{self.columns._var_full_name}" + data_path = f"{self.data._var_full_name}" code.extend( [ @@ -333,18 +332,12 @@ def create(cls, *children, **props) -> Component: # If rows is not provided, determine from data. if rows is None: - 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) - ) + props["rows"] = data.length() if isinstance(data, Var) else len(data) - if not isinstance(columns, ImmutableVar) and len(columns): + if not isinstance(columns, Var) and len(columns): if ( types.is_dataframe(type(data)) - or isinstance(data, ImmutableVar) + or isinstance(data, Var) and types.is_dataframe(data._var_type) ): raise ValueError( @@ -409,9 +402,9 @@ def serialize_dataeditortheme(theme: DataEditorTheme): Returns: The serialized theme. """ - return { - format.to_camel_case(k): v for k, v in theme.__dict__.items() if v is not None - } + return format.json_dumps( + {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 66452ffae7c..b40890b73cc 100644 --- a/reflex/components/datadisplay/dataeditor.pyi +++ b/reflex/components/datadisplay/dataeditor.pyi @@ -9,7 +9,6 @@ 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 @@ -135,99 +134,87 @@ class DataEditor(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_cell_activated: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_cell_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_cell_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_cell_edited: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_column_resize: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_delete: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_delete: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_finished_editing: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_group_header_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_group_header_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_group_header_renamed: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_header_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_header_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_header_menu_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_item_hovered: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_row_appended: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_selection_cleared: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DataEditor": diff --git a/reflex/components/el/element.pyi b/reflex/components/el/element.pyi index 57694161872..f18d9008c6e 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,51 +21,41 @@ class Element(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Element": diff --git a/reflex/components/el/elements/base.pyi b/reflex/components/el/elements/base.pyi index 4cc1c397c10..d802cc2ee93 100644 --- a/reflex/components/el/elements/base.pyi +++ b/reflex/components/el/elements/base.pyi @@ -7,7 +7,6 @@ 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 @@ -46,51 +45,41 @@ class BaseHTML(Element): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "BaseHTML": diff --git a/reflex/components/el/elements/forms.py b/reflex/components/el/elements/forms.py index f2a6a42f5c9..f6ad1016219 100644 --- a/reflex/components/el/elements/forms.py +++ b/reflex/components/el/elements/forms.py @@ -12,6 +12,7 @@ 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 @@ -23,9 +24,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() @@ -185,8 +186,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=str( - LiteralVar.create(self.event_triggers[EventTriggers.ON_SUBMIT]) + on_submit_event_chain=format_event_chain( + self.event_triggers[EventTriggers.ON_SUBMIT] ), reset_on_submit=self.reset_on_submit, ) @@ -226,7 +227,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[ImmutableVar]: + def _get_vars(self, include_children: bool = True) -> Iterator[Var]: yield from super()._get_vars(include_children=include_children) yield from self._get_form_refs().values() @@ -624,15 +625,19 @@ def _render(self) -> Tag: "Cannot combine `enter_key_submit` with `on_key_down`.", ) tag.add_props( - on_key_down=ImmutableVar.create_safe( - f"(e) => enterKeySubmitOnKeyDown(e, {str(self.enter_key_submit)})", + 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, _var_data=VarData.merge(self.enter_key_submit._get_all_var_data()), ) ) if self.auto_height is not None: tag.add_props( - on_input=ImmutableVar.create_safe( - f"(e) => autoHeightOnInput(e, {str(self.auto_height)})", + on_input=Var.create_safe( + f"(e) => autoHeightOnInput(e, {self.auto_height._var_name_unwrapped})", + _var_is_local=False, + _var_is_string=False, _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 0b2f42754ea..7eca3f85474 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,51 +71,41 @@ class Button(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Button": @@ -198,51 +188,41 @@ class Datalist(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Datalist": @@ -293,51 +273,41 @@ class Fieldset(Element): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Fieldset": @@ -411,54 +381,42 @@ class Form(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Form": @@ -583,60 +541,46 @@ class Input(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Input": @@ -743,51 +687,41 @@ class Label(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Label": @@ -861,51 +795,41 @@ class Legend(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Legend": @@ -984,51 +908,41 @@ class Meter(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Meter": @@ -1109,51 +1023,41 @@ class Optgroup(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Optgroup": @@ -1231,51 +1135,41 @@ class Option(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Option": @@ -1354,51 +1248,41 @@ class Output(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Output": @@ -1476,51 +1360,41 @@ class Progress(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Progress": @@ -1605,54 +1479,42 @@ class Select(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Select": @@ -1754,60 +1616,46 @@ class Textarea(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Textarea": diff --git a/reflex/components/el/elements/inline.pyi b/reflex/components/el/elements/inline.pyi index 0c1b81d1f80..dfddf5f1053 100644 --- a/reflex/components/el/elements/inline.pyi +++ b/reflex/components/el/elements/inline.pyi @@ -6,7 +6,6 @@ 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 @@ -58,51 +57,41 @@ class A(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "A": @@ -183,51 +172,41 @@ class Abbr(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Abbr": @@ -299,51 +278,41 @@ class B(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "B": @@ -415,51 +384,41 @@ class Bdi(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Bdi": @@ -531,51 +490,41 @@ class Bdo(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Bdo": @@ -647,51 +596,41 @@ class Br(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Br": @@ -763,51 +702,41 @@ class Cite(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Cite": @@ -879,51 +808,41 @@ class Code(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Code": @@ -996,51 +915,41 @@ class Data(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Data": @@ -1113,51 +1022,41 @@ class Dfn(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Dfn": @@ -1229,51 +1128,41 @@ class Em(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Em": @@ -1345,51 +1234,41 @@ class I(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "I": @@ -1461,51 +1340,41 @@ class Kbd(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Kbd": @@ -1577,51 +1446,41 @@ class Mark(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Mark": @@ -1694,51 +1553,41 @@ class Q(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Q": @@ -1811,51 +1660,41 @@ class Rp(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Rp": @@ -1927,51 +1766,41 @@ class Rt(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Rt": @@ -2043,51 +1872,41 @@ class Ruby(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Ruby": @@ -2159,51 +1978,41 @@ class S(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "S": @@ -2275,51 +2084,41 @@ class Samp(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Samp": @@ -2391,51 +2190,41 @@ class Small(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Small": @@ -2507,51 +2296,41 @@ class Span(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Span": @@ -2623,51 +2402,41 @@ class Strong(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Strong": @@ -2739,51 +2508,41 @@ class Sub(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Sub": @@ -2855,51 +2614,41 @@ class Sup(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Sup": @@ -2972,51 +2721,41 @@ class Time(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Time": @@ -3089,51 +2828,41 @@ class U(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "U": @@ -3205,51 +2934,41 @@ class Wbr(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Wbr": diff --git a/reflex/components/el/elements/media.pyi b/reflex/components/el/elements/media.pyi index 08b2be719b8..cf673ddf96f 100644 --- a/reflex/components/el/elements/media.pyi +++ b/reflex/components/el/elements/media.pyi @@ -8,7 +8,6 @@ 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 @@ -62,51 +61,41 @@ class Area(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Area": @@ -199,51 +188,41 @@ class Audio(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Audio": @@ -341,51 +320,41 @@ class Img(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Img": @@ -471,51 +440,41 @@ class Map(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Map": @@ -593,51 +552,41 @@ class Track(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Track": @@ -728,51 +677,41 @@ class Video(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Video": @@ -856,51 +795,41 @@ class Embed(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Embed": @@ -985,51 +914,41 @@ class Iframe(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Iframe": @@ -1115,51 +1034,41 @@ class Object(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Object": @@ -1236,51 +1145,41 @@ class Picture(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Picture": @@ -1352,51 +1251,41 @@ class Portal(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Portal": @@ -1473,51 +1362,41 @@ class Source(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Source": @@ -1597,51 +1476,41 @@ class Svg(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Svg": @@ -1720,51 +1589,41 @@ class Circle(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Circle": @@ -1847,51 +1706,41 @@ class Rect(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Rect": @@ -1972,51 +1821,41 @@ class Polygon(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Polygon": @@ -2090,51 +1929,41 @@ class Defs(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Defs": @@ -2213,51 +2042,41 @@ class LinearGradient(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "LinearGradient": @@ -2343,51 +2162,41 @@ class Stop(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Stop": @@ -2463,51 +2272,41 @@ class Path(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Path": @@ -2589,51 +2388,41 @@ class SVG(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Svg": diff --git a/reflex/components/el/elements/metadata.py b/reflex/components/el/elements/metadata.py index fc8e1d9d6d9..9a4d18b73e6 100644 --- a/reflex/components/el/elements/metadata.py +++ b/reflex/components/el/elements/metadata.py @@ -3,7 +3,6 @@ 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 @@ -90,8 +89,8 @@ class StyleEl(Element): # noqa: E742 media: Var[Union[str, int, bool]] - special_props: Set[ImmutableVar] = { - ImmutableVar.create_safe("suppressHydrationWarning") + special_props: Set[Var] = { + Var.create_safe("suppressHydrationWarning", _var_is_string=False) } diff --git a/reflex/components/el/elements/metadata.pyi b/reflex/components/el/elements/metadata.pyi index 26e12d0e412..cb7e1dca9d9 100644 --- a/reflex/components/el/elements/metadata.pyi +++ b/reflex/components/el/elements/metadata.pyi @@ -7,7 +7,6 @@ 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 @@ -50,51 +49,41 @@ class Base(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Base": @@ -166,51 +155,41 @@ class Head(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Head": @@ -295,51 +274,41 @@ class Link(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Link": @@ -424,51 +393,41 @@ class Meta(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Meta": @@ -520,51 +479,41 @@ class Title(Element): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Title": @@ -597,51 +546,41 @@ class StyleEl(Element): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "StyleEl": diff --git a/reflex/components/el/elements/other.pyi b/reflex/components/el/elements/other.pyi index 4a106344bac..89b50b085ec 100644 --- a/reflex/components/el/elements/other.pyi +++ b/reflex/components/el/elements/other.pyi @@ -6,7 +6,6 @@ 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 @@ -48,51 +47,41 @@ class Details(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Details": @@ -166,51 +155,41 @@ class Dialog(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Dialog": @@ -283,51 +262,41 @@ class Summary(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Summary": @@ -399,51 +368,41 @@ class Slot(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Slot": @@ -515,51 +474,41 @@ class Template(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Template": @@ -631,51 +580,41 @@ class Math(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Math": @@ -748,51 +687,41 @@ class Html(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Html": diff --git a/reflex/components/el/elements/scripts.pyi b/reflex/components/el/elements/scripts.pyi index f5e9f679589..9923d8c6b6d 100644 --- a/reflex/components/el/elements/scripts.pyi +++ b/reflex/components/el/elements/scripts.pyi @@ -6,7 +6,6 @@ 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,51 +46,41 @@ class Canvas(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Canvas": @@ -163,51 +152,41 @@ class Noscript(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Noscript": @@ -292,51 +271,41 @@ class Script(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Script": diff --git a/reflex/components/el/elements/sectioning.pyi b/reflex/components/el/elements/sectioning.pyi index 5bca34ac693..2d1cc457dc4 100644 --- a/reflex/components/el/elements/sectioning.pyi +++ b/reflex/components/el/elements/sectioning.pyi @@ -6,7 +6,6 @@ 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,51 +46,41 @@ class Body(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Body": @@ -163,51 +152,41 @@ class Address(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Address": @@ -279,51 +258,41 @@ class Article(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Article": @@ -395,51 +364,41 @@ class Aside(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Aside": @@ -511,51 +470,41 @@ class Footer(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Footer": @@ -627,51 +576,41 @@ class Header(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Header": @@ -743,51 +682,41 @@ class H1(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "H1": @@ -859,51 +788,41 @@ class H2(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "H2": @@ -975,51 +894,41 @@ class H3(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "H3": @@ -1091,51 +1000,41 @@ class H4(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "H4": @@ -1207,51 +1106,41 @@ class H5(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "H5": @@ -1323,51 +1212,41 @@ class H6(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "H6": @@ -1439,51 +1318,41 @@ class Main(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Main": @@ -1555,51 +1424,41 @@ class Nav(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Nav": @@ -1671,51 +1530,41 @@ class Section(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Section": diff --git a/reflex/components/el/elements/tables.pyi b/reflex/components/el/elements/tables.pyi index 0cf41c51501..39ca144b869 100644 --- a/reflex/components/el/elements/tables.pyi +++ b/reflex/components/el/elements/tables.pyi @@ -6,7 +6,6 @@ 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 @@ -48,51 +47,41 @@ class Caption(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Caption": @@ -167,51 +156,41 @@ class Col(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Col": @@ -287,51 +266,41 @@ class Colgroup(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Colgroup": @@ -407,51 +376,41 @@ class Table(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Table": @@ -526,51 +485,41 @@ class Tbody(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Tbody": @@ -647,51 +596,41 @@ class Td(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Td": @@ -768,51 +707,41 @@ class Tfoot(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Tfoot": @@ -890,51 +819,41 @@ class Th(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Th": @@ -1012,51 +931,41 @@ class Thead(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Thead": @@ -1130,51 +1039,41 @@ class Tr(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Tr": diff --git a/reflex/components/el/elements/typography.pyi b/reflex/components/el/elements/typography.pyi index 28c8c041ee5..92637644129 100644 --- a/reflex/components/el/elements/typography.pyi +++ b/reflex/components/el/elements/typography.pyi @@ -6,7 +6,6 @@ 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 @@ -48,51 +47,41 @@ class Blockquote(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Blockquote": @@ -165,51 +154,41 @@ class Dd(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Dd": @@ -281,51 +260,41 @@ class Div(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Div": @@ -397,51 +366,41 @@ class Dl(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Dl": @@ -513,51 +472,41 @@ class Dt(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Dt": @@ -629,51 +578,41 @@ class Figcaption(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Figcaption": @@ -746,51 +685,41 @@ class Hr(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Hr": @@ -863,51 +792,41 @@ class Li(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Li": @@ -980,51 +899,41 @@ class Menu(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Menu": @@ -1100,51 +1009,41 @@ class Ol(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Ol": @@ -1219,51 +1118,41 @@ class P(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "P": @@ -1335,51 +1224,41 @@ class Pre(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Pre": @@ -1451,51 +1330,41 @@ class Ul(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Ul": @@ -1569,51 +1438,41 @@ class Ins(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Ins": @@ -1689,51 +1548,41 @@ class Del(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Del": diff --git a/reflex/components/gridjs/datatable.py b/reflex/components/gridjs/datatable.py index cd1acf10047..47069843b40 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 ImmutableVar, LiteralVar, is_computed_var +from reflex.ivars.base import ImmutableComputedVar from reflex.utils import types from reflex.utils.imports import ImportDict from reflex.utils.serializers import serialize -from reflex.vars import Var +from reflex.vars import ComputedVar, Var class Gridjs(Component): @@ -66,14 +66,17 @@ 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 is_computed_var(data) and data._var_type == Any: + if ( + isinstance(data, (ComputedVar, ImmutableComputedVar)) + 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 is_computed_var(columns) + and isinstance(columns, (ComputedVar, ImmutableComputedVar)) and columns._var_type == Any ): raise ValueError( @@ -83,7 +86,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, ImmutableVar) and types.is_dataframe(data._var_type)) + or (isinstance(data, Var) 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." @@ -91,13 +94,15 @@ def create(cls, *children, **props): # If data is a list and columns are not provided, throw an error if ( - (isinstance(data, ImmutableVar) and types._issubclass(data._var_type, List)) + (isinstance(data, Var) 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, @@ -113,9 +118,7 @@ def add_imports(self) -> ImportDict: return {"": "gridjs/dist/theme/mermaid.css"} def _render(self) -> Tag: - if isinstance(self.data, ImmutableVar) and types.is_dataframe( - self.data._var_type - ): + if isinstance(self.data, Var) 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], @@ -128,8 +131,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 = LiteralVar.create(data["columns"]) - self.data = LiteralVar.create(data["data"]) + self.columns = Var.create_safe(data["columns"]) + self.data = Var.create_safe(data["data"]) # Render the table. return super()._render() diff --git a/reflex/components/gridjs/datatable.pyi b/reflex/components/gridjs/datatable.pyi index c80cacd85fe..8f0a427b1f2 100644 --- a/reflex/components/gridjs/datatable.pyi +++ b/reflex/components/gridjs/datatable.pyi @@ -7,7 +7,6 @@ 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 @@ -23,51 +22,41 @@ class Gridjs(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Gridjs": @@ -105,51 +94,41 @@ class DataTable(Gridjs): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DataTable": diff --git a/reflex/components/lucide/icon.pyi b/reflex/components/lucide/icon.pyi index 1e25ac002f8..325322b455d 100644 --- a/reflex/components/lucide/icon.pyi +++ b/reflex/components/lucide/icon.pyi @@ -7,7 +7,6 @@ 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,51 +21,41 @@ class LucideIconComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "LucideIconComponent": @@ -99,51 +88,41 @@ class Icon(LucideIconComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Icon": diff --git a/reflex/components/markdown/markdown.py b/reflex/components/markdown/markdown.py index b44ca25dda5..cd560d00b85 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,8 +99,7 @@ def create(cls, *children, **props) -> Component: The markdown component. """ assert ( - len(children) == 1 - and types._isinstance(children[0], Union[str, ImmutableVar]) + len(children) == 1 and types._isinstance(children[0], Union[str, Var]) ), "Markdown component must have exactly one child containing the markdown source." # Update the base component map with the custom component map. @@ -195,7 +194,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_IN_TAG} + special_props = {_PROPS} children = [_CHILDREN] # For certain tags, the props from the markdown renderer are not actually valid for the component. @@ -206,7 +205,9 @@ def get_component(self, tag: str, **props) -> Component: children_prop = props.pop("children", None) if children_prop is not None: special_props.add( - ImmutableVar.create_safe(f"children={{{str(children_prop)}}}") + Var.create_safe( + f"children={{{str(children_prop)}}}", _var_is_string=False + ) ) children = [] # Get the component. @@ -227,22 +228,21 @@ def format_component(self, tag: str, **props) -> str: """ return str(self.get_component(tag, **props)).replace("\n", "") - def format_component_map(self) -> dict[str, ImmutableVar]: + def format_component_map(self) -> dict[str, str]: """Format the component map for rendering. Returns: The formatted component map. """ components = { - tag: ImmutableVar.create_safe( - f"(({{node, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => ({self.format_component(tag)}))" - ) + tag: 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"] = ImmutableVar.create_safe( - f"""(({{node, inline, className, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => {{ + components[ + "code" + ] = f"""{{({{node, inline, className, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => {{ const match = (className || '').match(/language-(?.*)/); const language = match ? match[1] : ''; if (language) {{ @@ -260,8 +260,7 @@ def format_component_map(self) -> dict[str, ImmutableVar]: ) : ( {self.format_component("codeblock", language=ImmutableVar.create_safe("language"))} ); - }})""".replace("\n", " ") - ) + }}}}""".replace("\n", " ") return components @@ -286,7 +285,7 @@ def _get_custom_code(self) -> str | None: function {self._get_component_map_name()} () {{ {formatted_hooks} return ( - {str(LiteralVar.create(self.format_component_map()))} + {str(ImmutableVar.create_safe(self.format_component_map()))} ) }} """ diff --git a/reflex/components/markdown/markdown.pyi b/reflex/components/markdown/markdown.pyi index e5f660b6cb3..299cb99ff5f 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,51 +41,41 @@ class Markdown(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Markdown": @@ -111,4 +101,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, ImmutableVar]: ... + def format_component_map(self) -> dict[str, str]: ... diff --git a/reflex/components/moment/moment.pyi b/reflex/components/moment/moment.pyi index 168a239d798..05c7ffc9610 100644 --- a/reflex/components/moment/moment.pyi +++ b/reflex/components/moment/moment.pyi @@ -8,7 +8,6 @@ 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 @@ -56,54 +55,42 @@ class Moment(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Moment": diff --git a/reflex/components/next/base.pyi b/reflex/components/next/base.pyi index 996ed41e8cc..c8b9934d80e 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,51 +23,41 @@ class NextComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "NextComponent": diff --git a/reflex/components/next/image.pyi b/reflex/components/next/image.pyi index 695a8d80e19..e6b902cb02e 100644 --- a/reflex/components/next/image.pyi +++ b/reflex/components/next/image.pyi @@ -6,7 +6,6 @@ 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 @@ -37,57 +36,43 @@ class Image(NextComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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_load: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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_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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Image": diff --git a/reflex/components/next/link.pyi b/reflex/components/next/link.pyi index 0aa6e41279b..c25ca825884 100644 --- a/reflex/components/next/link.pyi +++ b/reflex/components/next/link.pyi @@ -7,7 +7,6 @@ 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 @@ -24,51 +23,41 @@ class NextLink(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "NextLink": diff --git a/reflex/components/next/video.pyi b/reflex/components/next/video.pyi index f1f1b94de15..13b39a4f8fd 100644 --- a/reflex/components/next/video.pyi +++ b/reflex/components/next/video.pyi @@ -7,7 +7,6 @@ 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 @@ -26,51 +25,41 @@ class Video(NextComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Video": diff --git a/reflex/components/plotly/plotly.py b/reflex/components/plotly/plotly.py index ed7040d1c8c..a2393fdcaad 100644 --- a/reflex/components/plotly/plotly.py +++ b/reflex/components/plotly/plotly.py @@ -8,7 +8,6 @@ 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 @@ -31,7 +30,7 @@ def _event_data_signature(e0: Var) -> List[Any]: Returns: The event key extracted from the event data (if defined). """ - return [ImmutableVar.create_safe(f"{e0}?.event")] + return [Var.create_safe(f"{e0}?.event", _var_is_string=False)] def _event_points_data_signature(e0: Var) -> List[Any]: @@ -44,8 +43,11 @@ def _event_points_data_signature(e0: Var) -> List[Any]: The event data and the extracted points. """ return [ - ImmutableVar.create_safe(f"{e0}?.event"), - ImmutableVar.create_safe(f"extractPoints({e0}?.points)"), + Var.create_safe(f"{e0}?.event", _var_is_string=False), + Var.create_safe( + f"extractPoints({e0}?.points)", + _var_is_string=False, + ), ] @@ -114,7 +116,7 @@ class Plotly(NoSSRComponent): config: Var[Dict] # If true, the graph will resize when the window is resized. - use_resize_handler: Var[bool] = LiteralVar.create(True) + use_resize_handler: Var[bool] = Var.create_safe(True) # Fired after the plot is redrawn. on_after_plot: EventHandler[_passthrough_signature] @@ -240,10 +242,10 @@ def create(cls, *children, **props) -> Component: from plotly.io import templates responsive_template = color_mode_cond( - light=LiteralVar.create(templates["plotly"]), - dark=LiteralVar.create(templates["plotly_dark"]), + light=Var.create_safe(templates["plotly"]).to(dict), + dark=Var.create_safe(templates["plotly_dark"]).to(dict), ) - if isinstance(responsive_template, ImmutableVar): + if isinstance(responsive_template, Var): # Mark the conditional Var as a Template to avoid type mismatch responsive_template = responsive_template.to(Template) props.setdefault("template", responsive_template) @@ -255,26 +257,36 @@ def _exclude_props(self) -> set[str]: def _render(self): tag = super()._render() - figure = self.data.upcast().to(dict) + figure = self.data.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 = LiteralVar.create({"layout": self.layout}) + layout_dict = Var.create_safe( + f"{{'layout': {self.layout.to(dict)._var_name_unwrapped}}}" + ).to(dict) merge_dicts.append(layout_dict) if self.template is not None: - template_dict = LiteralVar.create({"layout": {"template": self.template}}) - merge_dicts.append(template_dict.without_data()) + 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) if merge_dicts: tag.special_props.add( # Merge all dictionaries and spread the result over props. - ImmutableVar.create_safe( - f"{{...mergician({str(figure)}," - f"{','.join(str(md) for md in merge_dicts)})}}", + Var.create_safe( + f"{{...mergician({figure._var_name_unwrapped}," + f"{','.join(md._var_name_unwrapped for md in merge_dicts)})}}", + _var_is_string=False, ), ) else: # Spread the figure dict over props, nothing to merge. - tag.special_props.add(ImmutableVar.create_safe(f"{{...{str(figure)}}}")) + tag.special_props.add( + Var.create_safe( + f"{{...{figure._var_name_unwrapped}}}", _var_is_string=False + ) + ) return tag diff --git a/reflex/components/plotly/plotly.pyi b/reflex/components/plotly/plotly.pyi index 48797a7ef1a..c308e160fa8 100644 --- a/reflex/components/plotly/plotly.pyi +++ b/reflex/components/plotly/plotly.pyi @@ -8,7 +8,6 @@ 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 @@ -45,105 +44,91 @@ class Plotly(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_after_plot: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_animated: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_animating_frame: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_animation_interrupted: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_autosize: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_before_hover: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_button_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_deselect: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_redraw: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_redraw: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_relayout: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_relayouting: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_restyle: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_selected: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_selecting: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_transition_interrupted: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_transitioning: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_unhover: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Plotly": diff --git a/reflex/components/props.py b/reflex/components/props.py index 2966e9727e0..a66ba7f2f94 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,6 +20,12 @@ def json(self) -> str: Returns: The object as a Javascript Object literal. """ - return LiteralObjectVar.create( - {format.to_camel_case(key): value for key, value in self.dict().items()} - ).json() + return format.unwrap_vars( + self.__config__.json_dumps( + { + format.to_camel_case(key): value + for key, value in self.dict().items() + }, + default=serialize, + ) + ) diff --git a/reflex/components/radix/primitives/accordion.py b/reflex/components/radix/primitives/accordion.py index cfd5808a67a..da32d747b51 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 ImmutableVar, LiteralVar +from reflex.ivars.base import 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 | ImmutableVar] = None, - content: Optional[Component | ImmutableVar] = None, + header: Optional[Component | Var] = None, + content: Optional[Component | Var] = None, **props, ) -> Component: """Create an accordion item. diff --git a/reflex/components/radix/primitives/accordion.pyi b/reflex/components/radix/primitives/accordion.pyi index 651e16b3432..edf01118312 100644 --- a/reflex/components/radix/primitives/accordion.pyi +++ b/reflex/components/radix/primitives/accordion.pyi @@ -9,7 +9,6 @@ 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 @@ -101,51 +100,41 @@ class AccordionComponent(RadixPrimitiveComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AccordionComponent": @@ -275,54 +264,44 @@ class AccordionRoot(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_value_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AccordionRoot": @@ -363,8 +342,8 @@ class AccordionItem(AccordionComponent): def create( # type: ignore cls, *children, - header: Optional[Union[Component, ImmutableVar]] = None, - content: Optional[Union[Component, ImmutableVar]] = None, + header: Optional[Union[Component, Var]] = None, + content: Optional[Union[Component, Var]] = None, value: Optional[Union[Var[str], str]] = None, disabled: Optional[Union[Var[bool], bool]] = None, color_scheme: Optional[ @@ -441,51 +420,41 @@ class AccordionItem(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AccordionItem": @@ -595,51 +564,41 @@ class AccordionHeader(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AccordionHeader": @@ -745,51 +704,41 @@ class AccordionTrigger(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AccordionTrigger": @@ -827,51 +776,41 @@ class AccordionIcon(Icon): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AccordionIcon": @@ -974,51 +913,41 @@ class AccordionContent(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AccordionContent": diff --git a/reflex/components/radix/primitives/base.pyi b/reflex/components/radix/primitives/base.pyi index 1241044d2cd..a94b2263c50 100644 --- a/reflex/components/radix/primitives/base.pyi +++ b/reflex/components/radix/primitives/base.pyi @@ -7,7 +7,6 @@ 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,51 +22,41 @@ class RadixPrimitiveComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadixPrimitiveComponent": @@ -101,51 +90,41 @@ class RadixPrimitiveComponentWithClassName(RadixPrimitiveComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadixPrimitiveComponentWithClassName": diff --git a/reflex/components/radix/primitives/drawer.pyi b/reflex/components/radix/primitives/drawer.pyi index ddb770b36eb..c40bdf53df1 100644 --- a/reflex/components/radix/primitives/drawer.pyi +++ b/reflex/components/radix/primitives/drawer.pyi @@ -8,7 +8,6 @@ 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 @@ -24,51 +23,41 @@ class DrawerComponent(RadixPrimitiveComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerComponent": @@ -118,54 +107,44 @@ class DrawerRoot(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerRoot": @@ -208,51 +187,41 @@ class DrawerTrigger(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerTrigger": @@ -279,51 +248,41 @@ class DrawerPortal(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerPortal": @@ -357,66 +316,56 @@ class DrawerContent(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerContent": @@ -454,51 +403,41 @@ class DrawerOverlay(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerOverlay": @@ -532,51 +471,41 @@ class DrawerClose(DrawerTrigger): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerClose": @@ -603,51 +532,41 @@ class DrawerTitle(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerTitle": @@ -681,51 +600,41 @@ class DrawerDescription(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerDescription": @@ -780,54 +689,44 @@ class Drawer(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerRoot": diff --git a/reflex/components/radix/primitives/form.pyi b/reflex/components/radix/primitives/form.pyi index 20df4b85a2c..758630c4a61 100644 --- a/reflex/components/radix/primitives/form.pyi +++ b/reflex/components/radix/primitives/form.pyi @@ -8,7 +8,6 @@ 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 @@ -26,51 +25,41 @@ class FormComponent(RadixPrimitiveComponentWithClassName): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormComponent": @@ -144,57 +133,45 @@ class FormRoot(FormComponent, HTMLForm): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_clear_server_errors: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormRoot": @@ -258,51 +235,41 @@ class FormField(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormField": @@ -339,51 +306,41 @@ class FormLabel(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormLabel": @@ -417,51 +374,41 @@ class FormControl(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormControl": @@ -545,51 +492,41 @@ class FormMessage(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormMessage": @@ -626,51 +563,41 @@ class FormValidityState(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormValidityState": @@ -704,51 +631,41 @@ class FormSubmit(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FormSubmit": @@ -823,57 +740,45 @@ class Form(FormRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_clear_server_errors: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Form": @@ -979,57 +884,45 @@ class FormNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_clear_server_errors: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Form": diff --git a/reflex/components/radix/primitives/progress.pyi b/reflex/components/radix/primitives/progress.pyi index 630432abae6..f1c817587ba 100644 --- a/reflex/components/radix/primitives/progress.pyi +++ b/reflex/components/radix/primitives/progress.pyi @@ -8,7 +8,6 @@ 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 @@ -24,51 +23,41 @@ class ProgressComponent(RadixPrimitiveComponentWithClassName): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ProgressComponent": @@ -109,51 +98,41 @@ class ProgressRoot(ProgressComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ProgressRoot": @@ -253,51 +232,41 @@ class ProgressIndicator(ProgressComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ProgressIndicator": @@ -404,51 +373,41 @@ class Progress(ProgressRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Progress": @@ -556,51 +515,41 @@ class ProgressNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Progress": diff --git a/reflex/components/radix/primitives/slider.pyi b/reflex/components/radix/primitives/slider.pyi index e3bd2780569..9ce737df478 100644 --- a/reflex/components/radix/primitives/slider.pyi +++ b/reflex/components/radix/primitives/slider.pyi @@ -8,7 +8,6 @@ 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 @@ -27,51 +26,41 @@ class SliderComponent(RadixPrimitiveComponentWithClassName): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SliderComponent": @@ -122,57 +111,47 @@ class SliderRoot(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_value_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_value_commit: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SliderRoot": @@ -207,51 +186,41 @@ class SliderTrack(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SliderTrack": @@ -286,51 +255,41 @@ class SliderRange(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SliderRange": @@ -365,51 +324,41 @@ class SliderThumb(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SliderThumb": diff --git a/reflex/components/radix/themes/base.pyi b/reflex/components/radix/themes/base.pyi index c79557024d3..5aea55d9089 100644 --- a/reflex/components/radix/themes/base.pyi +++ b/reflex/components/radix/themes/base.pyi @@ -7,7 +7,6 @@ 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 @@ -103,51 +102,41 @@ class CommonMarginProps(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CommonMarginProps": @@ -187,51 +176,41 @@ class RadixLoadingProp(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadixLoadingProp": @@ -264,51 +243,41 @@ class RadixThemesComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadixThemesComponent": @@ -343,51 +312,41 @@ class RadixThemesTriggerComponent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadixThemesTriggerComponent": @@ -505,51 +464,41 @@ class Theme(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Theme": @@ -595,51 +544,41 @@ class ThemePanel(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ThemePanel": @@ -675,51 +614,41 @@ class RadixThemesColorModeProvider(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadixThemesColorModeProvider": diff --git a/reflex/components/radix/themes/color_mode.py b/reflex/components/radix/themes/color_mode.py index 2e6707d01d2..0331d7184d8 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 Dict, List, Literal, get_args +from typing import Literal, get_args from reflex.components.component import BaseComponent from reflex.components.core.cond import Cond, color_mode_cond, cond @@ -25,7 +25,6 @@ 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, @@ -33,6 +32,7 @@ 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: List[str] = list(get_args(LiteralPosition)) +position_values = get_args(LiteralPosition) -position_map: Dict[str, List[str]] = { +position_map = { "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: List[str], var): - return LiteralArrayVar.create(const).contains(var) +def _find(const, var): + return Var.create_safe(const, _var_is_string=False).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, ImmutableVar): + if isinstance(position, Var): _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 8712e526bd2..a746068c323 100644 --- a/reflex/components/radix/themes/color_mode.pyi +++ b/reflex/components/radix/themes/color_mode.pyi @@ -3,16 +3,7 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import ( - Any, - Callable, - Dict, - List, - Literal, - Optional, - Union, - overload, -) +from typing import Any, Callable, Dict, Literal, Optional, Union, get_args, overload from reflex.components.component import BaseComponent from reflex.components.core.breakpoints import Breakpoints @@ -46,51 +37,41 @@ class ColorModeIcon(Cond): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ColorModeIcon": @@ -106,8 +87,14 @@ class ColorModeIcon(Cond): ... LiteralPosition = Literal["top-left", "top-right", "bottom-left", "bottom-right"] -position_values: List[str] -position_map: Dict[str, List[str]] +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"], +} class ColorModeIconButton(IconButton): @overload @@ -248,51 +235,41 @@ class ColorModeIconButton(IconButton): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ColorModeIconButton": @@ -451,54 +428,42 @@ class ColorModeSwitch(Switch): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ColorModeSwitch": diff --git a/reflex/components/radix/themes/components/alert_dialog.pyi b/reflex/components/radix/themes/components/alert_dialog.pyi index 8d135e6f8f2..4cb9e966cfd 100644 --- a/reflex/components/radix/themes/components/alert_dialog.pyi +++ b/reflex/components/radix/themes/components/alert_dialog.pyi @@ -9,7 +9,6 @@ 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,54 +28,44 @@ class AlertDialogRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AlertDialogRoot": @@ -112,51 +101,41 @@ class AlertDialogTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AlertDialogTrigger": @@ -219,60 +198,50 @@ class AlertDialogContent(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AlertDialogContent": @@ -325,51 +294,41 @@ class AlertDialogTitle(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AlertDialogTitle": @@ -404,51 +363,41 @@ class AlertDialogDescription(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AlertDialogDescription": @@ -483,51 +432,41 @@ class AlertDialogAction(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AlertDialogAction": @@ -553,51 +492,41 @@ class AlertDialogCancel(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AlertDialogCancel": diff --git a/reflex/components/radix/themes/components/aspect_ratio.pyi b/reflex/components/radix/themes/components/aspect_ratio.pyi index 6ca61f67ca5..612c67a2965 100644 --- a/reflex/components/radix/themes/components/aspect_ratio.pyi +++ b/reflex/components/radix/themes/components/aspect_ratio.pyi @@ -6,7 +6,6 @@ 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 @@ -24,51 +23,41 @@ class AspectRatio(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AspectRatio": diff --git a/reflex/components/radix/themes/components/avatar.pyi b/reflex/components/radix/themes/components/avatar.pyi index 9a92c73f501..c0476d543de 100644 --- a/reflex/components/radix/themes/components/avatar.pyi +++ b/reflex/components/radix/themes/components/avatar.pyi @@ -7,7 +7,6 @@ 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 @@ -114,51 +113,41 @@ class Avatar(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Avatar": diff --git a/reflex/components/radix/themes/components/badge.pyi b/reflex/components/radix/themes/components/badge.pyi index c2936210a98..327fe2b90f8 100644 --- a/reflex/components/radix/themes/components/badge.pyi +++ b/reflex/components/radix/themes/components/badge.pyi @@ -8,7 +8,6 @@ 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 @@ -135,51 +134,41 @@ class Badge(elements.Span, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Badge": diff --git a/reflex/components/radix/themes/components/button.pyi b/reflex/components/radix/themes/components/button.pyi index 145de6452d5..95a80c84e7a 100644 --- a/reflex/components/radix/themes/components/button.pyi +++ b/reflex/components/radix/themes/components/button.pyi @@ -8,7 +8,6 @@ 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 @@ -158,51 +157,41 @@ 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Button": diff --git a/reflex/components/radix/themes/components/callout.pyi b/reflex/components/radix/themes/components/callout.pyi index 4bd7a54a354..04e1d131787 100644 --- a/reflex/components/radix/themes/components/callout.pyi +++ b/reflex/components/radix/themes/components/callout.pyi @@ -9,7 +9,6 @@ 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 @@ -133,51 +132,41 @@ class CalloutRoot(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CalloutRoot": @@ -257,51 +246,41 @@ class CalloutIcon(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CalloutIcon": @@ -376,51 +355,41 @@ class CalloutText(elements.P, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CalloutText": @@ -578,51 +547,41 @@ class Callout(CalloutRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Callout": @@ -786,51 +745,41 @@ class CalloutNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Callout": diff --git a/reflex/components/radix/themes/components/card.pyi b/reflex/components/radix/themes/components/card.pyi index ed4399ecc0b..142cc74484b 100644 --- a/reflex/components/radix/themes/components/card.pyi +++ b/reflex/components/radix/themes/components/card.pyi @@ -8,7 +8,6 @@ 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 @@ -68,51 +67,41 @@ class Card(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Card": diff --git a/reflex/components/radix/themes/components/checkbox.pyi b/reflex/components/radix/themes/components/checkbox.pyi index 0498f5a902e..52441eef4c9 100644 --- a/reflex/components/radix/themes/components/checkbox.pyi +++ b/reflex/components/radix/themes/components/checkbox.pyi @@ -8,7 +8,6 @@ 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 @@ -115,54 +114,42 @@ class Checkbox(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Checkbox": @@ -294,54 +281,42 @@ class HighLevelCheckbox(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HighLevelCheckbox": @@ -470,54 +445,42 @@ class CheckboxNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HighLevelCheckbox": diff --git a/reflex/components/radix/themes/components/checkbox_cards.pyi b/reflex/components/radix/themes/components/checkbox_cards.pyi index 519a5587ddf..d7be8a056e1 100644 --- a/reflex/components/radix/themes/components/checkbox_cards.pyi +++ b/reflex/components/radix/themes/components/checkbox_cards.pyi @@ -8,7 +8,6 @@ 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 @@ -148,51 +147,41 @@ class CheckboxCardsRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CheckboxCardsRoot": @@ -233,51 +222,41 @@ class CheckboxCardsItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CheckboxCardsItem": diff --git a/reflex/components/radix/themes/components/checkbox_group.pyi b/reflex/components/radix/themes/components/checkbox_group.pyi index 080125f00bd..8a730b870c0 100644 --- a/reflex/components/radix/themes/components/checkbox_group.pyi +++ b/reflex/components/radix/themes/components/checkbox_group.pyi @@ -8,7 +8,6 @@ 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 @@ -107,51 +106,41 @@ class CheckboxGroupRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CheckboxGroupRoot": @@ -194,51 +183,41 @@ class CheckboxGroupItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CheckboxGroupItem": diff --git a/reflex/components/radix/themes/components/context_menu.pyi b/reflex/components/radix/themes/components/context_menu.pyi index 49d703d138a..e2f9d01e29d 100644 --- a/reflex/components/radix/themes/components/context_menu.pyi +++ b/reflex/components/radix/themes/components/context_menu.pyi @@ -8,7 +8,6 @@ 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 @@ -26,54 +25,44 @@ class ContextMenuRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuRoot": @@ -110,51 +99,41 @@ class ContextMenuTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuTrigger": @@ -265,66 +244,56 @@ class ContextMenuContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuContent": @@ -365,51 +334,41 @@ class ContextMenuSub(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuSub": @@ -445,51 +404,41 @@ class ContextMenuSubTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuSubTrigger": @@ -526,63 +475,53 @@ class ContextMenuSubContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuSubContent": @@ -681,51 +620,41 @@ class ContextMenuItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuItem": @@ -762,51 +691,41 @@ class ContextMenuSeparator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ContextMenuSeparator": diff --git a/reflex/components/radix/themes/components/data_list.pyi b/reflex/components/radix/themes/components/data_list.pyi index a73a9264a0e..93d00c86b21 100644 --- a/reflex/components/radix/themes/components/data_list.pyi +++ b/reflex/components/radix/themes/components/data_list.pyi @@ -8,7 +8,6 @@ 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 @@ -60,51 +59,41 @@ class DataListRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DataListRoot": @@ -159,51 +148,41 @@ class DataListItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DataListItem": @@ -310,51 +289,41 @@ class DataListLabel(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DataListLabel": @@ -393,51 +362,41 @@ class DataListValue(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DataListValue": diff --git a/reflex/components/radix/themes/components/dialog.pyi b/reflex/components/radix/themes/components/dialog.pyi index eaae1bfeeb2..02b1a6c9f70 100644 --- a/reflex/components/radix/themes/components/dialog.pyi +++ b/reflex/components/radix/themes/components/dialog.pyi @@ -9,7 +9,6 @@ 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,54 +26,44 @@ class DialogRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DialogRoot": @@ -110,51 +99,41 @@ class DialogTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DialogTrigger": @@ -180,51 +159,41 @@ class DialogTitle(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DialogTitle": @@ -295,66 +264,56 @@ class DialogContent(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DialogContent": @@ -406,51 +365,41 @@ class DialogDescription(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DialogDescription": @@ -485,51 +434,41 @@ class DialogClose(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DialogClose": @@ -561,54 +500,44 @@ class Dialog(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DialogRoot": diff --git a/reflex/components/radix/themes/components/dropdown_menu.pyi b/reflex/components/radix/themes/components/dropdown_menu.pyi index 2f324fa9afd..df7b235894c 100644 --- a/reflex/components/radix/themes/components/dropdown_menu.pyi +++ b/reflex/components/radix/themes/components/dropdown_menu.pyi @@ -8,7 +8,6 @@ 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 @@ -36,54 +35,44 @@ class DropdownMenuRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuRoot": @@ -123,51 +112,41 @@ class DropdownMenuTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuTrigger": @@ -297,66 +276,56 @@ class DropdownMenuContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuContent": @@ -410,51 +379,41 @@ class DropdownMenuSubTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuSubTrigger": @@ -482,54 +441,44 @@ class DropdownMenuSub(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuSub": @@ -585,63 +534,53 @@ class DropdownMenuSubContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuSubContent": @@ -752,54 +691,42 @@ class DropdownMenuItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuItem": @@ -839,51 +766,41 @@ class DropdownMenuSeparator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DropdownMenuSeparator": diff --git a/reflex/components/radix/themes/components/hover_card.pyi b/reflex/components/radix/themes/components/hover_card.pyi index dd575898d85..ad56a83027a 100644 --- a/reflex/components/radix/themes/components/hover_card.pyi +++ b/reflex/components/radix/themes/components/hover_card.pyi @@ -9,7 +9,6 @@ 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 @@ -30,54 +29,44 @@ class HoverCardRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HoverCardRoot": @@ -116,51 +105,41 @@ class HoverCardTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HoverCardTrigger": @@ -230,51 +209,41 @@ class HoverCardContent(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HoverCardContent": @@ -335,54 +304,44 @@ class HoverCard(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HoverCardRoot": diff --git a/reflex/components/radix/themes/components/icon_button.py b/reflex/components/radix/themes/components/icon_button.py index 8a39af0a7dd..76077057ee7 100644 --- a/reflex/components/radix/themes/components/icon_button.py +++ b/reflex/components/radix/themes/components/icon_button.py @@ -9,7 +9,6 @@ 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 @@ -83,7 +82,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, ImmutableVar): + if not isinstance(size_map_var, Var): 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 e8a2295b4ff..b5c75a9b6cf 100644 --- a/reflex/components/radix/themes/components/icon_button.pyi +++ b/reflex/components/radix/themes/components/icon_button.pyi @@ -8,7 +8,6 @@ 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 @@ -158,51 +157,41 @@ 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[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "IconButton": diff --git a/reflex/components/radix/themes/components/inset.pyi b/reflex/components/radix/themes/components/inset.pyi index cefda619b2a..3671d2a5ca8 100644 --- a/reflex/components/radix/themes/components/inset.pyi +++ b/reflex/components/radix/themes/components/inset.pyi @@ -8,7 +8,6 @@ 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 @@ -133,51 +132,41 @@ class Inset(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Inset": diff --git a/reflex/components/radix/themes/components/popover.pyi b/reflex/components/radix/themes/components/popover.pyi index 4339a8c430c..d8bd9d1d6f6 100644 --- a/reflex/components/radix/themes/components/popover.pyi +++ b/reflex/components/radix/themes/components/popover.pyi @@ -9,7 +9,6 @@ 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,54 +27,44 @@ class PopoverRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PopoverRoot": @@ -112,51 +101,41 @@ class PopoverTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PopoverTrigger": @@ -233,69 +212,59 @@ class PopoverContent(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PopoverContent": @@ -352,51 +321,41 @@ class PopoverClose(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PopoverClose": diff --git a/reflex/components/radix/themes/components/progress.pyi b/reflex/components/radix/themes/components/progress.pyi index b3a4ce89d81..a647e94e641 100644 --- a/reflex/components/radix/themes/components/progress.pyi +++ b/reflex/components/radix/themes/components/progress.pyi @@ -7,7 +7,6 @@ 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,51 +112,41 @@ class Progress(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Progress": diff --git a/reflex/components/radix/themes/components/radio.pyi b/reflex/components/radix/themes/components/radio.pyi index 06cb6bef332..5c1b303fa06 100644 --- a/reflex/components/radix/themes/components/radio.pyi +++ b/reflex/components/radix/themes/components/radio.pyi @@ -7,7 +7,6 @@ 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 @@ -104,51 +103,41 @@ class Radio(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Radio": diff --git a/reflex/components/radix/themes/components/radio_cards.pyi b/reflex/components/radix/themes/components/radio_cards.pyi index fac079ca9b4..2c0bf002b0e 100644 --- a/reflex/components/radix/themes/components/radio_cards.pyi +++ b/reflex/components/radix/themes/components/radio_cards.pyi @@ -8,7 +8,6 @@ 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 @@ -162,54 +161,44 @@ class RadioCardsRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_value_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadioCardsRoot": @@ -262,51 +251,41 @@ class RadioCardsItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadioCardsItem": diff --git a/reflex/components/radix/themes/components/radio_group.py b/reflex/components/radix/themes/components/radio_group.py index 563f5d2dcd8..174abbac639 100644 --- a/reflex/components/radix/themes/components/radio_group.py +++ b/reflex/components/radix/themes/components/radio_group.py @@ -146,13 +146,11 @@ def create( default_value = props.pop("default_value", "") if ( - not isinstance(items, (list, ImmutableVar)) - or isinstance(items, ImmutableVar) + not isinstance(items, (list, Var)) + or isinstance(items, Var) and not types._issubclass(items._var_type, list) ): - items_type = ( - type(items) if not isinstance(items, ImmutableVar) else items._var_type - ) + items_type = type(items) if not isinstance(items, Var) else items._var_type raise TypeError( f"The radio group component takes in a list, got {items_type} instead" ) @@ -162,15 +160,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, ImmutableVar) and default_value._var_type is str + isinstance(default_value, Var) 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: ImmutableVar) -> Component: + def radio_group_item(value: Var) -> Component: item_value = rx.cond( - value.js_type() == "string", + value._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 c8f8317ac85..559607ae575 100644 --- a/reflex/components/radix/themes/components/radio_group.pyi +++ b/reflex/components/radix/themes/components/radio_group.pyi @@ -8,7 +8,6 @@ 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 @@ -112,54 +111,42 @@ class RadioGroupRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadioGroupRoot": @@ -206,51 +193,41 @@ class RadioGroupItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadioGroupItem": @@ -378,51 +355,41 @@ class HighLevelRadioGroup(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HighLevelRadioGroup": @@ -560,51 +527,41 @@ class RadioGroup(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HighLevelRadioGroup": diff --git a/reflex/components/radix/themes/components/scroll_area.pyi b/reflex/components/radix/themes/components/scroll_area.pyi index 20c9c35afdb..8b4e44df524 100644 --- a/reflex/components/radix/themes/components/scroll_area.pyi +++ b/reflex/components/radix/themes/components/scroll_area.pyi @@ -6,7 +6,6 @@ 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,51 +35,41 @@ class ScrollArea(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ScrollArea": diff --git a/reflex/components/radix/themes/components/segmented_control.pyi b/reflex/components/radix/themes/components/segmented_control.pyi index b7511196f79..f284dab771f 100644 --- a/reflex/components/radix/themes/components/segmented_control.pyi +++ b/reflex/components/radix/themes/components/segmented_control.pyi @@ -8,7 +8,6 @@ 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 @@ -114,54 +113,42 @@ class SegmentedControlRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SegmentedControlRoot": @@ -202,51 +189,41 @@ class SegmentedControlItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SegmentedControlItem": diff --git a/reflex/components/radix/themes/components/select.py b/reflex/components/radix/themes/components/select.py index b2bd69e9a0b..fc10d00ded6 100644 --- a/reflex/components/radix/themes/components/select.py +++ b/reflex/components/radix/themes/components/select.py @@ -5,7 +5,6 @@ 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 ( @@ -217,7 +216,7 @@ def create(cls, items: Union[List[str], Var[List[str]]], **props) -> Component: label = props.pop("label", None) - if isinstance(items, ImmutableVar): + if isinstance(items, Var): 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 fa6149d0ea9..e2657b7ce0e 100644 --- a/reflex/components/radix/themes/components/select.pyi +++ b/reflex/components/radix/themes/components/select.pyi @@ -8,7 +8,6 @@ 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 @@ -43,57 +42,45 @@ class SelectRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SelectRoot": @@ -211,51 +198,41 @@ class SelectTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SelectTrigger": @@ -380,60 +357,50 @@ class SelectContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SelectContent": @@ -476,51 +443,41 @@ class SelectGroup(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SelectGroup": @@ -557,51 +514,41 @@ class SelectItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SelectItem": @@ -638,51 +585,41 @@ class SelectLabel(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SelectLabel": @@ -717,51 +654,41 @@ class SelectSeparator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SelectSeparator": @@ -899,57 +826,45 @@ class HighLevelSelect(SelectRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HighLevelSelect": @@ -1107,57 +1022,45 @@ class Select(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HighLevelSelect": diff --git a/reflex/components/radix/themes/components/separator.pyi b/reflex/components/radix/themes/components/separator.pyi index 13b3276d2c2..15670f51a9d 100644 --- a/reflex/components/radix/themes/components/separator.pyi +++ b/reflex/components/radix/themes/components/separator.pyi @@ -7,7 +7,6 @@ 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,51 +112,41 @@ class Separator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Separator": diff --git a/reflex/components/radix/themes/components/skeleton.pyi b/reflex/components/radix/themes/components/skeleton.pyi index dcf0bd3c5be..d6c6bbb03c0 100644 --- a/reflex/components/radix/themes/components/skeleton.pyi +++ b/reflex/components/radix/themes/components/skeleton.pyi @@ -7,7 +7,6 @@ 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 @@ -43,51 +42,41 @@ class Skeleton(RadixLoadingProp, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Skeleton": diff --git a/reflex/components/radix/themes/components/slider.py b/reflex/components/radix/themes/components/slider.py index 55b13a3867c..c03fffe7bbb 100644 --- a/reflex/components/radix/themes/components/slider.py +++ b/reflex/components/radix/themes/components/slider.py @@ -5,7 +5,6 @@ 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 ( @@ -89,7 +88,7 @@ def create( """ default_value = props.pop("default_value", [50]) - if isinstance(default_value, ImmutableVar): + if isinstance(default_value, Var): 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 23e886f3573..362451bfe25 100644 --- a/reflex/components/radix/themes/components/slider.pyi +++ b/reflex/components/radix/themes/components/slider.pyi @@ -7,7 +7,6 @@ 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 @@ -133,57 +132,45 @@ class Slider(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_value_commit: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Slider": diff --git a/reflex/components/radix/themes/components/spinner.pyi b/reflex/components/radix/themes/components/spinner.pyi index 5ae9593391e..7fa62734a92 100644 --- a/reflex/components/radix/themes/components/spinner.pyi +++ b/reflex/components/radix/themes/components/spinner.pyi @@ -7,7 +7,6 @@ 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 @@ -38,51 +37,41 @@ class Spinner(RadixLoadingProp, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Spinner": diff --git a/reflex/components/radix/themes/components/switch.pyi b/reflex/components/radix/themes/components/switch.pyi index 5e4b0b47e93..a0f85dbac1b 100644 --- a/reflex/components/radix/themes/components/switch.pyi +++ b/reflex/components/radix/themes/components/switch.pyi @@ -7,7 +7,6 @@ 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 @@ -118,54 +117,42 @@ class Switch(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Switch": diff --git a/reflex/components/radix/themes/components/table.pyi b/reflex/components/radix/themes/components/table.pyi index 5a872c7c878..9cac240f272 100644 --- a/reflex/components/radix/themes/components/table.pyi +++ b/reflex/components/radix/themes/components/table.pyi @@ -9,7 +9,6 @@ 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 @@ -66,51 +65,41 @@ class TableRoot(elements.Table, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TableRoot": @@ -190,51 +179,41 @@ class TableHeader(elements.Thead, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TableHeader": @@ -316,51 +295,41 @@ class TableRow(elements.Tr, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TableRow": @@ -447,51 +416,41 @@ class TableColumnHeaderCell(elements.Th, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TableColumnHeaderCell": @@ -573,51 +532,41 @@ class TableBody(elements.Tbody, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TableBody": @@ -703,51 +652,41 @@ class TableCell(elements.Td, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TableCell": @@ -838,51 +777,41 @@ class TableRowHeaderCell(elements.Th, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TableRowHeaderCell": diff --git a/reflex/components/radix/themes/components/tabs.pyi b/reflex/components/radix/themes/components/tabs.pyi index 000eb05d920..0fb33b16dd7 100644 --- a/reflex/components/radix/themes/components/tabs.pyi +++ b/reflex/components/radix/themes/components/tabs.pyi @@ -8,7 +8,6 @@ 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 @@ -40,54 +39,42 @@ class TabsRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TabsRoot": @@ -136,51 +123,41 @@ class TabsList(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TabsList": @@ -281,51 +258,41 @@ class TabsTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TabsTrigger": @@ -365,51 +332,41 @@ class TabsContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TabsContent": @@ -461,54 +418,42 @@ class Tabs(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TabsRoot": diff --git a/reflex/components/radix/themes/components/text_area.pyi b/reflex/components/radix/themes/components/text_area.pyi index 561f041ab07..9a8a4787349 100644 --- a/reflex/components/radix/themes/components/text_area.pyi +++ b/reflex/components/radix/themes/components/text_area.pyi @@ -8,7 +8,6 @@ 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 @@ -168,60 +167,46 @@ class TextArea(RadixThemesComponent, elements.Textarea): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TextArea": diff --git a/reflex/components/radix/themes/components/text_field.pyi b/reflex/components/radix/themes/components/text_field.pyi index 9dbaa9692c0..be58b8e7f02 100644 --- a/reflex/components/radix/themes/components/text_field.pyi +++ b/reflex/components/radix/themes/components/text_field.pyi @@ -9,7 +9,6 @@ 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 @@ -149,60 +148,46 @@ class TextFieldRoot(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TextFieldRoot": @@ -327,51 +312,41 @@ class TextFieldSlot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TextFieldSlot": @@ -527,60 +502,46 @@ class TextField(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "TextFieldRoot": diff --git a/reflex/components/radix/themes/components/tooltip.pyi b/reflex/components/radix/themes/components/tooltip.pyi index 80f48318323..a2344958ffa 100644 --- a/reflex/components/radix/themes/components/tooltip.pyi +++ b/reflex/components/radix/themes/components/tooltip.pyi @@ -6,7 +6,6 @@ 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 @@ -62,60 +61,50 @@ class Tooltip(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_escape_key_down: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Tooltip": diff --git a/reflex/components/radix/themes/layout/base.pyi b/reflex/components/radix/themes/layout/base.pyi index dc557b5ee4c..21fed38eff2 100644 --- a/reflex/components/radix/themes/layout/base.pyi +++ b/reflex/components/radix/themes/layout/base.pyi @@ -7,7 +7,6 @@ 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 @@ -201,51 +200,41 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "LayoutComponent": diff --git a/reflex/components/radix/themes/layout/box.pyi b/reflex/components/radix/themes/layout/box.pyi index 4d7404af1d4..6bcd75cadaa 100644 --- a/reflex/components/radix/themes/layout/box.pyi +++ b/reflex/components/radix/themes/layout/box.pyi @@ -7,7 +7,6 @@ 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 @@ -48,51 +47,41 @@ class Box(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Box": diff --git a/reflex/components/radix/themes/layout/center.pyi b/reflex/components/radix/themes/layout/center.pyi index a015ab46c8c..93f8848983d 100644 --- a/reflex/components/radix/themes/layout/center.pyi +++ b/reflex/components/radix/themes/layout/center.pyi @@ -7,7 +7,6 @@ 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 @@ -125,51 +124,41 @@ class Center(Flex): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Center": diff --git a/reflex/components/radix/themes/layout/container.pyi b/reflex/components/radix/themes/layout/container.pyi index 269af2e43a5..3c2013b8e43 100644 --- a/reflex/components/radix/themes/layout/container.pyi +++ b/reflex/components/radix/themes/layout/container.pyi @@ -8,7 +8,6 @@ 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 @@ -65,51 +64,41 @@ class Container(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Container": diff --git a/reflex/components/radix/themes/layout/flex.pyi b/reflex/components/radix/themes/layout/flex.pyi index 1de96b33957..a49f082627a 100644 --- a/reflex/components/radix/themes/layout/flex.pyi +++ b/reflex/components/radix/themes/layout/flex.pyi @@ -8,7 +8,6 @@ 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 @@ -128,51 +127,41 @@ class Flex(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Flex": diff --git a/reflex/components/radix/themes/layout/grid.pyi b/reflex/components/radix/themes/layout/grid.pyi index 6ab8e7c607b..c11d1dfcddf 100644 --- a/reflex/components/radix/themes/layout/grid.pyi +++ b/reflex/components/radix/themes/layout/grid.pyi @@ -8,7 +8,6 @@ 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,51 +156,41 @@ class Grid(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Grid": diff --git a/reflex/components/radix/themes/layout/list.py b/reflex/components/radix/themes/layout/list.py index cacba70db9c..fb77b223d72 100644 --- a/reflex/components/radix/themes/layout/list.py +++ b/reflex/components/radix/themes/layout/list.py @@ -9,7 +9,6 @@ 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[ @@ -51,7 +50,7 @@ class BaseList(Component): def create( cls, *children, - items: Optional[ImmutableVar[Iterable]] = None, + items: Optional[Var[Iterable]] = None, **props, ): """Create a list component. @@ -67,7 +66,7 @@ def create( """ list_style_type = props.pop("list_style_type", "none") if not children and items is not None: - if isinstance(items, ImmutableVar): + if isinstance(items, Var): children = [Foreach.create(items, ListItem.create)] else: children = [ListItem.create(item) for item in items] # type: ignore @@ -98,7 +97,7 @@ class UnorderedList(BaseList, Ul): def create( cls, *children, - items: Optional[ImmutableVar[Iterable]] = None, + items: Optional[Var[Iterable]] = None, list_style_type: LiteralListStyleTypeUnordered = "disc", **props, ): @@ -129,7 +128,7 @@ class OrderedList(BaseList, Ol): def create( cls, *children, - items: Optional[ImmutableVar[Iterable]] = None, + items: Optional[Var[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 c670608e79a..bf8da641cc1 100644 --- a/reflex/components/radix/themes/layout/list.pyi +++ b/reflex/components/radix/themes/layout/list.pyi @@ -8,7 +8,6 @@ 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 @@ -36,7 +35,7 @@ class BaseList(Component): def create( # type: ignore cls, *children, - items: Optional[ImmutableVar[Iterable]] = None, + items: Optional[Union[Var[Iterable], Iterable]] = None, list_style_type: Optional[ Union[ Var[ @@ -84,51 +83,41 @@ class BaseList(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "BaseList": @@ -160,7 +149,7 @@ class UnorderedList(BaseList, Ul): def create( # type: ignore cls, *children, - items: Optional[ImmutableVar[Iterable]] = None, + items: Optional[Union[Var[Iterable], Iterable]] = None, list_style_type: Optional[LiteralListStyleTypeUnordered] = "disc", access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, auto_capitalize: Optional[ @@ -191,51 +180,41 @@ class UnorderedList(BaseList, Ul): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "UnorderedList": @@ -281,7 +260,7 @@ class OrderedList(BaseList, Ol): def create( # type: ignore cls, *children, - items: Optional[ImmutableVar[Iterable]] = None, + items: Optional[Union[Var[Iterable], 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, @@ -315,51 +294,41 @@ class OrderedList(BaseList, Ol): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "OrderedList": @@ -437,51 +406,41 @@ class ListItem(Li): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ListItem": @@ -527,7 +486,7 @@ class List(ComponentNamespace): @staticmethod def __call__( *children, - items: Optional[ImmutableVar[Iterable]] = None, + items: Optional[Union[Var[Iterable], Iterable]] = None, list_style_type: Optional[ Union[ Var[ @@ -575,51 +534,41 @@ class List(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "BaseList": diff --git a/reflex/components/radix/themes/layout/section.pyi b/reflex/components/radix/themes/layout/section.pyi index 8556e079b28..b4e1050d817 100644 --- a/reflex/components/radix/themes/layout/section.pyi +++ b/reflex/components/radix/themes/layout/section.pyi @@ -8,7 +8,6 @@ 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 @@ -62,51 +61,41 @@ class Section(elements.Section, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Section": diff --git a/reflex/components/radix/themes/layout/spacer.pyi b/reflex/components/radix/themes/layout/spacer.pyi index dfd469b0510..652c1a0b09e 100644 --- a/reflex/components/radix/themes/layout/spacer.pyi +++ b/reflex/components/radix/themes/layout/spacer.pyi @@ -7,7 +7,6 @@ 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 @@ -125,51 +124,41 @@ class Spacer(Flex): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Spacer": diff --git a/reflex/components/radix/themes/layout/stack.pyi b/reflex/components/radix/themes/layout/stack.pyi index 8f0ad2a1701..4ba630fc236 100644 --- a/reflex/components/radix/themes/layout/stack.pyi +++ b/reflex/components/radix/themes/layout/stack.pyi @@ -7,7 +7,6 @@ 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 @@ -93,51 +92,41 @@ class Stack(Flex): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Stack": @@ -248,51 +237,41 @@ class VStack(Stack): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "VStack": @@ -403,51 +382,41 @@ class HStack(Stack): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "HStack": diff --git a/reflex/components/radix/themes/typography/blockquote.pyi b/reflex/components/radix/themes/typography/blockquote.pyi index f367906bec7..3ab3c829b4c 100644 --- a/reflex/components/radix/themes/typography/blockquote.pyi +++ b/reflex/components/radix/themes/typography/blockquote.pyi @@ -8,7 +8,6 @@ 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 @@ -139,51 +138,41 @@ class Blockquote(elements.Blockquote, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Blockquote": diff --git a/reflex/components/radix/themes/typography/code.pyi b/reflex/components/radix/themes/typography/code.pyi index 25f30d0726d..f30a39f9a54 100644 --- a/reflex/components/radix/themes/typography/code.pyi +++ b/reflex/components/radix/themes/typography/code.pyi @@ -8,7 +8,6 @@ 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 @@ -144,51 +143,41 @@ class Code(elements.Code, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Code": diff --git a/reflex/components/radix/themes/typography/heading.pyi b/reflex/components/radix/themes/typography/heading.pyi index 4dc44c1afdf..d1fe2621894 100644 --- a/reflex/components/radix/themes/typography/heading.pyi +++ b/reflex/components/radix/themes/typography/heading.pyi @@ -8,7 +8,6 @@ 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 @@ -164,51 +163,41 @@ class Heading(elements.H1, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Heading": diff --git a/reflex/components/radix/themes/typography/link.pyi b/reflex/components/radix/themes/typography/link.pyi index 12e69877348..54cebee64da 100644 --- a/reflex/components/radix/themes/typography/link.pyi +++ b/reflex/components/radix/themes/typography/link.pyi @@ -10,7 +10,6 @@ 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 @@ -176,51 +175,41 @@ class Link(RadixThemesComponent, A, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Link": diff --git a/reflex/components/radix/themes/typography/text.pyi b/reflex/components/radix/themes/typography/text.pyi index 572922b5b65..919ed17e035 100644 --- a/reflex/components/radix/themes/typography/text.pyi +++ b/reflex/components/radix/themes/typography/text.pyi @@ -9,7 +9,6 @@ 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 @@ -231,51 +230,41 @@ class Text(elements.Span, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Text": @@ -518,51 +507,41 @@ class Span(Text): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Span": @@ -645,51 +624,41 @@ class Em(elements.Em, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Em": @@ -770,51 +739,41 @@ class Kbd(elements.Kbd, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Kbd": @@ -891,51 +850,41 @@ class Quote(elements.Q, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Quote": @@ -1011,51 +960,41 @@ class Strong(elements.Strong, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Strong": @@ -1294,51 +1233,41 @@ class TextNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Text": diff --git a/reflex/components/react_player/audio.pyi b/reflex/components/react_player/audio.pyi index d9d27be717f..f84122403eb 100644 --- a/reflex/components/react_player/audio.pyi +++ b/reflex/components/react_player/audio.pyi @@ -7,7 +7,6 @@ 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 @@ -33,99 +32,73 @@ class Audio(ReactPlayer): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_buffer_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click_preview: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_disable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_duration: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_enable_pip: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_playback_rate_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_progress: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Audio": diff --git a/reflex/components/react_player/react_player.pyi b/reflex/components/react_player/react_player.pyi index 7991cadd7d1..c9e8ba56920 100644 --- a/reflex/components/react_player/react_player.pyi +++ b/reflex/components/react_player/react_player.pyi @@ -7,7 +7,6 @@ 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 @@ -31,99 +30,73 @@ class ReactPlayer(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_buffer_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click_preview: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_disable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_duration: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_enable_pip: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_playback_rate_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_progress: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ReactPlayer": diff --git a/reflex/components/react_player/video.pyi b/reflex/components/react_player/video.pyi index 2e6fd3aed5c..7f7c1fda198 100644 --- a/reflex/components/react_player/video.pyi +++ b/reflex/components/react_player/video.pyi @@ -7,7 +7,6 @@ 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 @@ -33,99 +32,73 @@ class Video(ReactPlayer): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_buffer_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click_preview: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_disable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_duration: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_enable_pip: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_playback_rate_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_progress: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Video": diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index a909ac6e720..4c76e82ea46 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 ImmutableVar, LiteralVar +from reflex.ivars.base import 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[ImmutableVar, Any]]: + def get_event_triggers(self) -> dict[str, Union[Var, 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 eead7204c21..0ffbd6c534d 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -7,7 +7,6 @@ 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 @@ -94,51 +93,41 @@ class Axis(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Axis": @@ -267,51 +256,41 @@ class XAxis(Axis): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "XAxis": @@ -443,51 +422,41 @@ class YAxis(Axis): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "YAxis": @@ -589,51 +558,41 @@ class ZAxis(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ZAxis": @@ -660,7 +619,7 @@ class ZAxis(Recharts): ... class Brush(Recharts): - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... @overload @classmethod def create( # type: ignore @@ -683,10 +642,8 @@ class Brush(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, **props, ) -> "Brush": """Create the component. @@ -770,51 +727,41 @@ class Cartesian(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Cartesian": @@ -945,51 +892,41 @@ class Area(Cartesian): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Area": @@ -1097,57 +1034,47 @@ class Bar(Cartesian): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_animation_start: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Bar": @@ -1293,51 +1220,41 @@ class Line(Cartesian): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Line": @@ -1453,51 +1370,41 @@ class Scatter(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Scatter": @@ -1588,57 +1495,47 @@ class Funnel(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_animation_start: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Funnel": @@ -1686,51 +1583,41 @@ class ErrorBar(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ErrorBar": @@ -1777,51 +1664,41 @@ class Reference(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Reference": @@ -1873,51 +1750,41 @@ class ReferenceLine(Reference): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ReferenceLine": @@ -1974,51 +1841,41 @@ class ReferenceDot(Reference): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ReferenceDot": @@ -2076,51 +1933,41 @@ class ReferenceArea(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ReferenceArea": @@ -2167,51 +2014,41 @@ class Grid(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Grid": @@ -2263,51 +2100,41 @@ class CartesianGrid(Grid): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CartesianGrid": @@ -2374,51 +2201,41 @@ class CartesianAxis(Grid): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CartesianAxis": diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index ac46336f79b..37b865b1d4f 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 ImmutableVar, LiteralVar +from reflex.ivars.base import 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, ImmutableVar) and issubclass(value._var_type, int): + if isinstance(value, Var) 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[ImmutableVar, Any]]: + def get_event_triggers(self) -> dict[str, Union[Var, 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[ImmutableVar, Any]]: + def get_event_triggers(self) -> dict[str, Union[Var, 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 57ed0c40700..48bde748322 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -7,7 +7,6 @@ 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 @@ -28,51 +27,41 @@ class ChartBase(RechartsCharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ChartBase": @@ -126,51 +115,41 @@ class CategoricalChartBase(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "CategoricalChartBase": @@ -237,51 +216,41 @@ class AreaChart(CategoricalChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "AreaChart": @@ -347,51 +316,41 @@ class BarChart(CategoricalChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "BarChart": @@ -456,51 +415,41 @@ class LineChart(CategoricalChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "LineChart": @@ -571,51 +520,41 @@ class ComposedChart(CategoricalChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ComposedChart": @@ -663,51 +602,41 @@ class PieChart(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PieChart": @@ -732,7 +661,7 @@ class PieChart(ChartBase): ... class RadarChart(ChartBase): - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... @overload @classmethod def create( # type: ignore @@ -753,15 +682,13 @@ class RadarChart(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadarChart": @@ -816,51 +743,41 @@ class RadialBarChart(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadialBarChart": @@ -895,7 +812,7 @@ class RadialBarChart(ChartBase): ... class ScatterChart(ChartBase): - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... @overload @classmethod def create( # type: ignore @@ -909,30 +826,28 @@ class ScatterChart(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ScatterChart": @@ -972,51 +887,41 @@ class FunnelChart(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "FunnelChart": @@ -1067,57 +972,47 @@ class Treemap(RechartsCharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_animation_start: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Treemap": diff --git a/reflex/components/recharts/general.pyi b/reflex/components/recharts/general.pyi index 2c4361ef7ef..be6a0d42f92 100644 --- a/reflex/components/recharts/general.pyi +++ b/reflex/components/recharts/general.pyi @@ -8,7 +8,6 @@ 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 @@ -33,51 +32,41 @@ class ResponsiveContainer(Recharts, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "ResponsiveContainer": @@ -169,51 +158,41 @@ class Legend(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Legend": @@ -280,51 +259,41 @@ class GraphingTooltip(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "GraphingTooltip": @@ -421,51 +390,41 @@ class Label(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Label": @@ -551,51 +510,41 @@ class LabelList(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "LabelList": diff --git a/reflex/components/recharts/polar.py b/reflex/components/recharts/polar.py index 3333a41be94..76347352bef 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 ImmutableVar, LiteralVar +from reflex.ivars.base import 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[ImmutableVar, Any]]: + def get_event_triggers(self) -> dict[str, Union[Var, 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[ImmutableVar, Any]]: + def get_event_triggers(self) -> dict[str, Union[Var, 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[ImmutableVar, Any]]: + def get_event_triggers(self) -> dict[str, Union[Var, 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 1b10758eded..81fb74b2766 100644 --- a/reflex/components/recharts/polar.pyi +++ b/reflex/components/recharts/polar.pyi @@ -7,7 +7,6 @@ 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 @@ -16,7 +15,7 @@ from .recharts import ( ) class Pie(Recharts): - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... @overload @classmethod def create( # type: ignore @@ -74,24 +73,22 @@ class Pie(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Pie": @@ -155,51 +152,41 @@ class Radar(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Radar": @@ -232,7 +219,7 @@ class Radar(Recharts): ... class RadialBar(Recharts): - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... @overload @classmethod def create( # type: ignore @@ -261,30 +248,28 @@ class RadialBar(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RadialBar": @@ -341,51 +326,41 @@ class PolarAngleAxis(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PolarAngleAxis": @@ -439,51 +414,41 @@ class PolarGrid(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PolarGrid": @@ -513,7 +478,7 @@ class PolarGrid(Recharts): ... class PolarRadiusAxis(Recharts): - def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... @overload @classmethod def create( # type: ignore @@ -580,24 +545,22 @@ class PolarRadiusAxis(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "PolarRadiusAxis": diff --git a/reflex/components/recharts/recharts.pyi b/reflex/components/recharts/recharts.pyi index 7ca61891866..695ecab48fe 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,51 +22,41 @@ class Recharts(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Recharts": @@ -98,51 +88,41 @@ class RechartsCharts(NoSSRComponent, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "RechartsCharts": diff --git a/reflex/components/sonner/toast.py b/reflex/components/sonner/toast.py index c58b4a106c2..c7ec5ca60c4 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 ImmutableVar, LiteralVar +from reflex.ivars.base import 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 = ImmutableVar.create_safe("refs['__toast']") +toast_ref = Var.create_safe("refs['__toast']", _var_is_string=False) class ToastAction(Base): @@ -56,7 +56,7 @@ def serialize_action(action: ToastAction) -> dict: } -def _toast_callback_signature(toast: Var) -> list[ImmutableVar]: +def _toast_callback_signature(toast: Var) -> list[Var]: """The signature for the toast callback, stripping out unserializable keys. Args: @@ -66,8 +66,9 @@ def _toast_callback_signature(toast: Var) -> list[ImmutableVar]: A function call stripping non-serializable members of the toast object. """ return [ - ImmutableVar.create_safe( - f"(() => {{let {{action, cancel, onDismiss, onAutoClose, ...rest}} = {str(toast)}; return rest}})()" + Var.create_safe( + f"(() => {{let {{action, cancel, onDismiss, onAutoClose, ...rest}} = {toast}; return rest}})()", + _var_is_string=False, ) ] @@ -76,10 +77,10 @@ class ToastProps(PropsBase): """Props for the toast component.""" # Toast's title, renders above the description. - title: Optional[Union[str, ImmutableVar]] + title: Optional[Union[str, Var]] # Toast's description, renders underneath the title. - description: Optional[Union[str, ImmutableVar]] + description: Optional[Union[str, Var]] # Whether to show the close button. close_button: Optional[bool] @@ -111,7 +112,7 @@ class ToastProps(PropsBase): cancel: Optional[ToastAction] # Custom id for the toast. - id: Optional[Union[str, ImmutableVar]] + id: Optional[Union[str, Var]] # Removes the default styling, which allows for easier customization. unstyled: Optional[bool] @@ -241,14 +242,16 @@ class Toaster(Component): # Marked True when any Toast component is created. is_used: ClassVar[bool] = False - def add_hooks(self) -> list[ImmutableVar | str]: + def add_hooks(self) -> list[Var | str]: """Add hooks for the toaster component. Returns: The hooks for the toaster component. """ - hook = ImmutableVar.create_safe( + hook = Var.create_safe( f"{toast_ref} = toast", + _var_is_local=True, + _var_is_string=False, _var_data=VarData( imports={ "/utils/state": [ImportVar(tag="refs")], @@ -286,7 +289,7 @@ def send_toast(message: str = "", level: str | None = None, **props) -> EventSpe else: toast = f"{toast_command}(`{message}`)" - toast_action = ImmutableVar.create_safe(toast) + toast_action = Var.create_safe(toast, _var_is_string=False, _var_is_local=True) return call_script(toast_action) @staticmethod @@ -353,15 +356,17 @@ def toast_dismiss(id: Var | str | None = None): """ dismiss_var_data = None - if isinstance(id, ImmutableVar): - dismiss = f"{toast_ref}.dismiss({str(id)})" + if isinstance(id, Var): + dismiss = f"{toast_ref}.dismiss({id._var_name_unwrapped})" 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 = ImmutableVar.create_safe( + dismiss_action = Var.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 d18f5a3a9e7..bb7191eb8cb 100644 --- a/reflex/components/sonner/toast.pyi +++ b/reflex/components/sonner/toast.pyi @@ -10,7 +10,6 @@ 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 @@ -23,7 +22,7 @@ LiteralPosition = Literal[ "bottom-center", "bottom-right", ] -toast_ref = ImmutableVar.create_safe("refs['__toast']") +toast_ref = Var.create_safe("refs['__toast']", _var_is_string=False) class ToastAction(Base): label: str @@ -33,8 +32,8 @@ class ToastAction(Base): def serialize_action(action: ToastAction) -> dict: ... class ToastProps(PropsBase): - title: Optional[Union[str, ImmutableVar]] - description: Optional[Union[str, ImmutableVar]] + title: Optional[Union[str, Var]] + description: Optional[Union[str, Var]] close_button: Optional[bool] invert: Optional[bool] important: Optional[bool] @@ -43,7 +42,7 @@ class ToastProps(PropsBase): dismissible: Optional[bool] action: Optional[ToastAction] cancel: Optional[ToastAction] - id: Optional[Union[str, ImmutableVar]] + id: Optional[Union[str, Var]] unstyled: Optional[bool] style: Optional[Style] action_button_styles: Optional[Style] @@ -61,7 +60,7 @@ class ToastProps(PropsBase): class Toaster(Component): is_used: ClassVar[bool] = False - def add_hooks(self) -> list[ImmutableVar | str]: ... + def add_hooks(self) -> list[Var | str]: ... @staticmethod def send_toast( message: str = "", level: str | None = None, **props @@ -121,51 +120,41 @@ class Toaster(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Toaster": diff --git a/reflex/components/suneditor/editor.py b/reflex/components/suneditor/editor.py index d768d79f8e2..6e28b396a79 100644 --- a/reflex/components/suneditor/editor.py +++ b/reflex/components/suneditor/editor.py @@ -8,7 +8,6 @@ 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 @@ -235,7 +234,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, ImmutableVar): + if isinstance(set_options, Var): 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 63a8032b909..b1bc8a8301f 100644 --- a/reflex/components/suneditor/editor.pyi +++ b/reflex/components/suneditor/editor.pyi @@ -9,7 +9,6 @@ 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 @@ -122,78 +121,56 @@ class Editor(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = 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, + 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, on_context_menu: Optional[ - 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, 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] + Union[EventHandler, EventSpec, list, Callable, Var] ] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_paste: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_paste: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_resize_editor: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, toggle_code_view: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, toggle_full_screen: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Editor": diff --git a/reflex/components/tags/iter_tag.py b/reflex/components/tags/iter_tag.py index ee7a636284d..0828f8b10ab 100644 --- a/reflex/components/tags/iter_tag.py +++ b/reflex/components/tags/iter_tag.py @@ -34,16 +34,15 @@ def get_iterable_var_type(self) -> Type: Returns: The type of the iterable var. """ - iterable = self.iterable.upcast() try: - if iterable._var_type.mro()[0] == dict: + if self.iterable._var_type.mro()[0] == dict: # Arg is a tuple of (key, value). - return Tuple[get_args(iterable._var_type)] # type: ignore - elif iterable._var_type.mro()[0] == tuple: + return Tuple[get_args(self.iterable._var_type)] # type: ignore + elif self.iterable._var_type.mro()[0] == tuple: # Arg is a union of any possible values in the tuple. - return Union[get_args(iterable._var_type)] # type: ignore + return Union[get_args(self.iterable._var_type)] # type: ignore else: - return get_args(iterable._var_type)[0] + return get_args(self.iterable._var_type)[0] except Exception: return Any diff --git a/reflex/components/tags/tag.py b/reflex/components/tags/tag.py index 810da30f957..9a8cca11f57 100644 --- a/reflex/components/tags/tag.py +++ b/reflex/components/tags/tag.py @@ -6,8 +6,9 @@ from reflex.base import Base from reflex.event import EventChain -from reflex.ivars.base import ImmutableVar, LiteralVar +from reflex.ivars.base import LiteralVar from reflex.utils import format, types +from reflex.vars import Var class Tag(Base): @@ -26,7 +27,7 @@ class Tag(Base): args: Optional[Tuple[str, ...]] = None # Special props that aren't key value pairs. - special_props: Set[ImmutableVar] = set() + special_props: Set[Var] = set() # The children components. children: List[Any] = [] @@ -92,7 +93,7 @@ def remove_props(self, *args: str) -> Tag: return self @staticmethod - def is_valid_prop(prop: Optional[ImmutableVar]) -> bool: + def is_valid_prop(prop: Optional[Var]) -> bool: """Check if the prop is valid. Args: diff --git a/reflex/event.py b/reflex/event.py index 8384f06a860..b8fed570826 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 Var, VarData +from reflex.vars import ImmutableVarData, Var 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[ImmutableVar, ImmutableVar], ...] = () + args: Tuple[Tuple[Var, Var], ...] = () class Config: """The Pydantic config.""" @@ -237,9 +237,7 @@ class Config: # Required to allow tuple fields. frozen = True - def with_args( - self, args: Tuple[Tuple[ImmutableVar, ImmutableVar], ...] - ) -> EventSpec: + def with_args(self, args: Tuple[Tuple[Var, Var], ...]) -> EventSpec: """Copy the event spec, with updated args. Args: @@ -255,7 +253,7 @@ def with_args( event_actions=self.event_actions.copy(), ) - def add_args(self, *args: ImmutableVar) -> EventSpec: + def add_args(self, *args: Var) -> EventSpec: """Add arguments to the event spec. Args: @@ -399,7 +397,7 @@ def as_event_spec(self, handler: EventHandler) -> EventSpec: ImmutableVar( _var_name="filesById", _var_type=Dict[str, Any], - _var_data=VarData.merge(upload_files_context_var_data), + _var_data=ImmutableVarData.merge(upload_files_context_var_data), ).to(ObjectVar)[LiteralVar.create(upload_id)], ), ( @@ -423,7 +421,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, ImmutableVar): + if isinstance(events, Var): raise ValueError(f"{on_upload_progress} cannot return a var {events}.") on_upload_progress_chain = EventChain( events=events, @@ -678,9 +676,9 @@ def set_clipboard(content: str) -> EventSpec: def download( - url: str | ImmutableVar | None = None, - filename: Optional[str | ImmutableVar] = None, - data: str | bytes | ImmutableVar | None = None, + url: str | Var | None = None, + filename: Optional[str | Var] = None, + data: str | bytes | Var | None = None, ) -> EventSpec: """Download the file at a given path or with the specified data. @@ -716,17 +714,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, ImmutableVar): + elif isinstance(data, Var): # Need to check on the frontend if the Var already looks like a data: URI. - is_data_url = (data.js_type() == "string") & ( + is_data_url = (data._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.to(str), + data, "data:text/plain," + data.to_string(), # type: ignore ) elif isinstance(data, bytes): @@ -881,7 +879,7 @@ def parse_args_spec(arg_spec: ArgsSpec): ) -def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | ImmutableVar: +def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | Var: """Call a function to a list of event specs. The function should return a single EventSpec, a list of EventSpecs, or a @@ -922,7 +920,7 @@ def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | Immutab out = fn(*parsed_args) # If the function returns a Var, assume it's an EventChain and render it directly. - if isinstance(out, ImmutableVar): + if isinstance(out, Var): return out # Convert the output to a list. @@ -949,9 +947,7 @@ def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | Immutab return events -def get_handler_args( - event_spec: EventSpec, -) -> tuple[tuple[ImmutableVar, ImmutableVar], ...]: +def get_handler_args(event_spec: EventSpec) -> tuple[tuple[Var, Var], ...]: """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 db5a216004c..af3056c4d5f 100644 --- a/reflex/experimental/client_state.py +++ b/reflex/experimental/client_state.py @@ -4,17 +4,14 @@ import dataclasses import sys -from typing import Any, Callable, Union +from typing import Any, Callable, Optional, Type, 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 ( - VarData, - get_unique_variable_name, -) +from reflex.vars import ImmutableVarData, Var, VarData, get_unique_variable_name NoValue = object() @@ -38,19 +35,36 @@ 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(ImmutableVar): +class ClientStateVar(Var): """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(default="") - _getter_name: str = dataclasses.field(default="") + _setter_name: str = dataclasses.field() + _getter_name: str = dataclasses.field() # 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. @@ -100,13 +114,13 @@ def create( default_var = ImmutableVar.create_safe( "", _var_is_local=False, _var_is_string=False ) - elif not isinstance(default, ImmutableVar): + elif not isinstance(default, Var): default_var = LiteralVar.create(default) else: default_var = default setter_name = f"set{var_name.capitalize()}" hooks = { - f"const [{var_name}, {setter_name}] = useState({str(default_var)})": None, + f"const [{var_name}, {setter_name}] = useState({default_var._var_name_unwrapped})": None, } imports = { "react": [ImportVar(tag="useState")], @@ -120,10 +134,12 @@ 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( + VarData( # type: ignore hooks=hooks, imports=imports, ), @@ -131,7 +147,7 @@ def create( ) @property - def value(self) -> ImmutableVar: + def value(self) -> Var: """Get a placeholder for the Var. This property can only be rendered on the frontend. @@ -155,7 +171,7 @@ def value(self) -> ImmutableVar: ) ) - def set_value(self, value: Any = NoValue) -> ImmutableVar: + def set_value(self, value: Any = NoValue) -> Var: """Set the value of the client state variable. This property can only be attached to a frontend event trigger. @@ -174,22 +190,22 @@ def set_value(self, value: Any = NoValue) -> ImmutableVar: 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_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)})" + 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})" return ImmutableVar( _var_name=setter, - _var_data=VarData(imports=_refs_import if self._global_ref else {}), + _var_data=ImmutableVarData( + imports=_refs_import if self._global_ref else {} + ), ).to(FunctionVar, EventChain) @property - def set(self) -> ImmutableVar: + def set(self) -> Var: """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 b977e85b775..848ad7fb798 100644 --- a/reflex/experimental/hooks.py +++ b/reflex/experimental/hooks.py @@ -2,16 +2,15 @@ from __future__ import annotations -from reflex.ivars.base import ImmutableVar from reflex.utils.imports import ImportVar -from reflex.vars import VarData +from reflex.vars import Var, 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) -> ImmutableVar: +def const(name, value) -> Var: """Create a constant Var. Args: @@ -22,11 +21,13 @@ def const(name, value) -> ImmutableVar: The constant Var. """ if isinstance(name, list): - return ImmutableVar.create_safe(f"const [{', '.join(name)}] = {value}") - return ImmutableVar.create_safe(f"const {name} = {value}") + 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) -def useCallback(func, deps) -> ImmutableVar: +def useCallback(func, deps) -> Var: """Create a useCallback hook with a function and dependencies. Args: @@ -36,13 +37,14 @@ def useCallback(func, deps) -> ImmutableVar: Returns: The useCallback hook. """ - return ImmutableVar.create_safe( + return Var.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) -> ImmutableVar: +def useContext(context) -> Var: """Create a useContext hook with a context. Args: @@ -51,13 +53,14 @@ def useContext(context) -> ImmutableVar: Returns: The useContext hook. """ - return ImmutableVar.create_safe( + return Var.create_safe( f"useContext({context})", + _var_is_string=False, _var_data=VarData(imports=_compose_react_imports(["useContext"])), ) -def useRef(default) -> ImmutableVar: +def useRef(default) -> Var: """Create a useRef hook with a default value. Args: @@ -66,13 +69,14 @@ def useRef(default) -> ImmutableVar: Returns: The useRef hook. """ - return ImmutableVar.create_safe( + return Var.create_safe( f"useRef({default})", + _var_is_string=False, _var_data=VarData(imports=_compose_react_imports(["useRef"])), ) -def useState(var_name, default=None) -> ImmutableVar: +def useState(var_name, default=None) -> Var: """Create a useState hook with a variable name and setter name. Args: @@ -84,8 +88,9 @@ def useState(var_name, default=None) -> ImmutableVar: """ return const( [var_name, f"set{var_name.capitalize()}"], - ImmutableVar.create_safe( + Var.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 abe871fa424..cf39ccb6c60 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 ImmutableVar.create_safe("open") + else Var.create_safe("open", _var_is_string=False) ) 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[ImmutableVar]: + def add_hooks(self) -> List[Var]: """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 = ( - ImmutableVar.create_safe("open"), - call_script(ImmutableVar.create_safe("setOpen(!open)")), + Var.create_safe("open", _var_is_string=False), + call_script(Var.create_safe("setOpen(!open)", _var_is_string=False)), ) trigger_props["left"] = cond(open, f"calc({sidebar_width} - 32px)", "0") diff --git a/reflex/experimental/layout.pyi b/reflex/experimental/layout.pyi index 58ff2fa8b1a..8799b4961d2 100644 --- a/reflex/experimental/layout.pyi +++ b/reflex/experimental/layout.pyi @@ -11,7 +11,6 @@ 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 @@ -51,51 +50,41 @@ class Sidebar(Box, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Sidebar": @@ -111,7 +100,7 @@ class Sidebar(Box, MemoizationLeaf): ... def add_style(self) -> dict[str, Any] | None: ... - def add_hooks(self) -> List[ImmutableVar]: ... + def add_hooks(self) -> List[Var]: ... class StatefulSidebar(ComponentState): open: bool @@ -146,54 +135,44 @@ class DrawerSidebar(DrawerRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "DrawerSidebar": @@ -227,51 +206,41 @@ class SidebarTrigger(Fragment): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "SidebarTrigger": @@ -322,51 +291,41 @@ class Layout(Box): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Layout": @@ -420,51 +379,41 @@ class LayoutNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, - on_blur: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, + custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_double_click: 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] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + 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, ImmutableVar] + Union[EventHandler, EventSpec, list, Callable, Var] ] = None, **props, ) -> "Layout": diff --git a/reflex/ivars/base.py b/reflex/ivars/base.py index 27c4828afb8..50453544de3 100644 --- a/reflex/ivars/base.py +++ b/reflex/ivars/base.py @@ -10,6 +10,7 @@ import inspect import json import sys +import warnings from types import CodeType, FunctionType from typing import ( TYPE_CHECKING, @@ -31,21 +32,18 @@ overload, ) -from typing_extensions import ParamSpec, TypeGuard, deprecated, get_type_hints, override +from typing_extensions import ParamSpec, 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 ( - VarAttributeError, - VarDependencyError, - VarTypeError, - VarValueError, -) +from reflex.utils.exceptions import VarDependencyError, VarTypeError, VarValueError from reflex.utils.format import format_state_name -from reflex.utils.types import GenericType, get_origin +from reflex.utils.types import get_origin from reflex.vars import ( - REPLACED_NAMES, + ComputedVar, + ImmutableVarData, Var, VarData, _decode_var_immutable, @@ -85,7 +83,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): _var_type: types.GenericType = dataclasses.field(default=Any) # Extra metadata associated with the Var - _var_data: Optional[VarData] = dataclasses.field(default=None) + _var_data: Optional[ImmutableVarData] = dataclasses.field(default=None) def __str__(self) -> str: """String representation of the var. Guaranteed to be a valid Javascript expression. @@ -113,6 +111,15 @@ 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 @@ -122,7 +129,7 @@ def __post_init__(self): self.__init__( _var_name=_var_name, _var_type=self._var_type, - _var_data=VarData.merge(self._var_data, _var_data), + _var_data=ImmutableVarData.merge(self._var_data, _var_data), ) def __hash__(self) -> int: @@ -133,7 +140,7 @@ def __hash__(self) -> int: """ return hash((self._var_name, self._var_type, self._var_data)) - def _get_all_var_data(self) -> VarData | None: + def _get_all_var_data(self) -> ImmutableVarData | None: """Get all VarData associated with the Var. Returns: @@ -141,21 +148,6 @@ def _get_all_var_data(self) -> VarData | 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. @@ -186,7 +178,7 @@ def _replace(self, merge_var_data=None, **kwargs: Any): return dataclasses.replace( self, - _var_data=VarData.merge( + _var_data=ImmutableVarData.merge( kwargs.get("_var_data", self._var_data), merge_var_data ), **kwargs, @@ -199,7 +191,7 @@ def create( _var_is_local: bool | None = None, _var_is_string: bool | None = None, _var_data: VarData | None = None, - ) -> ImmutableVar | None: + ) -> ImmutableVar | Var | None: """Create a var from a value. Args: @@ -232,7 +224,7 @@ def create( return None # If the value is already a var, do nothing. - if isinstance(value, ImmutableVar): + if isinstance(value, Var): return value # Try to pull the imports and hooks from contained values. @@ -254,7 +246,15 @@ def create( return cls( _var_name=name, _var_type=type_, - _var_data=_var_data, + _var_data=( + ImmutableVarData( + state=_var_data.state, + imports=_var_data.imports, + hooks=_var_data.hooks, + ) + if _var_data + else None + ), ) @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, - ) -> ImmutableVar: + ) -> Var | ImmutableVar: """Create a var from a value, asserting that it is not None. Args: @@ -301,20 +301,14 @@ def __format__(self, format_spec: str) -> str: # Encode the _var_data into the formatted output for tracking purposes. return f"{constants.REFLEX_VAR_OPENING_TAG}{hashed_var}{constants.REFLEX_VAR_CLOSING_TAG}{self._var_name}" - @overload - 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, output: Type[BooleanVar]) -> ToBooleanVarOperation: ... + @overload def to( self, @@ -322,6 +316,9 @@ 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 @@ -343,7 +340,7 @@ def to( self, output: Type[OUTPUT] | types.GenericType, var_type: types.GenericType | None = None, - ) -> ImmutableVar: + ) -> Var: """Convert the var to a different type. Args: @@ -385,11 +382,6 @@ 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: @@ -406,6 +398,9 @@ 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) @@ -428,9 +423,6 @@ 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( @@ -461,8 +453,6 @@ 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] @@ -473,15 +463,8 @@ def guess_type(self) -> ImmutableVar: if fixed_type is Union: inner_types = get_args(var_type) - - if all( - inspect.isclass(t) and issubclass(t, (int, float)) for t in inner_types - ): + if int in inner_types and float 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): @@ -555,12 +538,11 @@ 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] - var_data = self._get_all_var_data() - if var_data is None: + if self._var_data is None: return setter - if not include_state or var_data.state == "": + if not include_state or self._var_data.state == "": return setter - return ".".join((var_data.state, setter)) + return ".".join((self._var_data.state, setter)) def get_setter(self) -> Callable[[BaseState, Any], None]: """Get the var's setter function. @@ -592,32 +574,11 @@ def setter(state: BaseState, value: Any): return setter - 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: + def __eq__(self, other: Var | Any) -> BooleanVar: """Check if the current variable is equal to the given variable. Args: - other (ImmutableVar | Any): The variable to compare with. + other (Var | Any): The variable to compare with. Returns: BooleanVar: A BooleanVar object representing the result of the equality check. @@ -626,11 +587,11 @@ def __eq__(self, other: ImmutableVar | Any) -> BooleanVar: return equal_operation(self, other) - def __ne__(self, other: ImmutableVar | Any) -> BooleanVar: + def __ne__(self, other: Var | Any) -> BooleanVar: """Check if the current object is not equal to the given object. Parameters: - other (ImmutableVar | Any): The object to compare with. + other (Var | Any): The object to compare with. Returns: BooleanVar: A BooleanVar object representing the result of the comparison. @@ -639,6 +600,58 @@ def __ne__(self, other: ImmutableVar | 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. @@ -649,7 +662,7 @@ def bool(self) -> BooleanVar: return boolify(self) - def __and__(self, other: ImmutableVar | Any) -> ImmutableVar: + def __and__(self, other: Var | Any) -> ImmutableVar: """Perform a logical AND operation on the current instance and another variable. Args: @@ -660,7 +673,7 @@ def __and__(self, other: ImmutableVar | Any) -> ImmutableVar: """ return and_operation(self, other) - def __rand__(self, other: ImmutableVar | Any) -> ImmutableVar: + def __rand__(self, other: Var | Any) -> ImmutableVar: """Perform a logical AND operation on the current instance and another variable. Args: @@ -671,7 +684,7 @@ def __rand__(self, other: ImmutableVar | Any) -> ImmutableVar: """ return and_operation(other, self) - def __or__(self, other: ImmutableVar | Any) -> ImmutableVar: + def __or__(self, other: Var | Any) -> ImmutableVar: """Perform a logical OR operation on the current instance and another variable. Args: @@ -682,7 +695,7 @@ def __or__(self, other: ImmutableVar | Any) -> ImmutableVar: """ return or_operation(self, other) - def __ror__(self, other: ImmutableVar | Any) -> ImmutableVar: + def __ror__(self, other: Var | Any) -> ImmutableVar: """Perform a logical OR operation on the current instance and another variable. Args: @@ -701,7 +714,7 @@ def __invert__(self) -> BooleanVar: """ return ~self.bool() - def to_string(self): + def to_string(self) -> ImmutableVar: """Convert the var to a string. Returns: @@ -722,7 +735,7 @@ def as_ref(self) -> ImmutableVar: refs = ImmutableVar( _var_name="refs", - _var_data=VarData( + _var_data=ImmutableVarData( imports={ f"/{constants.Dirs.STATE_PATH}": [imports.ImportVar(tag="refs")] } @@ -730,24 +743,12 @@ 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. """ @@ -757,125 +758,10 @@ def js_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.""" @@ -884,7 +770,7 @@ def create( cls, value: Any, _var_data: VarData | None = None, - ) -> ImmutableVar: + ) -> Var: """Create a var from a value. Args: @@ -901,7 +787,7 @@ def create( from .object import LiteralObjectVar from .sequence import LiteralArrayVar, LiteralStringVar - if isinstance(value, ImmutableVar): + if isinstance(value, Var): if _var_data is None: return value return value._replace(merge_var_data=_var_data) @@ -918,11 +804,14 @@ 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 LiteralNoneVar.create(_var_data=_var_data) + return ImmutableVar.create_safe("null", _var_data=_var_data) from reflex.event import EventChain, EventSpec from reflex.utils.format import get_event_handler_parts @@ -968,6 +857,60 @@ 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()}, @@ -975,16 +918,6 @@ 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}." ) @@ -1076,15 +1009,11 @@ 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, ImmutableVar) else arg - ) + func_args[i]: (LiteralVar.create(arg) if not isinstance(arg, Var) else arg) for i, arg in enumerate(args) } kwargs_vars = { - key: LiteralVar.create(value) - if not isinstance(value, ImmutableVar) - else value + key: LiteralVar.create(value) if not isinstance(value, Var) else value for key, value in kwargs.items() } @@ -1133,7 +1062,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, ImmutableVar): + if isinstance(value, Var): return value._var_type return type(value) @@ -1172,11 +1101,11 @@ def __getattr__(self, name: str) -> Any: parent_classes = inspect.getmro(self.__class__) - next_class = parent_classes[parent_classes.index(CachedVarOperation) + 1] - - return next_class.__getattr__(self, name) # type: ignore + return parent_classes[parent_classes.index(CachedVarOperation) + 1].__getattr__( # type: ignore + self, name + ) - def _get_all_var_data(self) -> VarData | None: + def _get_all_var_data(self) -> ImmutableVarData | None: """Get all VarData associated with the Var. Returns: @@ -1185,18 +1114,16 @@ def _get_all_var_data(self) -> VarData | None: return self._cached_get_all_var_data @cached_property_no_lock - def _cached_get_all_var_data(self) -> VarData | None: + def _cached_get_all_var_data(self) -> ImmutableVarData | None: """Get the cached VarData. Returns: The cached VarData. """ - return VarData.merge( + return ImmutableVarData.merge( *map( lambda value: ( - value._get_all_var_data() - if isinstance(value, ImmutableVar) - else None + value._get_all_var_data() if isinstance(value, Var) else None ), map( lambda field: getattr(self, field.name), @@ -1224,7 +1151,7 @@ def __hash__(self) -> int: ) -def and_operation(a: ImmutableVar | Any, b: ImmutableVar | Any) -> ImmutableVar: +def and_operation(a: Var | Any, b: Var | Any) -> ImmutableVar: """Perform a logical AND operation on two variables. Args: @@ -1254,7 +1181,7 @@ def _and_operation(a: ImmutableVar, b: ImmutableVar): ) -def or_operation(a: ImmutableVar | Any, b: ImmutableVar | Any) -> ImmutableVar: +def or_operation(a: Var | Any, b: Var | Any) -> ImmutableVar: """Perform a logical OR operation on two variables. Args: @@ -1296,14 +1223,14 @@ class ImmutableCallableVar(ImmutableVar): API with functions that return a family of Var. """ - fn: Callable[..., ImmutableVar] = dataclasses.field( + fn: Callable[..., Var] = dataclasses.field( default_factory=lambda: lambda: ImmutableVar(_var_name="undefined") ) - original_var: ImmutableVar = dataclasses.field( + original_var: Var = dataclasses.field( default_factory=lambda: ImmutableVar(_var_name="undefined") ) - def __init__(self, fn: Callable[..., ImmutableVar]): + def __init__(self, fn: Callable[..., Var]): """Initialize a CallableVar. Args: @@ -1313,12 +1240,12 @@ def __init__(self, fn: Callable[..., ImmutableVar]): super(ImmutableCallableVar, self).__init__( _var_name=original_var._var_name, _var_type=original_var._var_type, - _var_data=VarData.merge(original_var._get_all_var_data()), + _var_data=ImmutableVarData.merge(original_var._get_all_var_data()), ) object.__setattr__(self, "fn", fn) object.__setattr__(self, "original_var", original_var) - def __call__(self, *args, **kwargs) -> ImmutableVar: + def __call__(self, *args, **kwargs) -> Var: """Call the decorated function. Args: @@ -1347,24 +1274,6 @@ 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, @@ -1400,7 +1309,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, ImmutableVar]]] = None, + deps: Optional[List[Union[str, Var]]] = None, auto_deps: bool = True, interval: Optional[Union[int, datetime.timedelta]] = None, backend: bool | None = None, @@ -1427,11 +1336,10 @@ def __init__( kwargs["_var_name"] = kwargs.pop("_var_name", fget.__name__) kwargs["_var_type"] = kwargs.pop("_var_type", hint) - ImmutableVar.__init__( - self, + super(ImmutableComputedVar, self).__init__( _var_name=kwargs.pop("_var_name"), _var_type=kwargs.pop("_var_type"), - _var_data=kwargs.pop("_var_data", None), + _var_data=ImmutableVarData.merge(kwargs.pop("_var_data", None)), ) if backend is None: @@ -1450,7 +1358,7 @@ def __init__( deps = [] else: for dep in deps: - if isinstance(dep, ImmutableVar): + if isinstance(dep, Var): continue if isinstance(dep, str) and dep != "": continue @@ -1460,7 +1368,7 @@ def __init__( object.__setattr__( self, "_static_deps", - {dep._var_name if isinstance(dep, ImmutableVar) else dep for dep in deps}, + {dep._var_name if isinstance(dep, Var) else dep for dep in deps}, ) object.__setattr__(self, "_auto_deps", auto_deps) @@ -1606,7 +1514,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=VarData.from_state(state_where_defined), + merge_var_data=ImmutableVarData.from_state(state_where_defined), ).guess_type() if not self._cache: @@ -1693,7 +1601,7 @@ def _deps( ref_obj = None if instruction.argval in invalid_names: raise VarValueError( - f"Cached var {str(self)} cannot access arbitrary state via `{instruction.argval}`." + f"Cached var {self._var_full_name} cannot access arbitrary state via `{instruction.argval}`." ) if callable(ref_obj): # recurse into callable attributes @@ -1761,7 +1669,7 @@ def __class__(self) -> Type: Returns: The class of the var. """ - return FakeComputedVarBaseClass + return ComputedVar @property def fget(self) -> Callable[[BaseState], RETURN_TYPE]: @@ -1782,7 +1690,7 @@ def immutable_computed_var( fget: None = None, initial_value: Any | types.Unset = types.Unset(), cache: bool = False, - deps: Optional[List[Union[str, ImmutableVar]]] = None, + deps: Optional[List[Union[str, Var]]] = None, auto_deps: bool = True, interval: Optional[Union[datetime.timedelta, int]] = None, backend: bool | None = None, @@ -1797,7 +1705,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, ImmutableVar]]] = None, + deps: Optional[List[Union[str, Var]]] = None, auto_deps: bool = True, interval: Optional[Union[datetime.timedelta, int]] = None, backend: bool | None = None, @@ -1809,7 +1717,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, ImmutableVar]]] = None, + deps: Optional[List[Union[str, Var]]] = None, auto_deps: bool = True, interval: Optional[Union[datetime.timedelta, int]] = None, backend: bool | None = None, @@ -1886,7 +1794,7 @@ def create( return CustomVarOperationReturn( _var_name=js_expression, _var_type=_var_type or Any, - _var_data=_var_data, + _var_data=ImmutableVarData.merge(_var_data), ) @@ -1914,9 +1822,7 @@ def var_operation_return( class CustomVarOperation(CachedVarOperation, ImmutableVar[T]): """Base class for custom var operations.""" - _args: Tuple[Tuple[str, ImmutableVar], ...] = dataclasses.field( - default_factory=tuple - ) + _args: Tuple[Tuple[str, Var], ...] = dataclasses.field(default_factory=tuple) _return: CustomVarOperationReturn[T] = dataclasses.field( default_factory=lambda: CustomVarOperationReturn.create("") @@ -1932,13 +1838,13 @@ def _cached_var_name(self) -> str: return str(self._return) @cached_property_no_lock - def _cached_get_all_var_data(self) -> VarData | None: + def _cached_get_all_var_data(self) -> ImmutableVarData | None: """Get the cached VarData. Returns: The cached VarData. """ - return VarData.merge( + return ImmutableVarData.merge( *map( lambda arg: arg[1]._get_all_var_data(), self._args, @@ -1950,7 +1856,7 @@ def _cached_get_all_var_data(self) -> VarData | None: @classmethod def create( cls, - args: Tuple[Tuple[str, ImmutableVar], ...], + args: Tuple[Tuple[str, Var], ...], return_var: CustomVarOperationReturn[T], _var_data: VarData | None = None, ) -> CustomVarOperation[T]: @@ -1967,208 +1873,7 @@ def create( return CustomVarOperation( _var_name="", _var_type=return_var._var_type, - _var_data=_var_data, + _var_data=ImmutableVarData.merge(_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 4fec96b7027..1a987b1cfdc 100644 --- a/reflex/ivars/function.py +++ b/reflex/ivars/function.py @@ -4,24 +4,18 @@ import dataclasses import sys -from typing import Any, Callable, ClassVar, Optional, Tuple, Type, Union +from typing import Any, Callable, Optional, Tuple, Type, Union from reflex.utils.types import GenericType -from reflex.vars import VarData - -from .base import ( - CachedVarOperation, - ImmutableVar, - LiteralVar, - ToOperation, - cached_property_no_lock, -) +from reflex.vars import ImmutableVarData, Var, VarData + +from .base import CachedVarOperation, ImmutableVar, LiteralVar, cached_property_no_lock class FunctionVar(ImmutableVar[Callable]): """Base class for immutable function vars.""" - def __call__(self, *args: ImmutableVar | Any) -> ArgsFunctionOperation: + def __call__(self, *args: Var | Any) -> ArgsFunctionOperation: """Call the function with the given arguments. Args: @@ -35,7 +29,7 @@ def __call__(self, *args: ImmutableVar | Any) -> ArgsFunctionOperation: VarOperationCall.create(self, *args, ImmutableVar.create_safe("...args")), ) - def call(self, *args: ImmutableVar | Any) -> VarOperationCall: + def call(self, *args: Var | Any) -> VarOperationCall: """Call the function with the given arguments. Args: @@ -69,7 +63,7 @@ def create( return cls( _var_name=func, _var_type=_var_type, - _var_data=_var_data, + _var_data=ImmutableVarData.merge(_var_data), ) @@ -82,9 +76,7 @@ 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[ImmutableVar, Any], ...] = dataclasses.field( - default_factory=tuple - ) + _args: Tuple[Union[Var, Any], ...] = dataclasses.field(default_factory=tuple) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -96,13 +88,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) -> VarData | None: + def _cached_get_all_var_data(self) -> ImmutableVarData | None: """Get all the var data associated with the var. Returns: All the var data associated with the var. """ - return VarData.merge( + return ImmutableVarData.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, @@ -112,7 +104,7 @@ def _cached_get_all_var_data(self) -> VarData | None: def create( cls, func: FunctionVar, - *args: ImmutableVar | Any, + *args: Var | Any, _var_type: GenericType = Any, _var_data: VarData | None = None, ) -> VarOperationCall: @@ -129,7 +121,7 @@ def create( return cls( _var_name="", _var_type=_var_type, - _var_data=_var_data, + _var_data=ImmutableVarData.merge(_var_data), _func=func, _args=args, ) @@ -144,7 +136,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[ImmutableVar, Any] = dataclasses.field(default=None) + _return_expr: Union[Var, Any] = dataclasses.field(default=None) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -159,7 +151,7 @@ def _cached_var_name(self) -> str: def create( cls, args_names: Tuple[str, ...], - return_expr: ImmutableVar | Any, + return_expr: Var | Any, _var_type: GenericType = Callable, _var_data: VarData | None = None, ) -> ArgsFunctionOperation: @@ -176,7 +168,7 @@ def create( return cls( _var_name="", _var_type=_var_type, - _var_data=_var_data, + _var_data=ImmutableVarData.merge(_var_data), _args_names=args_names, _return_expr=return_expr, ) @@ -187,14 +179,45 @@ def create( frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToFunctionOperation(ToOperation, FunctionVar): +class ToFunctionOperation(CachedVarOperation, FunctionVar): """Base class of converting a var to a function.""" - _original: ImmutableVar = dataclasses.field( + _original_var: Var = dataclasses.field( default_factory=lambda: LiteralVar.create(None) ) - _default_var_type: ClassVar[GenericType] = Callable + @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, + ) JSON_STRINGIFY = FunctionStringVar.create("JSON.stringify") diff --git a/reflex/ivars/number.py b/reflex/ivars/number.py index 764aa9e2496..68c856d1803 100644 --- a/reflex/ivars/number.py +++ b/reflex/ivars/number.py @@ -5,65 +5,28 @@ import dataclasses import json import sys -from typing import ( - TYPE_CHECKING, - Any, - Callable, - ClassVar, - NoReturn, - Type, - TypeVar, - Union, - overload, -) +from typing import Any, Callable, TypeVar, Union -from reflex.utils.exceptions import VarTypeError -from reflex.vars import Var, VarData +from reflex.vars import ImmutableVarData, Var, VarData from .base import ( + CachedVarOperation, CustomVarOperationReturn, ImmutableVar, - LiteralNoneVar, LiteralVar, - ToOperation, + cached_property_no_lock, unionize, var_operation, var_operation_return, ) -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))}" - ) +NUMBER_T = TypeVar("NUMBER_T", int, float, Union[int, float]) class NumberVar(ImmutableVar[NUMBER_T]): """Base class for immutable number vars.""" - @overload - def __add__(self, other: number_types) -> NumberVar: ... - - @overload - def __add__(self, other: NoReturn) -> NoReturn: ... - - def __add__(self, other: Any): + def __add__(self, other: number_types | boolean_types): """Add two numbers. Args: @@ -72,17 +35,9 @@ def __add__(self, other: Any): 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) - @overload - def __radd__(self, other: number_types) -> NumberVar: ... - - @overload - def __radd__(self, other: NoReturn) -> NoReturn: ... - - def __radd__(self, other: Any): + def __radd__(self, other: number_types | boolean_types): """Add two numbers. Args: @@ -91,17 +46,9 @@ def __radd__(self, other: Any): 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) - @overload - def __sub__(self, other: number_types) -> NumberVar: ... - - @overload - def __sub__(self, other: NoReturn) -> NoReturn: ... - - def __sub__(self, other: Any): + def __sub__(self, other: number_types | boolean_types): """Subtract two numbers. Args: @@ -110,18 +57,9 @@ def __sub__(self, other: Any): 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) - @overload - def __rsub__(self, other: number_types) -> NumberVar: ... - - @overload - def __rsub__(self, other: NoReturn) -> NoReturn: ... - - def __rsub__(self, other: Any): + def __rsub__(self, other: number_types | boolean_types): """Subtract two numbers. Args: @@ -130,9 +68,6 @@ def __rsub__(self, other: Any): 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): @@ -143,13 +78,7 @@ def __abs__(self): """ return number_abs_operation(self) - @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): + def __mul__(self, other: number_types | boolean_types): """Multiply two numbers. Args: @@ -158,25 +87,9 @@ def __mul__(self, other: Any): 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) - @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): + def __rmul__(self, other: number_types | boolean_types): """Multiply two numbers. Args: @@ -185,25 +98,9 @@ def __rmul__(self, other: Any): 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) - @overload - def __truediv__(self, other: number_types) -> NumberVar: ... - - @overload - def __truediv__(self, other: NoReturn) -> NoReturn: ... - - def __truediv__(self, other: Any): + def __truediv__(self, other: number_types | boolean_types): """Divide two numbers. Args: @@ -212,18 +109,9 @@ def __truediv__(self, other: Any): 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) - @overload - def __rtruediv__(self, other: number_types) -> NumberVar: ... - - @overload - def __rtruediv__(self, other: NoReturn) -> NoReturn: ... - - def __rtruediv__(self, other: Any): + def __rtruediv__(self, other: number_types | boolean_types): """Divide two numbers. Args: @@ -232,18 +120,9 @@ def __rtruediv__(self, other: Any): 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) - @overload - def __floordiv__(self, other: number_types) -> NumberVar: ... - - @overload - def __floordiv__(self, other: NoReturn) -> NoReturn: ... - - def __floordiv__(self, other: Any): + def __floordiv__(self, other: number_types | boolean_types): """Floor divide two numbers. Args: @@ -252,18 +131,9 @@ def __floordiv__(self, other: Any): 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) - @overload - def __rfloordiv__(self, other: number_types) -> NumberVar: ... - - @overload - def __rfloordiv__(self, other: NoReturn) -> NoReturn: ... - - def __rfloordiv__(self, other: Any): + def __rfloordiv__(self, other: number_types | boolean_types): """Floor divide two numbers. Args: @@ -272,18 +142,9 @@ def __rfloordiv__(self, other: Any): 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) - @overload - def __mod__(self, other: number_types) -> NumberVar: ... - - @overload - def __mod__(self, other: NoReturn) -> NoReturn: ... - - def __mod__(self, other: Any): + def __mod__(self, other: number_types | boolean_types): """Modulo two numbers. Args: @@ -292,18 +153,9 @@ def __mod__(self, other: Any): 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) - @overload - def __rmod__(self, other: number_types) -> NumberVar: ... - - @overload - def __rmod__(self, other: NoReturn) -> NoReturn: ... - - def __rmod__(self, other: Any): + def __rmod__(self, other: number_types | boolean_types): """Modulo two numbers. Args: @@ -312,18 +164,9 @@ def __rmod__(self, other: Any): 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) - @overload - def __pow__(self, other: number_types) -> NumberVar: ... - - @overload - def __pow__(self, other: NoReturn) -> NoReturn: ... - - def __pow__(self, other: Any): + def __pow__(self, other: number_types | boolean_types): """Exponentiate two numbers. Args: @@ -332,18 +175,9 @@ def __pow__(self, other: Any): 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) - @overload - def __rpow__(self, other: number_types) -> NumberVar: ... - - @overload - def __rpow__(self, other: NoReturn) -> NoReturn: ... - - def __rpow__(self, other: Any): + def __rpow__(self, other: number_types | boolean_types): """Exponentiate two numbers. Args: @@ -352,9 +186,6 @@ def __rpow__(self, other: Any): 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): @@ -413,12 +244,6 @@ 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. @@ -428,15 +253,9 @@ def __lt__(self, other: Any): Returns: The result of the comparison. """ - 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: ... + if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): + return less_than_operation(self, +other) + return less_than_operation(self, other) def __le__(self, other: Any): """Less than or equal comparison. @@ -447,9 +266,9 @@ def __le__(self, other: Any): Returns: The result of the comparison. """ - if not isinstance(other, NUMBER_TYPES): - raise_unsupported_operand_types("<=", (type(self), type(other))) - return less_than_or_equal_operation(self, +other) + if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): + return less_than_or_equal_operation(self, +other) + return less_than_or_equal_operation(self, other) def __eq__(self, other: Any): """Equal comparison. @@ -460,7 +279,7 @@ def __eq__(self, other: Any): Returns: The result of the comparison. """ - if isinstance(other, NUMBER_TYPES): + if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): return equal_operation(self, +other) return equal_operation(self, other) @@ -473,16 +292,10 @@ def __ne__(self, other: Any): Returns: The result of the comparison. """ - if isinstance(other, NUMBER_TYPES): + if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): 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. @@ -492,15 +305,9 @@ def __gt__(self, other: Any): Returns: The result of the comparison. """ - 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: ... + if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): + return greater_than_operation(self, +other) + return greater_than_operation(self, other) def __ge__(self, other: Any): """Greater than or equal comparison. @@ -511,9 +318,9 @@ def __ge__(self, other: Any): Returns: The result of the comparison. """ - if not isinstance(other, NUMBER_TYPES): - raise_unsupported_operand_types(">=", (type(self), type(other))) - return greater_than_or_equal_operation(self, +other) + if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): + return greater_than_or_equal_operation(self, +other) + return greater_than_or_equal_operation(self, other) def bool(self): """Boolean conversion. @@ -523,22 +330,6 @@ 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], @@ -754,7 +545,7 @@ def number_trunc_operation(value: NumberVar): return var_operation_return(js_expression=f"Math.trunc({value})", var_type=int) -class BooleanVar(NumberVar[bool]): +class BooleanVar(ImmutableVar[bool]): """Base class for immutable boolean vars.""" def __invert__(self): @@ -789,7 +580,7 @@ def bool(self) -> BooleanVar: """ return self - def __lt__(self, other: Any): + def __lt__(self, other: boolean_types | number_types): """Less than comparison. Args: @@ -798,9 +589,9 @@ def __lt__(self, other: Any): Returns: The result of the comparison. """ - return +self < other + return less_than_operation(+self, +other) - def __le__(self, other: Any): + def __le__(self, other: boolean_types | number_types): """Less than or equal comparison. Args: @@ -809,9 +600,31 @@ def __le__(self, other: Any): Returns: The result of the comparison. """ - return +self <= other + return less_than_or_equal_operation(+self, +other) - def __gt__(self, other: Any): + 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) + + 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): """Greater than comparison. Args: @@ -820,9 +633,9 @@ def __gt__(self, other: Any): Returns: The result of the comparison. """ - return +self > other + return greater_than_operation(+self, +other) - def __ge__(self, other: Any): + def __ge__(self, other: boolean_types | number_types): """Greater than or equal comparison. Args: @@ -831,7 +644,7 @@ def __ge__(self, other: Any): Returns: The result of the comparison. """ - return +self >= other + return greater_than_or_equal_operation(+self, +other) @var_operation @@ -848,8 +661,8 @@ def boolean_to_number_operation(value: BooleanVar): def comparison_operator( - func: Callable[[ImmutableVar, ImmutableVar], str], -) -> Callable[[ImmutableVar | Any, ImmutableVar | Any], BooleanVar]: + func: Callable[[Var, Var], str], +) -> Callable[[Var | Any, Var | Any], BooleanVar]: """Decorator to create a comparison operation. Args: @@ -860,13 +673,13 @@ def comparison_operator( """ @var_operation - def operation(lhs: ImmutableVar, rhs: ImmutableVar): + def operation(lhs: Var, rhs: Var): return var_operation_return( js_expression=func(lhs, rhs), var_type=bool, ) - def wrapper(lhs: ImmutableVar | Any, rhs: ImmutableVar | Any) -> BooleanVar: + def wrapper(lhs: Var | Any, rhs: Var | Any) -> BooleanVar: """Create the comparison operation. Args: @@ -882,7 +695,7 @@ def wrapper(lhs: ImmutableVar | Any, rhs: ImmutableVar | Any) -> BooleanVar: @comparison_operator -def greater_than_operation(lhs: ImmutableVar, rhs: ImmutableVar): +def greater_than_operation(lhs: Var, rhs: Var): """Greater than comparison. Args: @@ -896,7 +709,7 @@ def greater_than_operation(lhs: ImmutableVar, rhs: ImmutableVar): @comparison_operator -def greater_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): +def greater_than_or_equal_operation(lhs: Var, rhs: Var): """Greater than or equal comparison. Args: @@ -910,7 +723,7 @@ def greater_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): @comparison_operator -def less_than_operation(lhs: ImmutableVar, rhs: ImmutableVar): +def less_than_operation(lhs: Var, rhs: Var): """Less than comparison. Args: @@ -924,7 +737,7 @@ def less_than_operation(lhs: ImmutableVar, rhs: ImmutableVar): @comparison_operator -def less_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): +def less_than_or_equal_operation(lhs: Var, rhs: Var): """Less than or equal comparison. Args: @@ -938,7 +751,7 @@ def less_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): @comparison_operator -def equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): +def equal_operation(lhs: Var, rhs: Var): """Equal comparison. Args: @@ -952,7 +765,7 @@ def equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): @comparison_operator -def not_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): +def not_equal_operation(lhs: Var, rhs: Var): """Not equal comparison. Args: @@ -1018,7 +831,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=_var_data, + _var_data=ImmutableVarData.merge(_var_data), _var_value=value, ) @@ -1063,7 +876,7 @@ def create(cls, value: float | int, _var_data: VarData | None = None): return cls( _var_name=str(value), _var_type=type(value), - _var_data=_var_data, + _var_data=ImmutableVarData.merge(_var_data), _var_value=value, ) @@ -1077,12 +890,45 @@ def create(cls, value: float | int, _var_data: VarData | None = None): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToNumberVarOperation(ToOperation, NumberVar): +class ToNumberVarOperation(CachedVarOperation, NumberVar): """Base class for immutable number vars that are the result of a number operation.""" - _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) + _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. - _default_var_type: ClassVar[Type] = float + Returns: + The number var. + """ + return cls( + _var_name="", + _var_type=_var_type, + _var_data=ImmutableVarData.merge(_var_data), + _original_value=value, + ) @dataclasses.dataclass( @@ -1090,12 +936,43 @@ class ToNumberVarOperation(ToOperation, NumberVar): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToBooleanVarOperation(ToOperation, BooleanVar): +class ToBooleanVarOperation(CachedVarOperation, BooleanVar): """Base class for immutable boolean vars that are the result of a boolean operation.""" - _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) + _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. - _default_var_type: ClassVar[Type] = bool + Returns: + The boolean var. + """ + return cls( + _var_name="", + _var_type=bool, + _var_data=ImmutableVarData.merge(_var_data), + _original_value=value, + ) @var_operation @@ -1115,9 +992,7 @@ def boolify(value: Var): @var_operation -def ternary_operation( - condition: BooleanVar, if_true: ImmutableVar, if_false: ImmutableVar -): +def ternary_operation(condition: BooleanVar, if_true: Var, if_false: Var): """Create a ternary operation. Args: @@ -1132,6 +1007,3 @@ def ternary_operation( 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 687083fcb9b..49a21226fde 100644 --- a/reflex/ivars/object.py +++ b/reflex/ivars/object.py @@ -8,7 +8,6 @@ from inspect import isclass from typing import ( Any, - ClassVar, Dict, List, NoReturn, @@ -23,19 +22,18 @@ 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 VarData +from reflex.vars import ImmutableVarData, Var, 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, raise_unsupported_operand_types +from .number import BooleanVar, NumberVar from .sequence import ArrayVar, StringVar OBJECT_TYPE = TypeVar("OBJECT_TYPE", bound=Dict) @@ -134,7 +132,7 @@ def merge(self, other: ObjectVar): @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, NoReturn]], - key: ImmutableVar | Any, + key: Var | Any, ) -> ImmutableVar: ... @overload @@ -144,40 +142,40 @@ def __getitem__( | ObjectVar[Dict[KEY_TYPE, float]] | ObjectVar[Dict[KEY_TYPE, int | float]] ), - key: ImmutableVar | Any, + key: Var | Any, ) -> NumberVar: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, str]], - key: ImmutableVar | Any, + key: Var | Any, ) -> StringVar: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, list[ARRAY_INNER_TYPE]]], - key: ImmutableVar | Any, + key: Var | Any, ) -> ArrayVar[list[ARRAY_INNER_TYPE]]: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, set[ARRAY_INNER_TYPE]]], - key: ImmutableVar | Any, + key: Var | Any, ) -> ArrayVar[set[ARRAY_INNER_TYPE]]: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, tuple[ARRAY_INNER_TYPE, ...]]], - key: ImmutableVar | Any, + key: Var | Any, ) -> ArrayVar[tuple[ARRAY_INNER_TYPE, ...]]: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, dict[OTHER_KEY_TYPE, VALUE_TYPE]]], - key: ImmutableVar | Any, + key: Var | Any, ) -> ObjectVar[dict[OTHER_KEY_TYPE, VALUE_TYPE]]: ... - def __getitem__(self, key: ImmutableVar | Any) -> ImmutableVar: + def __getitem__(self, key: Var | Any) -> ImmutableVar: """Get an item from the object. Args: @@ -186,10 +184,6 @@ def __getitem__(self, key: ImmutableVar | 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 @@ -271,7 +265,7 @@ def __getattr__(self, name) -> ImmutableVar: else: return ObjectItemOperation.create(self, name).guess_type() - def contains(self, key: ImmutableVar | Any) -> BooleanVar: + def contains(self, key: Var | Any) -> BooleanVar: """Check if the object contains a key. Args: @@ -291,8 +285,8 @@ def contains(self, key: ImmutableVar | Any) -> BooleanVar: class LiteralObjectVar(CachedVarOperation, ObjectVar[OBJECT_TYPE], LiteralVar): """Base class for immutable literal object vars.""" - _var_value: Dict[Union[ImmutableVar, Any], Union[ImmutableVar, Any]] = ( - dataclasses.field(default_factory=dict) + _var_value: Dict[Union[Var, Any], Union[Var, Any]] = dataclasses.field( + default_factory=dict ) def _key_type(self) -> Type: @@ -357,13 +351,13 @@ def __hash__(self) -> int: return hash((self.__class__.__name__, self._var_name)) @cached_property_no_lock - def _cached_get_all_var_data(self) -> VarData | None: + def _cached_get_all_var_data(self) -> ImmutableVarData | None: """Get all the var data. Returns: The var data. """ - return VarData.merge( + return ImmutableVarData.merge( *[LiteralVar.create(var)._get_all_var_data() for var in self._var_value], *[ LiteralVar.create(var)._get_all_var_data() @@ -392,7 +386,7 @@ def create( return LiteralObjectVar( _var_name="", _var_type=(figure_out_type(_var_value) if _var_type is None else _var_type), - _var_data=_var_data, + _var_data=ImmutableVarData.merge(_var_data), _var_value=_var_value, ) @@ -476,9 +470,7 @@ class ObjectItemOperation(CachedVarOperation, ImmutableVar): _object: ObjectVar = dataclasses.field( default_factory=lambda: LiteralObjectVar.create({}) ) - _key: ImmutableVar | Any = dataclasses.field( - default_factory=lambda: LiteralVar.create(None) - ) + _key: Var | Any = dataclasses.field(default_factory=lambda: LiteralVar.create(None)) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -495,7 +487,7 @@ def _cached_var_name(self) -> str: def create( cls, object: ObjectVar, - key: ImmutableVar | Any, + key: Var | Any, _var_type: GenericType | None = None, _var_data: VarData | None = None, ) -> ObjectItemOperation: @@ -513,9 +505,9 @@ def create( return cls( _var_name="", _var_type=object._value_type() if _var_type is None else _var_type, - _var_data=_var_data, + _var_data=ImmutableVarData.merge(_var_data), _object=object, - _key=key if isinstance(key, ImmutableVar) else LiteralVar.create(key), + _key=key if isinstance(key, Var) else LiteralVar.create(key), ) @@ -524,31 +516,49 @@ def create( frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToObjectOperation(ToOperation, ObjectVar): +class ToObjectOperation(CachedVarOperation, ObjectVar): """Operation to convert a var to an object.""" - _original: ImmutableVar = dataclasses.field( + _original_var: Var = dataclasses.field( default_factory=lambda: LiteralObjectVar.create({}) ) - _default_var_type: ClassVar[GenericType] = dict + @cached_property_no_lock + def _cached_var_name(self) -> str: + """The name of the operation. - def __getattr__(self, name: str) -> Any: - """Get an attribute of the var. + 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. Args: - name: The name of the attribute. + original_var: The original var to convert. + _var_type: The type of the var. + _var_data: Additional hooks and imports associated with the operation. Returns: - The attribute of the var. + The to object operation. """ - if name == "_var_name": - return self._original._var_name - return ObjectVar.__getattr__(self, name) + 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, + ) @var_operation -def object_has_own_property_operation(object: ObjectVar, key: ImmutableVar): +def object_has_own_property_operation(object: ObjectVar, key: Var): """Check if an object has a key. Args: diff --git a/reflex/ivars/sequence.py b/reflex/ivars/sequence.py index 3b6da46c2d2..8081cf4424a 100644 --- a/reflex/ivars/sequence.py +++ b/reflex/ivars/sequence.py @@ -11,11 +11,9 @@ from typing import ( TYPE_CHECKING, Any, - ClassVar, Dict, List, Literal, - NoReturn, Set, Tuple, Type, @@ -26,22 +24,19 @@ 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, @@ -52,7 +47,6 @@ BooleanVar, LiteralNumberVar, NumberVar, - raise_unsupported_operand_types, ) if TYPE_CHECKING: @@ -62,13 +56,7 @@ class StringVar(ImmutableVar[str]): """Base class for immutable string vars.""" - @overload - def __add__(self, other: StringVar | str) -> ConcatVarOperation: ... - - @overload - def __add__(self, other: NoReturn) -> NoReturn: ... - - def __add__(self, other: Any) -> ConcatVarOperation: + def __add__(self, other: StringVar | str) -> ConcatVarOperation: """Concatenate two strings. Args: @@ -77,18 +65,9 @@ def __add__(self, other: Any) -> 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) - @overload - def __radd__(self, other: StringVar | str) -> ConcatVarOperation: ... - - @overload - def __radd__(self, other: NoReturn) -> NoReturn: ... - - def __radd__(self, other: Any) -> ConcatVarOperation: + def __radd__(self, other: StringVar | str) -> ConcatVarOperation: """Concatenate two strings. Args: @@ -97,58 +76,31 @@ def __radd__(self, other: Any) -> 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) - @overload - def __mul__(self, other: NumberVar | int) -> StringVar: ... - - @overload - def __mul__(self, other: NoReturn) -> NoReturn: ... - - def __mul__(self, other: Any) -> StringVar: + def __mul__(self, other: NumberVar | int) -> StringVar: """Multiply the sequence by a number or an integer. Args: - other: The number or integer to multiply the sequence by. + other (NumberVar | int): 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() - @overload - def __rmul__(self, other: NumberVar | int) -> StringVar: ... - - @overload - def __rmul__(self, other: NoReturn) -> NoReturn: ... - - def __rmul__(self, other: Any) -> StringVar: + def __rmul__(self, other: NumberVar | int) -> StringVar: """Multiply the sequence by a number or an integer. Args: - other: The number or integer to multiply the sequence by. + other (NumberVar | int): 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() - @overload - def __getitem__(self, i: slice) -> StringVar: ... - - @overload - def __getitem__(self, i: int | NumberVar) -> StringVar: ... - - def __getitem__(self, i: Any) -> StringVar: + def __getitem__(self, i: slice | int | NumberVar) -> StringVar: """Get a slice of the string. Args: @@ -159,10 +111,6 @@ def __getitem__(self, i: Any) -> 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: @@ -213,41 +161,18 @@ def reversed(self) -> StringVar: """ return self.split().reverse().join() - @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: + def contains(self, other: StringVar | str) -> 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) - @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]]: + def split(self, separator: StringVar | str = "") -> ArrayVar[List[str]]: """Split the string. Args: @@ -256,17 +181,9 @@ def split(self, separator: Any = "") -> 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) - @overload - def startswith(self, prefix: StringVar | str) -> BooleanVar: ... - - @overload - def startswith(self, prefix: NoReturn) -> NoReturn: ... - - def startswith(self, prefix: Any) -> BooleanVar: + def startswith(self, prefix: StringVar | str) -> BooleanVar: """Check if the string starts with a prefix. Args: @@ -275,146 +192,8 @@ def startswith(self, prefix: Any) -> 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): @@ -455,26 +234,6 @@ 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. @@ -557,7 +316,7 @@ def create( cls, value: str, _var_data: VarData | None = None, - ) -> StringVar: + ) -> LiteralStringVar | ConcatVarOperation: """Create a var from a string value. Args: @@ -568,9 +327,20 @@ def create( The var. """ if REFLEX_VAR_OPENING_TAG in value: - strings_and_vals: list[ImmutableVar | str] = [] + strings_and_vals: list[Var | 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() @@ -586,17 +356,41 @@ def create( 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, ImmutableVar) or s + s for s in strings_and_vals if isinstance(s, Var) or s ] if len(filtered_strings_and_vals) == 1: - return LiteralVar.create(filtered_strings_and_vals[0]).to(StringVar) + return filtered_strings_and_vals[0].to(StringVar) # type: ignore return ConcatVarOperation.create( *filtered_strings_and_vals, @@ -606,7 +400,7 @@ def create( return LiteralStringVar( _var_name=json.dumps(value), _var_type=str, - _var_data=_var_data, + _var_data=ImmutableVarData.merge(_var_data), _var_value=value, ) @@ -635,7 +429,7 @@ def json(self) -> str: class ConcatVarOperation(CachedVarOperation, StringVar): """Representing a concatenation of literal string vars.""" - _var_value: Tuple[ImmutableVar, ...] = dataclasses.field(default_factory=tuple) + _var_value: Tuple[Var, ...] = dataclasses.field(default_factory=tuple) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -644,7 +438,7 @@ def _cached_var_name(self) -> str: Returns: The name of the var. """ - list_of_strs: List[Union[str, ImmutableVar]] = [] + list_of_strs: List[Union[str, Var]] = [] last_string = "" for var in self._var_value: if isinstance(var, LiteralStringVar): @@ -659,9 +453,7 @@ 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, ImmutableVar) or s + str(LiteralVar.create(s)) for s in list_of_strs if isinstance(s, Var) or s ] if len(list_of_strs_filtered) == 1: @@ -670,17 +462,17 @@ def _cached_var_name(self) -> str: return "(" + "+".join(list_of_strs_filtered) + ")" @cached_property_no_lock - def _cached_get_all_var_data(self) -> VarData | None: - """Get all the VarData asVarDatae Var. + def _cached_get_all_var_data(self) -> ImmutableVarData | None: + """Get all the VarData associated with the Var. Returns: The VarData associated with the Var. """ - return VarData.merge( + return ImmutableVarData.merge( *[ var._get_all_var_data() for var in self._var_value - if isinstance(var, ImmutableVar) + if isinstance(var, Var) ], self._var_data, ) @@ -703,7 +495,7 @@ def create( return cls( _var_name="", _var_type=str, - _var_data=_var_data, + _var_data=ImmutableVarData.merge(_var_data), _var_value=tuple(map(LiteralVar.create, value)), ) @@ -721,13 +513,7 @@ def create( class ArrayVar(ImmutableVar[ARRAY_VAR_TYPE]): """Base class for immutable array vars.""" - @overload - def join(self, sep: StringVar | str = "") -> StringVar: ... - - @overload - def join(self, sep: NoReturn) -> NoReturn: ... - - def join(self, sep: Any = "") -> StringVar: + def join(self, sep: StringVar | str = "") -> StringVar: """Join the elements of the array. Args: @@ -736,8 +522,6 @@ def join(self, sep: Any = "") -> 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]: @@ -748,24 +532,15 @@ def reverse(self) -> ArrayVar[ARRAY_VAR_TYPE]: """ return array_reverse_operation(self) - @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]: + def __add__(self, other: ArrayVar[ARRAY_VAR_TYPE]) -> ArrayVar[ARRAY_VAR_TYPE]: """Concatenate two arrays. Parameters: - other: The other array to concatenate. + other (ArrayVar[ARRAY_VAR_TYPE]): 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 @@ -858,7 +633,9 @@ def __getitem__( @overload def __getitem__(self, i: int | NumberVar) -> ImmutableVar: ... - def __getitem__(self, i: Any) -> ArrayVar[ARRAY_VAR_TYPE] | ImmutableVar: + def __getitem__( + self, i: slice | int | NumberVar + ) -> ArrayVar[ARRAY_VAR_TYPE] | ImmutableVar: """Get a slice of the array. Args: @@ -869,10 +646,6 @@ def __getitem__(self, i: Any) -> ArrayVar[ARRAY_VAR_TYPE] | ImmutableVar: """ 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: @@ -914,14 +687,6 @@ 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 @@ -931,26 +696,15 @@ def range( return array_range_operation(start, end, step or 1) - @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: + def contains(self, other: Any) -> 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: @@ -964,154 +718,19 @@ def pluck(self, field: StringVar | str) -> ArrayVar: """ return array_pluck_operation(self, field) - @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]: + def __mul__(self, other: NumberVar | int) -> ArrayVar[ARRAY_VAR_TYPE]: """Multiply the sequence by a number or integer. Parameters: - other: The number or integer to multiply the sequence by. + other (NumberVar | int): 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") @@ -1131,9 +750,7 @@ class LiteralArrayVar(CachedVarOperation, LiteralVar, ArrayVar[ARRAY_VAR_TYPE]): """Base class for immutable literal array vars.""" _var_value: Union[ - List[Union[ImmutableVar, Any]], - Set[Union[ImmutableVar, Any]], - Tuple[Union[ImmutableVar, Any], ...], + List[Union[Var, Any]], Set[Union[Var, Any]], Tuple[Union[Var, Any], ...] ] = dataclasses.field(default_factory=list) @cached_property_no_lock @@ -1152,13 +769,13 @@ def _cached_var_name(self) -> str: ) @cached_property_no_lock - def _cached_get_all_var_data(self) -> VarData | None: + def _cached_get_all_var_data(self) -> ImmutableVarData | None: """Get all the VarData associated with the Var. Returns: The VarData associated with the Var. """ - return VarData.merge( + return ImmutableVarData.merge( *[ LiteralVar.create(element)._get_all_var_data() for element in self._var_value @@ -1207,7 +824,7 @@ def create( return cls( _var_name="", _var_type=figure_out_type(value) if _var_type is None else _var_type, - _var_data=_var_data, + _var_data=ImmutableVarData.merge(_var_data), _var_value=value, ) @@ -1267,7 +884,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, ImmutableVar): + if not isinstance(step, Var): 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() @@ -1301,7 +918,7 @@ def create( return cls( _var_name="", _var_type=array._var_type, - _var_data=_var_data, + _var_data=ImmutableVarData.merge(_var_data), _array=array, _start=slice.start, _stop=slice.stop, @@ -1347,62 +964,6 @@ 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. @@ -1477,26 +1038,6 @@ 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. @@ -1519,12 +1060,43 @@ def array_contains_operation(haystack: ArrayVar, needle: Any | Var): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToStringOperation(ToOperation, StringVar): +class ToStringOperation(CachedVarOperation, StringVar): """Base class for immutable string vars that are the result of a to string operation.""" - _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) + _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) - _default_var_type: ClassVar[Type] = str + @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, + ) @dataclasses.dataclass( @@ -1532,12 +1104,44 @@ class ToStringOperation(ToOperation, StringVar): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToArrayOperation(ToOperation, ArrayVar): +class ToArrayOperation(CachedVarOperation, ArrayVar): """Base class for immutable array vars that are the result of a to array operation.""" - _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) + _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) - _default_var_type: ClassVar[Type] = List[Any] + @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, + ) @var_operation @@ -1559,29 +1163,6 @@ 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 0ee9dbb374e..1bd4cc94627 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -34,12 +34,7 @@ from sqlalchemy.orm import DeclarativeBase from reflex.config import get_config -from reflex.ivars.base import ( - ImmutableComputedVar, - ImmutableVar, - immutable_computed_var, - is_computed_var, -) +from reflex.ivars.base import ImmutableComputedVar, ImmutableVar, immutable_computed_var try: import pydantic.v1 as pydantic @@ -64,7 +59,11 @@ 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 VarData +from reflex.vars import ( + ComputedVar, + ImmutableVarData, + Var, +) if TYPE_CHECKING: from reflex.components.component import Component @@ -304,16 +303,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, ImmutableVar]] = {} + vars: ClassVar[Dict[str, Var]] = {} # The base vars of the class. base_vars: ClassVar[Dict[str, ImmutableVar]] = {} # The computed vars of the class. - computed_vars: ClassVar[Dict[str, ImmutableComputedVar]] = {} + computed_vars: ClassVar[Dict[str, Union[ComputedVar, ImmutableComputedVar]]] = {} # Vars inherited by the parent state. - inherited_vars: ClassVar[Dict[str, ImmutableVar]] = {} + inherited_vars: ClassVar[Dict[str, Var]] = {} # Backend base vars that are never sent to the client. backend_vars: ClassVar[Dict[str, Any]] = {} @@ -423,7 +422,7 @@ def __repr__(self) -> str: return f"{self.__class__.__name__}({self.dict()})" @classmethod - def _get_computed_vars(cls) -> list[ImmutableComputedVar]: + def _get_computed_vars(cls) -> list[Union[ComputedVar, ImmutableComputedVar]]: """Helper function to get all computed vars of a instance. Returns: @@ -433,7 +432,8 @@ def _get_computed_vars(cls) -> list[ImmutableComputedVar]: v for mixin in cls._mixins() + [cls] for name, v in mixin.__dict__.items() - if is_computed_var(v) and name not in cls.inherited_vars + if isinstance(v, (ComputedVar, ImmutableComputedVar)) + 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=VarData.from_state(cls), + _var_data=ImmutableVarData.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=VarData.from_state(cls)) + v._var_name: v._replace(merge_var_data=ImmutableVarData.from_state(cls)) for v in computed_vars } cls.vars = { @@ -553,9 +553,11 @@ def __init_subclass__(cls, mixin: bool = False, **kwargs): for name, value in mixin.__dict__.items(): if name in cls.inherited_vars: continue - if is_computed_var(value): + if isinstance(value, (ComputedVar, ImmutableComputedVar)): fget = cls._copy_fn(value.fget) - newcv = value._replace(fget=fget, _var_data=VarData.from_state(cls)) + newcv = value._replace( + fget=fget, _var_data=ImmutableVarData.from_state(cls) + ) # cleanup refs to mixin cls in var_data setattr(cls, name, newcv) cls.computed_vars[newcv._var_name] = newcv @@ -895,7 +897,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=VarData.from_state(cls), + _var_data=ImmutableVarData.from_state(cls), ).guess_type() # add the pydantic field dynamically (must be done before _init_var) @@ -1010,13 +1012,13 @@ def argsingle_factory(param): def inner_func(self) -> str: return self.router.page.params.get(param, "") - return ImmutableComputedVar(fget=inner_func, cache=True) + return ComputedVar(fget=inner_func, cache=True) def arglist_factory(param): def inner_func(self) -> List: return self.router.page.params.get(param, []) - return ImmutableComputedVar(fget=inner_func, cache=True) + return ComputedVar(fget=inner_func, cache=True) for param, value in args.items(): if value == constants.RouteArgType.SINGLE: @@ -1025,8 +1027,8 @@ def inner_func(self) -> List: func = arglist_factory(param) else: continue - # to allow passing as a prop, evade python frozen rules (bad practice) - object.__setattr__(func, "_var_name", param) + # to allow passing as a prop + func._var_name = param cls.vars[param] = cls.computed_vars[param] = func._var_set_state(cls) # type: ignore setattr(cls, param, func) @@ -1787,7 +1789,7 @@ def dict( # Include initial computed vars. prop_name: ( cv._initial_value - if is_computed_var(cv) + if isinstance(cv, (ComputedVar, ImmutableComputedVar)) 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 b29160cb289..a2083f6344d 100644 --- a/reflex/style.py +++ b/reflex/style.py @@ -6,13 +6,14 @@ from reflex import constants from reflex.components.core.breakpoints import Breakpoints, breakpoints_values -from reflex.event import EventChain, EventHandler +from reflex.event import EventChain 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 Var, VarData +from reflex.vars import ImmutableVarData, Var, VarData + +VarData.update_forward_refs() # Ensure all type definitions are resolved SYSTEM_COLOR_MODE: str = "system" LIGHT_COLOR_MODE: str = "light" @@ -39,7 +40,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=VarData( + _var_data=ImmutableVarData( imports=color_mode_imports, hooks={f"const {{ {_var_name} }} = useContext(ColorModeContext)": None}, ), @@ -49,7 +50,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, -) -> ImmutableVar[EventChain]: +) -> Var[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 @@ -68,15 +69,15 @@ def set_color_mode( if new_color_mode is None: return base_setter - if not isinstance(new_color_mode, ImmutableVar): + if not isinstance(new_color_mode, Var): new_color_mode = LiteralVar.create(new_color_mode) return ImmutableVar( f"() => {str(base_setter)}({str(new_color_mode)})", - _var_data=VarData.merge( + _var_data=ImmutableVarData.merge( base_setter._get_all_var_data(), new_color_mode._get_all_var_data() ), - ).to(FunctionVar, EventChain) # type: ignore + ).to(FunctionVar, EventChain) # Var resolves to the current color mode for the app ("light", "dark" or "system") @@ -115,7 +116,7 @@ def media_query(breakpoint_expr: str): def convert_item( style_item: int | str | Var, -) -> tuple[str | Var, VarData | VarData | None]: +) -> tuple[str | Var, VarData | ImmutableVarData | None]: """Format a single value in a style dictionary. Args: @@ -123,17 +124,8 @@ 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, EventHandler): - raise ReflexError( - "EventHandlers cannot be used as style values. " - "Please use a Var or a literal value." - ) - - if isinstance(style_item, ImmutableVar): + if isinstance(style_item, Var): return style_item, style_item._get_all_var_data() # if isinstance(style_item, str) and REFLEX_VAR_OPENING_TAG not in style_item: @@ -146,7 +138,7 @@ def convert_item( def convert_list( - responsive_list: list[str | dict | ImmutableVar], + responsive_list: list[str | dict | Var], ) -> tuple[list[str | dict[str, Var | list | dict]], VarData | None]: """Format a responsive value list. @@ -189,7 +181,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, ImmutableVar): + if isinstance(value, Var): 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 0e18a84956a..e7d85a93e82 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 Var +from reflex.vars import BaseVar, Var if TYPE_CHECKING: from reflex.components.component import ComponentStyle @@ -263,6 +263,34 @@ 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. @@ -272,7 +300,13 @@ def format_var(var: Var) -> str: Returns: The formatted Var. """ - return str(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) def format_route(route: str, format_case=True) -> str: @@ -297,11 +331,46 @@ def format_route(route: str, format_case=True) -> str: return route -def format_match( - cond: str | ImmutableVar, - match_cases: List[List[ImmutableVar]], - default: ImmutableVar, +def format_cond( + cond: str | Var, + true_value: str | Var, + false_value: str | Var = '""', + is_prop=False, ) -> 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: @@ -320,19 +389,24 @@ def format_match( return_value = case[-1] case_conditions = " ".join( - [f"case JSON.stringify({str(condition)}):" for condition in conditions] + [ + f"case JSON.stringify({condition._var_name_unwrapped}):" + for condition in conditions + ] + ) + case_code = ( + f"{case_conditions} return ({return_value._var_name_unwrapped}); break;" ) - case_code = f"{case_conditions} return ({str(return_value)}); break;" switch_code += case_code - switch_code += f"default: return ({str(default)}); break;" + switch_code += f"default: return ({default._var_name_unwrapped}); break;" switch_code += "};})()" return switch_code def format_prop( - prop: Union[ImmutableVar, EventChain, ComponentStyle, str], + prop: Union[Var, EventChain, ComponentStyle, str], ) -> Union[int, float, str]: """Format a prop. @@ -348,16 +422,23 @@ 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, ImmutableVar): - return str(prop) + 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 # Handle event props. - if isinstance(prop, EventChain): + elif isinstance(prop, EventChain): sig = inspect.signature(prop.args_spec) # type: ignore if sig.parameters: arg_def = ",".join(f"_{p}" for p in sig.parameters) @@ -411,9 +492,9 @@ def format_props(*single_props, **key_value_props) -> list[str]: return [ ( f"{name}={format_prop(prop)}" - if isinstance(prop, ImmutableVar) and not isinstance(prop, ImmutableVar) + if isinstance(prop, Var) and not isinstance(prop, ImmutableVar) else ( - f"{name}={{{format_prop(prop if isinstance(prop, ImmutableVar) else LiteralVar.create(prop))}}}" + f"{name}={{{format_prop(prop if isinstance(prop, Var) else LiteralVar.create(prop))}}}" ) ) for name, prop in sorted(key_value_props.items()) @@ -421,8 +502,8 @@ def format_props(*single_props, **key_value_props) -> list[str]: ] + [ ( str(prop) - if isinstance(prop, ImmutableVar) and not isinstance(prop, ImmutableVar) - else f"{str(LiteralVar.create(prop))}" + if isinstance(prop, Var) and not isinstance(prop, ImmutableVar) + else f"{{{str(LiteralVar.create(prop))}}}" ) for prop in single_props ] @@ -493,7 +574,7 @@ def format_event(event_spec: EventSpec) -> str: "`", ) if val._var_is_string - else str(val) + else val._var_full_name ), ) ) @@ -510,8 +591,44 @@ def format_event(event_spec: EventSpec) -> str: return f"Event({', '.join(event_args)})" -if TYPE_CHECKING: - from reflex.ivars import ImmutableVar +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 "", + ")", + ] + ) def format_queue_events( @@ -523,7 +640,7 @@ def format_queue_events( | None ) = None, args_spec: Optional[ArgsSpec] = None, -) -> ImmutableVar[EventChain]: +) -> Var[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 @@ -552,7 +669,7 @@ def format_queue_events( from reflex.ivars import FunctionVar, ImmutableVar if not events: - return ImmutableVar("(() => null)").to(FunctionVar, EventChain) # type: ignore + return ImmutableVar("(() => null)").to(FunctionVar, EventChain) # If no spec is provided, the function will take no arguments. def _default_args_spec(): @@ -577,7 +694,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, ImmutableVar): + if isinstance(specs, Var): raise ValueError( f"Invalid event spec: {specs}. Expected a list of EventSpecs." ) @@ -588,7 +705,7 @@ def _default_args_spec(): return ImmutableVar( f"{arg_def} => {{queueEvents([{','.join(payloads)}], {constants.CompileVars.SOCKET}); " f"processEvent({constants.CompileVars.SOCKET})}}", - ).to(FunctionVar, EventChain) # type: ignore + ).to(FunctionVar, EventChain) def format_query_params(router_data: dict[str, Any]) -> dict[str, str]: @@ -675,6 +792,41 @@ 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. @@ -705,6 +857,42 @@ 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. @@ -727,23 +915,6 @@ 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. @@ -756,8 +927,6 @@ 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"} @@ -770,7 +939,7 @@ def format_data_editor_column(col: str | dict): col["overlayIcon"] = None return col - if isinstance(col, ImmutableVar): + if isinstance(col, BaseVar): return col raise ValueError( diff --git a/reflex/utils/pyi_generator.py b/reflex/utils/pyi_generator.py index cc60418a9a8..f96a4c04679 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,11 +69,10 @@ # TODO: fix import ordering and unused imports with ruff later DEFAULT_IMPORTS = { "typing": sorted(DEFAULT_TYPING_IMPORTS), - "reflex.vars": ["Var"], + "reflex.vars": ["Var", "BaseVar", "ComputedVar"], "reflex.components.core.breakpoints": ["Breakpoints"], "reflex.event": ["EventChain", "EventHandler", "EventSpec"], "reflex.style": ["Style"], - "reflex.ivars.base": ["ImmutableVar"], } @@ -356,7 +355,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, ImmutableVar): + if isinstance(default, Var): default = default._decode() # type: ignore kwargs.append( @@ -434,7 +433,7 @@ def _generate_component_create_functiondef( ast.arg( arg=trigger, annotation=ast.Name( - id="Optional[Union[EventHandler, EventSpec, list, Callable, ImmutableVar]]" + id="Optional[Union[EventHandler, EventSpec, list, Callable, Var]]" ), ), ast.Constant(value=None), diff --git a/reflex/utils/serializers.py b/reflex/utils/serializers.py index 0b94be511ea..6c36647cc60 100644 --- a/reflex/utils/serializers.py +++ b/reflex/utils/serializers.py @@ -4,6 +4,7 @@ import functools import json +import types as builtin_types import warnings from datetime import date, datetime, time, timedelta from enum import Enum @@ -25,7 +26,7 @@ from reflex.base import Base from reflex.constants.colors import Color, format_color -from reflex.utils import types +from reflex.utils import exceptions, types # Mapping from type to a serializer. # The serializer should convert the type to a JSON object. @@ -249,14 +250,7 @@ def serialize_base(value: Base) -> str: Returns: The serialized Base. """ - 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), - ) - ) + return value.json() @serializer @@ -269,9 +263,13 @@ def serialize_list(value: Union[List, Tuple, Set]) -> str: Returns: The serialized list. """ - from reflex.ivars import LiteralArrayVar + from reflex.utils import format - return str(LiteralArrayVar.create(value)) + # Dump the list to a string. + fprop = format.json_dumps(list(value)) + + # Unwrap var values. + return format.unwrap_vars(fprop) @serializer @@ -283,10 +281,30 @@ def serialize_dict(prop: Dict[str, Any]) -> str: Returns: The serialized dictionary. + + Raises: + InvalidStylePropError: If the style prop is invalid. """ - from reflex.ivars import LiteralObjectVar + # 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) - return str(LiteralObjectVar.create(prop)) + # Unwrap var values. + return format.unwrap_vars(fprop) @serializer(to=str) diff --git a/reflex/utils/types.py b/reflex/utils/types.py index b4b4c109071..6c21aa6797b 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[[ImmutableVar], list[ImmutableVar]] +# ArgsSpec = Callable[[Var], list[Var]] 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,8 +524,10 @@ 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 @@ -585,11 +587,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.ivars import ImmutableVar + from reflex.vars import Var if ( is_literal(expected_type) - and not isinstance(value, ImmutableVar) # validating vars is not supported yet. + and not isinstance(value, Var) # 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 86816433eae..13481b962ed 100644 --- a/reflex/vars.py +++ b/reflex/vars.py @@ -4,24 +4,41 @@ 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.utils import imports +from reflex.base import Base +from reflex.utils import console, imports, serializers, types from reflex.utils.exceptions import ( + VarAttributeError, + VarDependencyError, VarTypeError, + VarValueError, ) # This module used to export ImportVar itself, so we still import it for export here @@ -32,15 +49,43 @@ 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 = { @@ -54,6 +99,15 @@ "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. @@ -68,11 +122,124 @@ 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 VarData: +class ImmutableVarData: """Metadata associated with a Var.""" # The name of the enclosing state. @@ -106,16 +273,10 @@ 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: VarData | None) -> VarData | None: + def merge( + cls, *others: ImmutableVarData | VarData | None + ) -> ImmutableVarData | None: """Merge multiple var data objects. Args: @@ -139,7 +300,7 @@ def merge(cls, *others: VarData | None) -> VarData | None: ) if state or _imports or hooks: - return VarData( + return ImmutableVarData( state=state, imports=_imports, hooks=hooks, @@ -163,7 +324,7 @@ def __eq__(self, other: Any) -> bool: Returns: True if all fields are equal and collapsed imports are equal. """ - if not isinstance(other, VarData): + if not isinstance(other, (ImmutableVarData, VarData)): return False # Don't compare interpolations - that's added in by the decoder, and @@ -172,14 +333,16 @@ def __eq__(self, other: Any) -> bool: self.state == other.state and self.hooks == ( - other.hooks if isinstance(other, VarData) else tuple(other.hooks.keys()) + other.hooks + if isinstance(other, ImmutableVarData) + 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) -> VarData: + def from_state(cls, state: Type[BaseState] | str) -> ImmutableVarData: """Set the state of the var. Args: @@ -191,7 +354,7 @@ def from_state(cls, state: Type[BaseState] | str) -> VarData: from reflex.utils import format state_name = state if isinstance(state, str) else state.get_full_name() - new_var_data = VarData( + new_var_data = ImmutableVarData( state=state_name, hooks={ "const {0} = useContext(StateContexts.{0})".format( @@ -206,7 +369,7 @@ def from_state(cls, state: Type[BaseState] | str) -> VarData: return new_var_data -def _decode_var_immutable(value: str) -> tuple[VarData | None, str]: +def _decode_var_immutable(value: str) -> tuple[ImmutableVarData | None, str]: """Decode the state name from a formatted var. Args: @@ -223,6 +386,15 @@ def _decode_var_immutable(value: str) -> tuple[VarData | 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() @@ -238,10 +410,49 @@ def _decode_var_immutable(value: str) -> tuple[VarData | None, str]: 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 VarData.merge(*var_datas) if var_datas else None, value + 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) # Compile regex for finding reflex var tags. @@ -251,7 +462,68 @@ def _decode_var_immutable(value: str) -> tuple[VarData | None, str]: _decode_var_pattern = re.compile(_decode_var_pattern_re, flags=re.DOTALL) # Defined global immutable vars. -_global_vars: Dict[int, ImmutableVar] = {} +_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 def _extract_var_data(value: Iterable) -> list[VarData | None]: @@ -263,13 +535,12 @@ 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, ImmutableVar): + if isinstance(sub, Var): var_datas.append(sub._var_data) elif not isinstance(sub, str): # Recurse into dict values. @@ -292,6 +563,24 @@ 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, @@ -299,7 +588,7 @@ def create( _var_is_local: bool = True, _var_is_string: bool | None = None, _var_data: Optional[VarData] = None, - ) -> ImmutableVar | None: + ) -> Var | None: """Create a var from a value. Args: @@ -310,45 +599,59 @@ def create( Returns: The var. + + Raises: + VarTypeError: If the value is JSON-unserializable. """ - from reflex.ivars import ImmutableVar, LiteralVar + from reflex.utils import format # Check for none values. if value is None: return None # If the value is already a var, do nothing. - if isinstance(value, ImmutableVar): + if isinstance(value, Var): return value - # If the value is not a string, create a LiteralVar. + # Try to pull the imports and hooks from contained values. if not isinstance(value, str): - 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, - ) - if _var_is_string is True: - return LiteralVar.create( - value, - _var_data=_var_data, + _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_}." ) - - # Otherwise, rely on _var_is_local - if _var_is_local is True: - return LiteralVar.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", ) - return ImmutableVar.create( - value, + 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, _var_data=_var_data, ) @@ -359,7 +662,7 @@ def create_safe( _var_is_local: bool = True, _var_is_string: bool | None = None, _var_data: Optional[VarData] = None, - ) -> ImmutableVar: + ) -> Var: """Create a var from a value, asserting that it is not None. Args: @@ -392,6 +695,164 @@ 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. @@ -399,7 +860,7 @@ def __bool__(self) -> bool: VarTypeError: when attempting to bool-ify the Var. """ raise VarTypeError( - f"Cannot convert Var {str(self)!r} to bool for use with `if`, `and`, `or`, and `not`. " + f"Cannot convert Var {self._var_full_name!r} to bool for use with `if`, `and`, `or`, and `not`. " "Instead use `rx.cond` and bitwise operators `&` (and), `|` (or), `~` (invert)." ) @@ -410,70 +871,1742 @@ def __iter__(self) -> Any: VarTypeError: when attempting to iterate over the Var. """ raise VarTypeError( - f"Cannot iterate over Var {str(self)!r}. Instead use `rx.foreach`." - ) - - def __contains__(self, _: Any) -> ImmutableVar: - """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." + f"Cannot iterate over Var {self._var_full_name!r}. Instead use `rx.foreach`." ) - def __get__(self, instance: Any, owner: Any) -> ImmutableVar: - """Return the value of the Var. + def __format__(self, format_spec: str) -> str: + """Format the var into a Javascript equivalent to an f-string. Args: - instance: The instance of the Var. - owner: The owner of the Var. + format_spec: The format specifier (Ignored for now). Returns: - The value of the Var. + The formatted var. """ - return self # type: ignore + # 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}" - @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). + def __getitem__(self, i: Any) -> Var: + """Index into a var. 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. + i: The index to index into. Returns: - A var representing range operation. + The indexed var. + + Raises: + VarTypeError: If the var is not indexable. """ - from reflex.ivars import ArrayVar + 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 ArrayVar.range(v1, v2, step) # 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 + ) - def upcast(self) -> ImmutableVar: - """Upcast a Var to an ImmutableVar. + # 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. + + Args: + name: The name of the attribute. Returns: - The upcasted Var. + The var attribute. + + Raises: + VarAttributeError: If the attribute cannot be found, or if __getattr__ fallback should be used. """ - return self # type: ignore + 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. - def json(self) -> str: - """Serialize the var to a JSON string. + Args: + name: The name of the attribute. + + Returns: + The var attribute. + + Raises: + VarAttributeError: If the var is wrongly annotated or can't find attribute. + VarTypeError: If an annotation to the var isn't provided. + """ + # 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 + + def json(self) -> str: + """Serialize the var to a JSON string. Raises: NotImplementedError: If the method is not implemented. """ 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() -> ImmutableVar: +def get_uuid_string_var() -> Var: """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 @@ -482,7 +2615,6 @@ def get_uuid_string_var() -> ImmutableVar: 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() @@ -494,7 +2626,7 @@ def get_uuid_string_var() -> ImmutableVar: hooks={f"const {unique_uuid_var} = useMemo(generateUUID, [])": None}, ) - return ImmutableVar( + return BaseVar( _var_name=unique_uuid_var, _var_type=str, _var_data=unique_uuid_var_data, diff --git a/reflex/vars.pyi b/reflex/vars.pyi new file mode 100644 index 00000000000..8c923f03e0c --- /dev/null +++ b/reflex/vars.pyi @@ -0,0 +1,221 @@ +"""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 02b03090299..f46ee16b1ac 100644 --- a/tests/components/core/test_banner.py +++ b/tests/components/core/test_banner.py @@ -19,14 +19,12 @@ def test_websocket_target_url(): def test_connection_banner(): banner = ConnectionBanner.create() _imports = banner._get_all_imports(collapse=True) - assert sorted(tuple(_imports)) == sorted( - ( - "react", - "/utils/context", - "/utils/state", - "@radix-ui/themes@^3.0.0", - "/env.json", - ) + assert tuple(_imports) == ( + "react", + "/utils/context", + "/utils/state", + "@radix-ui/themes@^3.0.0", + "/env.json", ) msg = "Connection error" @@ -37,14 +35,12 @@ def test_connection_banner(): def test_connection_modal(): modal = ConnectionModal.create() _imports = modal._get_all_imports(collapse=True) - assert sorted(tuple(_imports)) == sorted( - ( - "react", - "/utils/context", - "/utils/state", - "@radix-ui/themes@^3.0.0", - "/env.json", - ) + assert tuple(_imports) == ( + "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 4907bb48614..ace7adad6e5 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_type is str - assert str(color) == expected + assert color._var_is_string or color._var_type is str + assert color._var_full_name == 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 eb2fe200a1b..53f8e064067 100644 --- a/tests/components/core/test_cond.py +++ b/tests/components/core/test_cond.py @@ -9,6 +9,7 @@ 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 @@ -75,7 +76,7 @@ def test_validate_cond(cond_state: BaseState): (32, 0), ("hello", ""), (2.3, 0.0), - (LiteralVar.create("a"), LiteralVar.create("b")), + (Var.create("a"), Var.create("b")), ], ) def test_prop_cond(c1: Any, c2: Any): @@ -91,18 +92,18 @@ def test_prop_cond(c1: Any, c2: Any): c2, ) - assert isinstance(prop_cond, ImmutableVar) - if not isinstance(c1, ImmutableVar): + assert isinstance(prop_cond, Var) + if not isinstance(c1, Var): c1 = json.dumps(c1) - if not isinstance(c2, ImmutableVar): + if not isinstance(c2, Var): c2 = json.dumps(c2) - assert str(prop_cond) == f"(true ? {str(c1)} : {str(c2)})" + assert str(prop_cond) == f"(true ? {c1} : {c2})" def test_cond_no_mix(): """Test if cond can't mix components and props.""" with pytest.raises(ValueError): - cond(True, LiteralVar.create("hello"), Text.create("world")) + cond(True, Var.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 c4a18e61067..95feb7ae69b 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 ImmutableVar, LiteralVar +from reflex.ivars.base import LiteralVar from reflex.state import BaseState @@ -100,7 +100,7 @@ def test_render_with_key(): def test_render_with_special_props(): - special_prop = ImmutableVar.create_safe("{foo_bar}") + special_prop = rx.Var.create_safe("{foo_bar}", _var_is_string=False) 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 53459f92dbe..f1fae2577f1 100644 --- a/tests/components/core/test_foreach.py +++ b/tests/components/core/test_foreach.py @@ -12,10 +12,8 @@ ) 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): @@ -115,7 +113,7 @@ def display_colors_set(color): return box(text(color)) -def display_nested_list_element(element: ArrayVar[List[str]], index: NumberVar[int]): +def display_nested_list_element(element: Var[str], index: Var[int]): assert element._var_type == List[str] assert index._var_type == int return box(text(element[index])) @@ -238,7 +236,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, ImmutableVar) + assert isinstance(arg_index, Var) 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 f2cc97f250f..1843b914d57 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, ImmutableVar) - assert str(match_comp) == expected + assert isinstance(match_comp, Var) + assert match_comp._var_full_name == 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 cf7bafcd3c2..e6b27effcac 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, ImmutableVar) + assert isinstance(url, Var) def test__on_drop_spec(): - assert isinstance(_on_drop_spec(LiteralVar.create([])), list) + assert isinstance(_on_drop_spec(Var.create([])), list) def test_upload_create(): diff --git a/tests/components/forms/test_form.py b/tests/components/forms/test_form.py index efb31b97a31..b979d261a8d 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.ivars.base import ImmutableVar +from reflex.vars import BaseVar def test_render_on_submit(): """Test that on_submit event chain is rendered as a separate function.""" - submit_it = ImmutableVar( + submit_it = BaseVar( _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 b80611c0217..852c0c97c94 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=LiteralVar.create("2")) + ib2 = IconButton.create("activity", size=Var.create("2")) assert isinstance(ib2, IconButton) diff --git a/tests/components/test_component.py b/tests/components/test_component.py index 3ce5decad4d..3c824ed013b 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 ImmutableVar, LiteralVar +from reflex.ivars.base import 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 Var, VarData +from reflex.vars import BaseVar, Var, VarData @pytest.fixture @@ -270,121 +270,121 @@ def test_create_component(component1): [ pytest.param( "text", - LiteralVar.create("hello"), + Var.create("hello"), None, id="text", ), pytest.param( "text", - ImmutableVar(_var_name="hello", _var_type=Optional[str]), + BaseVar(_var_name="hello", _var_type=Optional[str]), None, id="text-optional", ), pytest.param( "text", - ImmutableVar(_var_name="hello", _var_type=Union[str, None]), + BaseVar(_var_name="hello", _var_type=Union[str, None]), None, id="text-union-str-none", ), pytest.param( "text", - ImmutableVar(_var_name="hello", _var_type=Union[None, str]), + BaseVar(_var_name="hello", _var_type=Union[None, str]), None, id="text-union-none-str", ), pytest.param( "text", - LiteralVar.create(1), + Var.create(1), TypeError, id="text-int", ), pytest.param( "number", - LiteralVar.create(1), + Var.create(1), None, id="number", ), pytest.param( "number", - ImmutableVar(_var_name="1", _var_type=Optional[int]), + BaseVar(_var_name="1", _var_type=Optional[int]), None, id="number-optional", ), pytest.param( "number", - ImmutableVar(_var_name="1", _var_type=Union[int, None]), + BaseVar(_var_name="1", _var_type=Union[int, None]), None, id="number-union-int-none", ), pytest.param( "number", - ImmutableVar(_var_name="1", _var_type=Union[None, int]), + BaseVar(_var_name="1", _var_type=Union[None, int]), None, id="number-union-none-int", ), pytest.param( "number", - LiteralVar.create("1"), + Var.create("1"), TypeError, id="number-str", ), pytest.param( "text_or_number", - LiteralVar.create("hello"), + Var.create("hello"), None, id="text_or_number-str", ), pytest.param( "text_or_number", - LiteralVar.create(1), + Var.create(1), None, id="text_or_number-int", ), pytest.param( "text_or_number", - ImmutableVar(_var_name="hello", _var_type=Optional[str]), + BaseVar(_var_name="hello", _var_type=Optional[str]), None, id="text_or_number-optional-str", ), pytest.param( "text_or_number", - ImmutableVar(_var_name="hello", _var_type=Union[str, None]), + BaseVar(_var_name="hello", _var_type=Union[str, None]), None, id="text_or_number-union-str-none", ), pytest.param( "text_or_number", - ImmutableVar(_var_name="hello", _var_type=Union[None, str]), + BaseVar(_var_name="hello", _var_type=Union[None, str]), None, id="text_or_number-union-none-str", ), pytest.param( "text_or_number", - ImmutableVar(_var_name="1", _var_type=Optional[int]), + BaseVar(_var_name="1", _var_type=Optional[int]), None, id="text_or_number-optional-int", ), pytest.param( "text_or_number", - ImmutableVar(_var_name="1", _var_type=Union[int, None]), + BaseVar(_var_name="1", _var_type=Union[int, None]), None, id="text_or_number-union-int-none", ), pytest.param( "text_or_number", - ImmutableVar(_var_name="1", _var_type=Union[None, int]), + BaseVar(_var_name="1", _var_type=Union[None, int]), None, id="text_or_number-union-none-int", ), pytest.param( "text_or_number", - LiteralVar.create(1.0), + Var.create(1.0), TypeError, id="text_or_number-float", ), pytest.param( "text_or_number", - ImmutableVar(_var_name="hello", _var_type=Optional[Union[str, int]]), + BaseVar(_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[ImmutableVar, str, int], + var: Union[Var, 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=LiteralVar.create(1), color=LiteralVar.create("red") + rx.text("child"), width=Var.create(1), color=Var.create("red") ) assert isinstance(ccomponent, CustomComponent) assert len(ccomponent.children) == 1 @@ -1175,12 +1175,13 @@ 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 = ImmutableVar.create_safe("arg") +ARG_VAR = Var.create("arg") TEST_VAR_DICT_OF_DICT = LiteralVar.create({"a": {"b": "test"}})._replace( merge_var_data=TEST_VAR._var_data @@ -1400,7 +1401,6 @@ 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(LiteralVar.create([1, 2, 3]), lambda x: valid_component2(x)) # type: ignore + rx.foreach(Var.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( - LiteralVar.create([1, 2, 3]), # type: ignore + Var.create([1, 2, 3]), # type: ignore lambda x: valid_component2(valid_component3(x)), ) ), @@ -1645,9 +1645,7 @@ def test_validate_invalid_children(): True, rx.fragment(invalid_component()), rx.fragment( - rx.foreach( - LiteralVar.create([1, 2, 3]), lambda x: invalid_component(x) - ) # type: ignore + rx.foreach(Var.create([1, 2, 3]), lambda x: invalid_component(x)) # type: ignore ), ) ) @@ -2029,7 +2027,7 @@ def add_hooks(self): return [ "const hook3 = useRef(null)", "const hook1 = 42", - ImmutableVar.create( + Var.create( "useEffect(() => () => {}, [])", _var_data=VarData( hooks={ @@ -2039,7 +2037,7 @@ def add_hooks(self): imports={"react": [ImportVar(tag="useEffect")]}, ), ), - ImmutableVar.create( + Var.create( "const hook3 = useRef(null)", _var_data=VarData( imports={"react": [ImportVar(tag="useRef")]}, @@ -2152,9 +2150,7 @@ def do_something(self): rx.text("random text", on_click=TriggerState.do_something), rx.text( "random text", - on_click=ImmutableVar( - _var_name="toggleColorMode", _var_type=EventChain - ), + on_click=BaseVar(_var_name="toggleColorMode", _var_type=EventChain), ), ), True, @@ -2164,9 +2160,7 @@ def do_something(self): rx.text("random text", on_click=rx.console_log("log")), rx.text( "random text", - on_click=ImmutableVar( - _var_name="toggleColorMode", _var_type=EventChain - ), + on_click=BaseVar(_var_name="toggleColorMode", _var_type=EventChain), ), ), False, diff --git a/tests/components/test_tag.py b/tests/components/test_tag.py index b4b37cc285f..d43f73842b8 100644 --- a/tests/components/test_tag.py +++ b/tests/components/test_tag.py @@ -3,7 +3,8 @@ import pytest from reflex.components.tags import CondTag, Tag, tagless -from reflex.ivars.base import ImmutableVar, LiteralVar +from reflex.ivars.base import LiteralVar +from reflex.vars import BaseVar, Var @pytest.mark.parametrize( @@ -16,7 +17,7 @@ ({"key": True, "key2": "value2"}, ["key={true}", 'key2={"value2"}']), ], ) -def test_format_props(props: Dict[str, ImmutableVar], test_props: List): +def test_format_props(props: Dict[str, Var], test_props: List): """Test that the formatted props are correct. Args: @@ -40,7 +41,7 @@ def test_format_props(props: Dict[str, ImmutableVar], test_props: List): (None, False), ], ) -def test_is_valid_prop(prop: ImmutableVar, valid: bool): +def test_is_valid_prop(prop: Var, valid: bool): """Test that the prop is valid. Args: @@ -110,7 +111,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=ImmutableVar(_var_name="logged_in", _var_type=bool), + cond=BaseVar(_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 167cbf0d48d..ab7b50bdf2b 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -35,7 +35,6 @@ 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 ( @@ -51,6 +50,7 @@ ) 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 - @immutable_computed_var(cache=True) + @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 - @immutable_computed_var(cache=True) + @computed_var(cache=True) def foo(self) -> str: return "foo" - @immutable_computed_var(deps=["_backend", "base", foo], cache=True) + @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): - @immutable_computed_var(deps=["foolksjdf"], cache=True) + @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 c538ce06912..a484e0a3c38 100644 --- a/tests/test_event.py +++ b/tests/test_event.py @@ -7,9 +7,10 @@ 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) -> ImmutableVar: +def make_var(value) -> Var: """Make a variable. Args: @@ -18,7 +19,9 @@ def make_var(value) -> ImmutableVar: Returns: The var. """ - return ImmutableVar.create_safe(value) + var = Var.create(value) + assert var is not None + return var def test_create_event(): @@ -54,10 +57,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(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 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 ( format.format_event(event_spec) == 'Event("test_fn_with_args", {arg1:first,arg2:second})' @@ -79,9 +82,9 @@ def test_fn_with_args(_, arg1, arg2): ) assert event_spec.handler == handler - 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[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(LiteralVar.create(second)) handler = EventHandler(fn=test_fn_with_args) @@ -106,17 +109,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(ImmutableVar.create_safe("arg1")) - assert event_spec.args[0][1].equals(ImmutableVar.create_safe("first")) + assert event_spec.args[0][0].equals(Var.create_safe("arg1")) + assert event_spec.args[0][1].equals(Var.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(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 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 ( format.format_event(event_spec2) == 'Event("test_fn_with_args", {arg1:first,arg2:_a2})' @@ -168,7 +171,7 @@ def test_fn_with_args(_, arg1, arg2): 'Event("_redirect", {path:"/path",external:false,replace:false})', ), ( - (ImmutableVar.create_safe("path"), None, None), + (Var.create_safe("path"), None, None), 'Event("_redirect", {path:path,external:false,replace:false})', ), ( @@ -234,7 +237,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(ImmutableVar.create_safe("ref")) + assert spec.args[0][0].equals(Var.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") @@ -246,9 +249,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(ImmutableVar.create_safe("ref")) + assert spec.args[0][0].equals(Var.create_safe("ref")) assert spec.args[0][1].equals(LiteralVar.create("ref_input1")) - assert spec.args[1][0].equals(ImmutableVar.create_safe("value")) + assert spec.args[1][0].equals(Var.create_safe("value")) assert spec.args[1][1].equals(LiteralVar.create("")) assert ( format.format_event(spec) == 'Event("_set_value", {ref:"ref_input1",value:""})' @@ -265,9 +268,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(ImmutableVar.create_safe("key")) + assert spec.args[0][0].equals(Var.create_safe("key")) assert spec.args[0][1].equals(LiteralVar.create("testkey")) - assert spec.args[1][0].equals(ImmutableVar.create_safe("options")) + assert spec.args[1][0].equals(Var.create_safe("options")) assert spec.args[1][1].equals(LiteralVar.create({"path": "/"})) assert ( format.format_event(spec) @@ -286,9 +289,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(ImmutableVar.create_safe("key")) + assert spec.args[0][0].equals(Var.create_safe("key")) assert spec.args[0][1].equals(LiteralVar.create("testkey")) - assert spec.args[1][0].equals(ImmutableVar.create_safe("options")) + assert spec.args[1][0].equals(Var.create_safe("options")) assert spec.args[1][1].equals(LiteralVar.create(options)) assert ( format.format_event(spec) @@ -310,7 +313,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(ImmutableVar.create_safe("key")) + assert spec.args[0][0].equals(Var.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 29944840ebb..0344ea0520d 100644 --- a/tests/test_state.py +++ b/tests/test_state.py @@ -22,7 +22,6 @@ 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, @@ -42,6 +41,7 @@ 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") - @ImmutableComputedVar + @ComputedVar def sum(self) -> float: """Dynamically sum the numbers. @@ -111,7 +111,7 @@ def sum(self) -> float: """ return self.num1 + self.num2 - @ImmutableComputedVar + @ComputedVar 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, ImmutableVar) + assert isinstance(prop, Var) 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( - ImmutableVar(_var_name="num3", _var_type=int)._var_set_state(TestState) + BaseVar(_var_name="num3", _var_type=int)._var_set_state(TestState) ) var = TestState.num3 # type: ignore - assert var._var_name == TestState.get_full_name() + ".num3" + assert var._var_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): - @ImmutableComputedVar + @ComputedVar def rendered_var(self): return self.v @@ -1121,7 +1121,7 @@ class MainState(BaseState): t1: str = "a" t2: str = "b" - @ImmutableComputedVar + @ComputedVar def rendered_var(self) -> str: if self.flag: return self.t1 @@ -3068,12 +3068,12 @@ def test_potentially_dirty_substates(): """ class State(RxState): - @ImmutableComputedVar + @ComputedVar def foo(self) -> str: return "" class C1(State): - @ImmutableComputedVar + @ComputedVar def bar(self) -> str: return "" diff --git a/tests/test_style.py b/tests/test_style.py index e170fe6141d..8fa443cdf60 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 VarData +from reflex.vars import ImmutableVarData, Var, 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, ImmutableVar): + elif isinstance(value, Var): 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 ( - VarData.merge(comp.style._var_data) + ImmutableVarData.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 bf66561b2f4..ba9cf24c806 100644 --- a/tests/test_var.py +++ b/tests/test_var.py @@ -9,10 +9,8 @@ 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, ) @@ -22,7 +20,7 @@ LiteralNumberVar, NumberVar, ) -from reflex.ivars.object import LiteralObjectVar, ObjectVar +from reflex.ivars.object import LiteralObjectVar from reflex.ivars.sequence import ( ArrayVar, ConcatVarOperation, @@ -32,16 +30,22 @@ from reflex.state import BaseState from reflex.utils.imports import ImportVar from reflex.vars import ( + BaseVar, + ComputedVar, + ImmutableVarData, Var, VarData, + computed_var, ) test_vars = [ - 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), + 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), ] @@ -67,7 +71,7 @@ class ParentState(BaseState): foo: int bar: int - @immutable_computed_var + @computed_var def var_without_annotation(self): return TestObj @@ -77,7 +81,7 @@ def var_without_annotation(self): @pytest.fixture def ChildState(ParentState, TestObj): class ChildState(ParentState): - @immutable_computed_var + @computed_var def var_without_annotation(self): return TestObj @@ -87,7 +91,7 @@ def var_without_annotation(self): @pytest.fixture def GrandChildState(ChildState, TestObj): class GrandChildState(ChildState): - @immutable_computed_var + @computed_var def var_without_annotation(self): return TestObj @@ -97,7 +101,7 @@ def var_without_annotation(self): @pytest.fixture def StateWithAnyVar(TestObj): class StateWithAnyVar(BaseState): - @immutable_computed_var + @computed_var def var_without_annotation(self) -> typing.Any: return TestObj @@ -107,7 +111,7 @@ def var_without_annotation(self) -> typing.Any: @pytest.fixture def StateWithCorrectVarAnnotation(): class StateWithCorrectVarAnnotation(BaseState): - @immutable_computed_var + @computed_var def var_with_annotation(self) -> str: return "Correct annotation" @@ -117,7 +121,7 @@ def var_with_annotation(self) -> str: @pytest.fixture def StateWithWrongVarAnnotation(TestObj): class StateWithWrongVarAnnotation(BaseState): - @immutable_computed_var + @computed_var def var_with_annotation(self) -> str: return TestObj @@ -127,7 +131,7 @@ def var_with_annotation(self) -> str: @pytest.fixture def StateWithInitialComputedVar(): class StateWithInitialComputedVar(BaseState): - @immutable_computed_var(initial_value="Initial value") + @computed_var(initial_value="Initial value") def var_with_initial_value(self) -> str: return "Runtime value" @@ -137,7 +141,7 @@ def var_with_initial_value(self) -> str: @pytest.fixture def ChildWithInitialComputedVar(StateWithInitialComputedVar): class ChildWithInitialComputedVar(StateWithInitialComputedVar): - @immutable_computed_var(initial_value="Initial value") + @computed_var(initial_value="Initial value") def var_with_initial_value_child(self) -> str: return "Runtime value" @@ -147,7 +151,7 @@ def var_with_initial_value_child(self) -> str: @pytest.fixture def StateWithRuntimeOnlyVar(): class StateWithRuntimeOnlyVar(BaseState): - @immutable_computed_var(initial_value=None) + @computed_var(initial_value=None) def var_raises_at_runtime(self) -> str: raise ValueError("So nicht, mein Freund") @@ -157,7 +161,7 @@ def var_raises_at_runtime(self) -> str: @pytest.fixture def ChildWithRuntimeOnlyVar(StateWithRuntimeOnlyVar): class ChildWithRuntimeOnlyVar(StateWithRuntimeOnlyVar): - @immutable_computed_var(initial_value="Initial value") + @computed_var(initial_value="Initial value") def var_raises_at_runtime_child(self) -> str: raise ValueError("So nicht, mein Freund") @@ -184,14 +188,14 @@ def test_full_name(prop, expected): prop: The var to test. expected: The expected full name. """ - assert str(prop) == expected + assert prop._var_full_name == 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): @@ -207,14 +211,14 @@ def test_str(prop, expected): @pytest.mark.parametrize( "prop,expected", [ - (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()), + (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()), ], ) def test_default_value(prop, expected): @@ -253,16 +257,14 @@ def test_get_setter(prop, expected): @pytest.mark.parametrize( "value,expected", [ - (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])), + (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)), ( {"a": 1, "b": 2}, - ImmutableVar( - _var_name='({ ["a"] : 1, ["b"] : 2 })', _var_type=Dict[str, int] - ), + BaseVar(_var_name='{"a": 1, "b": 2}', _var_type=dict, _var_is_local=True), ), ], ) @@ -273,8 +275,11 @@ def test_create(value, expected): value: The value to create a var from. expected: The expected name of the setter function. """ - prop = LiteralVar.create(value) - assert prop.equals(expected) # type: ignore + prop = Var.create(value) + if value is None: + assert prop == expected + else: + assert prop.equals(expected) # type: ignore def test_create_type_error(): @@ -286,11 +291,17 @@ class ErrorType: value = ErrorType() with pytest.raises(TypeError): - LiteralVar.create(value) + Var.create(value) -def v(value) -> ImmutableVar: - return 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 test_basic_operations(TestObj): @@ -299,78 +310,129 @@ 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(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(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(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")' + str( + Var.create("foo", _var_is_local=False) + == Var.create("bar", _var_is_local=False) + ) + == "{((foo) === (bar))}" ) - print(ImmutableVar(_var_name="foo").to(ObjectVar, TestObj)._var_set_state("state")) assert ( str( - ImmutableVar(_var_name="foo") - .to(ObjectVar, TestObj) - ._var_set_state("state") - .bar - == LiteralVar.create("bar") + 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 + ) ) - == '(state.foo["bar"] === "bar")' + == "((`foo`) === (`bar`))" ) assert ( str( - ImmutableVar(_var_name="foo") - .to(ObjectVar, TestObj) + BaseVar( + _var_name="foo", + _var_type=TestObj, + _var_is_string=True, + _var_is_local=False, + ) ._var_set_state("state") .bar + == BaseVar( + _var_name="bar", _var_type=str, _var_is_string=True, _var_is_local=True + ) ) - == 'state.foo["bar"]' + == "{((state.foo.bar) === (`bar`))}" ) - assert str(abs(LiteralNumberVar.create(1))) == "Math.abs(1)" - assert str(LiteralArrayVar.create([1, 2, 3]).length()) == "[1, 2, 3].length" assert ( - str(LiteralArrayVar.create([1, 2]) + LiteralArrayVar.create([3, 4])) - == "[...[1, 2], ...[3, 4]]" + str(BaseVar(_var_name="foo", _var_type=TestObj)._var_set_state("state").bar) + == "{state.foo.bar}" ) + 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(LiteralArrayVar.create([1, 2, 3]).reverse()) - == "[1, 2, 3].slice().reverse()" + str(BaseVar(_var_name="foo", _var_type=str)._type() == list) # type: ignore + == "{((typeof foo) === (`Array`))}" ) assert ( - str(LiteralArrayVar.create(["1", "2", "3"]).reverse()) - == '["1", "2", "3"].slice().reverse()' + str(BaseVar(_var_name="foo", _var_type=str)._type() == float) # type: ignore + == "{((typeof foo) === (`number`))}" ) assert ( - str(ImmutableVar(_var_name="foo")._var_set_state("state").to(list).reverse()) - == "state.foo.slice().reverse()" + str(BaseVar(_var_name="foo", _var_type=str)._type() == tuple) # type: ignore + == "{((typeof foo) === (`Array`))}" ) assert ( - str(ImmutableVar(_var_name="foo").to(list).reverse()) == "foo.slice().reverse()" + str(BaseVar(_var_name="foo", _var_type=str)._type() == dict) # type: ignore + == "{((typeof foo) === (`Object`))}" ) assert ( - str(ImmutableVar(_var_name="foo", _var_type=str).js_type()) == "(typeof(foo))" + 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`))}" ) @@ -380,81 +442,76 @@ 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"]'), - ( - ImmutableVar(_var_name="foo")._var_set_state("state").to(list), - "state.foo", - ), - (ImmutableVar(_var_name="foo").to(list), "foo"), + (BaseVar(_var_name="foo", _var_type=list)._var_set_state("state"), "state.foo"), + (BaseVar(_var_name="foo", _var_type=list), "foo"), (v((1, 2, 3)), "[1, 2, 3]"), (v(("1", "2", "3")), '["1", "2", "3"]'), ( - ImmutableVar(_var_name="foo")._var_set_state("state").to(tuple), + BaseVar(_var_name="foo", _var_type=tuple)._var_set_state("state"), "state.foo", ), - (ImmutableVar(_var_name="foo").to(tuple), "foo"), + (BaseVar(_var_name="foo", _var_type=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 = 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)" + 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)}}" @pytest.mark.parametrize( "var, expected", [ (v("123"), json.dumps("123")), - (ImmutableVar(_var_name="foo")._var_set_state("state").to(str), "state.foo"), - (ImmutableVar(_var_name="foo").to(str), "foo"), + (BaseVar(_var_name="foo", _var_type=str)._var_set_state("state"), "state.foo"), + (BaseVar(_var_name="foo", _var_type=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 = 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")) == 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", "hello")) - == f'{expected}.some(obj => obj["hello"] === "1")' + str(var.contains("1", "hello")) == f'{{{expected}.some(e=>e[`hello`]==="1")}}' ) @pytest.mark.parametrize( "var, expected", [ - (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"), + (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"), ], ) 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 = ImmutableVar(_var_name="other")._var_set_state("state").to(str) - other_var = ImmutableVar(_var_name="other").to(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 = 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}.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", [ - 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(), + BaseVar(_var_name="list", _var_type=List[int]), + BaseVar(_var_name="tuple", _var_type=Tuple[int, int]), + BaseVar(_var_name="str", _var_type=str), ], ) def test_var_indexing_lists(var): @@ -464,21 +521,18 @@ 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_", [ - (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], - ), + (BaseVar(_var_name="list", _var_type=List[int]), [int, int]), + (BaseVar(_var_name="tuple", _var_type=Tuple[int, str]), [int, str]), ], ) def test_var_indexing_types(var, type_): @@ -495,105 +549,99 @@ def test_var_indexing_types(var, type_): def test_var_indexing_str(): """Test that we can index into str vars.""" - str_var = ImmutableVar(_var_name="str").to(str) + str_var = BaseVar(_var_name="str", _var_type=str) # Test that indexing gives a type of Var[str]. - assert isinstance(str_var[0], ImmutableVar) + assert isinstance(str_var[0], Var) 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", [ - (ImmutableVar(_var_name="foo", _var_type=int).guess_type()), - (ImmutableVar(_var_name="bar", _var_type=float).guess_type()), + (BaseVar(_var_name="foo", _var_type=int)), + (BaseVar(_var_name="bar", _var_type=float)), ], ) def test_var_replace_with_invalid_kwargs(var): with pytest.raises(TypeError) as excinfo: var._replace(_this_should_fail=True) - assert "unexpected keyword argument" in str(excinfo.value) + assert "Unexpected keyword arguments" in str(excinfo.value) def test_computed_var_replace_with_invalid_kwargs(): - @immutable_computed_var(initial_value=1) + @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 argument" in str(excinfo.value) + assert "Unexpected keyword arguments" in str(excinfo.value) @pytest.mark.parametrize( "var, index", [ - (ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), [1, 2]), + (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(), - {"name": "dict"}, - ), - (ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), {"set"}), - ( - ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + BaseVar(_var_name="lst", _var_type=List[int]), ( 1, 2, ), ), - (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]), 1.5), + (BaseVar(_var_name="lst", _var_type=List[int]), "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="string_var", _var_type=str), ), ( - 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="float_var", _var_type=float), ), ( - 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="list_var", _var_type=List[int]), ), ( - 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="set_var", _var_type=Set[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="lst", _var_type=List[int]), + BaseVar(_var_name="dict_var", _var_type=Dict[str, str]), ), - (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="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="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="string_var", _var_type=str), ), ( - 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="lst", _var_type=str), + BaseVar(_var_name="float_var", _var_type=float), ), - (ImmutableVar(_var_name="lst", _var_type=Tuple[str]).guess_type(), {"set"}), + (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(), - ImmutableVar(_var_name="string_var", _var_type=str).guess_type(), + 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="float_var", _var_type=float).guess_type(), + BaseVar(_var_name="lst", _var_type=Tuple[str]), + BaseVar(_var_name="float_var", _var_type=float), ), ], ) @@ -611,8 +659,9 @@ def test_var_unsupported_indexing_lists(var, index): @pytest.mark.parametrize( "var", [ - ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), - ImmutableVar(_var_name="tuple", _var_type=Tuple[int, int]).guess_type(), + BaseVar(_var_name="lst", _var_type=List[int]), + BaseVar(_var_name="tuple", _var_type=Tuple[int, int]), + BaseVar(_var_name="str", _var_type=str), ], ) def test_var_list_slicing(var): @@ -621,105 +670,84 @@ def test_var_list_slicing(var): Args: var : The str, list or tuple base var. """ - 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("")' + 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)}}" def test_dict_indexing(): """Test that we can index into dict vars.""" - dct = ImmutableVar(_var_name="dct").to(ObjectVar, Dict[str, str]) + dct = BaseVar(_var_name="dct", _var_type=Dict[str, int]) # 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", [ ( - ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), + BaseVar(_var_name="dict", _var_type=Dict[str, str]), [1, 2], ), ( - ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), + BaseVar(_var_name="dict", _var_type=Dict[str, str]), {"name": "dict"}, ), ( - ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), + BaseVar(_var_name="dict", _var_type=Dict[str, str]), {"set"}, ), ( - ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), + BaseVar(_var_name="dict", _var_type=Dict[str, str]), ( 1, 2, ), ), ( - 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="list_var", _var_type=List[int]), ), ( - 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="set_var", _var_type=Set[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="lst", _var_type=Dict[str, str]), + BaseVar(_var_name="dict_var", _var_type=Dict[str, str]), ), ( - ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), + BaseVar(_var_name="df", _var_type=DataFrame), [1, 2], ), ( - ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), + BaseVar(_var_name="df", _var_type=DataFrame), {"name": "dict"}, ), ( - ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), + BaseVar(_var_name="df", _var_type=DataFrame), {"set"}, ), ( - ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), + BaseVar(_var_name="df", _var_type=DataFrame), ( 1, 2, ), ), ( - 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="list_var", _var_type=List[int]), ), ( - 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="set_var", _var_type=Set[str]), ), ( - ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), - ImmutableVar(_var_name="dict_var", _var_type=Dict[str, str]).guess_type(), + BaseVar(_var_name="df", _var_type=DataFrame), + BaseVar(_var_name="dict_var", _var_type=Dict[str, str]), ), ], ) @@ -1051,9 +1079,7 @@ class Foo(Base): bar: Boo baz: int - parent_obj = LiteralObjectVar.create( - Foo(bar=Boo(foo="bar", bar=5), baz=5).dict(), Foo - ) + parent_obj = LiteralVar.create(Foo(bar=Boo(foo="bar", bar=5), baz=5)) assert ( str(parent_obj.bar.foo) @@ -1078,7 +1104,7 @@ def test_retrival(): assert REFLEX_VAR_OPENING_TAG in f_string assert REFLEX_VAR_CLOSING_TAG in f_string - result_var_data = LiteralVar.create(f_string)._get_all_var_data() + result_var_data = Var.create_safe(f_string)._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 ( @@ -1088,18 +1114,30 @@ def test_retrival(): ) assert ( result_var_data.imports - == result_immutable_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 + } + ) == original_var_data.imports ) assert ( - tuple(result_var_data.hooks) - == tuple(result_immutable_var_data.hooks) - == tuple(original_var_data.hooks) + 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()) ) def test_fstring_concat(): - original_var_with_data = LiteralVar.create( + original_var_with_data = Var.create_safe( "imagination", _var_data=VarData(state="fear") ) @@ -1122,9 +1160,9 @@ def test_fstring_concat(): ), ) - assert str(string_concat) == '("fooimaginationbar"+consequences+"baz")' + assert str(string_concat) == '("foo"+imagination+"bar"+consequences+"baz")' assert isinstance(string_concat, ConcatVarOperation) - assert string_concat._get_all_var_data() == VarData( + assert string_concat._get_all_var_data() == ImmutableVarData( state="fear", imports={ "react": [ImportVar(tag="useRef")], @@ -1134,22 +1172,17 @@ 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"{var}", f"{hash(var)}var"), + (f"{BaseVar(_var_name='var', _var_type=str)}", "${var}"), ( - f"testing f-string with {myvar}", - f"testing f-string with {hash(myvar)}state.myvar", + 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 local f-string {x}", - f"testing local f-string {hash(x)}x", + f"testing local f-string {BaseVar(_var_name='x', _var_is_local=True, _var_type=str)}", + "testing local f-string x", ), ], ) @@ -1162,8 +1195,8 @@ def test_fstrings(out, expected): [ ([1], ""), ({"a": 1}, ""), - ([LiteralVar.create(1)._var_set_state("foo")], "foo"), - ({"a": LiteralVar.create(1)._var_set_state("foo")}, "foo"), + ([Var.create_safe(1)._var_set_state("foo")], "foo"), + ({"a": Var.create_safe(1)._var_set_state("foo")}, "foo"), ], ) def test_extract_state_from_container(value, expect_state): @@ -1173,9 +1206,7 @@ def test_extract_state_from_container(value, expect_state): value: The value to create a var from. expect_state: The expected state. """ - var_data = LiteralVar.create(value)._get_all_var_data() - var_state = var_data.state if var_data else "" - assert var_state == expect_state + assert Var.create_safe(value)._var_state == expect_state @pytest.mark.parametrize( @@ -1191,21 +1222,25 @@ def test_fstring_roundtrip(value): Args: value: The value to create a Var from. """ - var = ImmutableVar.create_safe(value)._var_set_state("state") - rt_var = LiteralVar.create(f"{var}") + var = BaseVar.create_safe(value)._var_set_state("state") + rt_var = Var.create_safe(f"{var}") assert var._var_state == rt_var._var_state - assert str(rt_var) == str(var) + 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 @pytest.mark.parametrize( "var", [ - 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(), + 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), ], ) def test_unsupported_types_for_reverse(var): @@ -1216,16 +1251,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." + assert err.value.args[0] == f"Cannot reverse non-list var var." @pytest.mark.parametrize( "var", [ - 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(), + 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), ], ) def test_unsupported_types_for_contains(var): @@ -1238,34 +1273,34 @@ def test_unsupported_types_for_contains(var): assert var.contains(1) assert ( err.value.args[0] - == f"Var of type {var._var_type} does not support contains check." + == f"Var var of type {var._var_type} does not support contains check." ) @pytest.mark.parametrize( "other", [ - 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(), + 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), ], ) def test_unsupported_types_for_string_contains(other): with pytest.raises(TypeError) as err: - assert ImmutableVar(_var_name="var").to(str).contains(other) + assert BaseVar(_var_name="var", _var_type=str).contains(other) assert ( err.value.args[0] - == f"Unsupported Operand type(s) for contains: ToStringOperation, {type(other).__name__}" + == f"'in ' requires string as left operand, not {other._var_type}" ) def test_unsupported_default_contains(): with pytest.raises(TypeError) as err: - assert 1 in ImmutableVar(_var_name="var", _var_type=str).guess_type() + assert 1 in BaseVar(_var_name="var", _var_type=str) assert ( err.value.args[0] == "'in' operator not supported for Var types, use Var.contains() instead." @@ -1276,8 +1311,8 @@ def test_unsupported_default_contains(): "operand1_var,operand2_var,operators", [ ( - LiteralVar.create(10), - LiteralVar.create(5), + Var.create(10), + Var.create(5), [ "+", "-", @@ -1295,13 +1330,13 @@ def test_unsupported_default_contains(): ], ), ( - LiteralVar.create(10.5), - LiteralVar.create(5), + Var.create(10.5), + Var.create(5), ["+", "-", "/", "//", "*", "%", "**", ">", "<", "<=", ">="], ), ( - LiteralVar.create(5), - LiteralVar.create(True), + Var.create(5), + Var.create(True), [ "+", "-", @@ -1319,26 +1354,22 @@ def test_unsupported_default_contains(): ], ), ( - LiteralVar.create(10.5), - LiteralVar.create(5.5), + Var.create(10.5), + Var.create(5.5), ["+", "-", "/", "//", "*", "%", "**", ">", "<", "<=", ">="], ), ( - LiteralVar.create(10.5), - LiteralVar.create(True), + Var.create(10.5), + Var.create(True), ["+", "-", "/", "//", "*", "%", "**", ">", "<", "<=", ">="], ), - (LiteralVar.create("10"), LiteralVar.create("5"), ["+", ">", "<", "<=", ">="]), + (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, 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), + Var.create(True), + Var.create(True), [ "+", "-", @@ -1366,28 +1397,16 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s operators: list of supported operators. """ for operator in operators: - 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) + 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", [ ( - LiteralVar.create(10), - LiteralVar.create(5), + Var.create(10), + Var.create(5), [ "^", "<<", @@ -1395,35 +1414,41 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s ], ), ( - LiteralVar.create(10.5), - LiteralVar.create(5), + Var.create(10.5), + Var.create(5), [ + "|", "^", "<<", ">>", + "&", ], ), ( - LiteralVar.create(10.5), - LiteralVar.create(True), + Var.create(10.5), + Var.create(True), [ + "|", "^", "<<", ">>", + "&", ], ), ( - LiteralVar.create(10.5), - LiteralVar.create(5.5), + Var.create(10.5), + Var.create(5.5), [ + "|", "^", "<<", ">>", + "&", ], ), ( - LiteralVar.create("10"), - LiteralVar.create("5"), + Var.create("10"), + Var.create("5"), [ "-", "/", @@ -1431,14 +1456,16 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "*", "%", "**", + "|", "^", "<<", ">>", + "&", ], ), ( - LiteralVar.create([10, 20]), - LiteralVar.create([5, 6]), + Var.create([10, 20]), + Var.create([5, 6]), [ "-", "/", @@ -1446,14 +1473,16 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "*", "%", "**", + "|", "^", "<<", ">>", + "&", ], ), ( - LiteralVar.create([10, 20]), - LiteralVar.create(5), + Var.create([10, 20]), + Var.create(5), [ "+", "-", @@ -1465,14 +1494,16 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", + "|", "^", "<<", ">>", + "&", ], ), ( - LiteralVar.create([10, 20]), - LiteralVar.create(True), + Var.create([10, 20]), + Var.create(True), [ "+", "-", @@ -1484,14 +1515,16 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", + "|", "^", "<<", ">>", + "&", ], ), ( - LiteralVar.create([10, 20]), - LiteralVar.create("5"), + Var.create([10, 20]), + Var.create("5"), [ "+", "-", @@ -1504,14 +1537,16 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", + "|", "^", "<<", ">>", + "&", ], ), ( - LiteralVar.create([10, 20]), - LiteralVar.create({"key": "value"}), + Var.create([10, 20]), + Var.create({"key": "value"}), [ "+", "-", @@ -1524,14 +1559,16 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", + "|", "^", "<<", ">>", + "&", ], ), ( - LiteralVar.create([10, 20]), - LiteralVar.create(5.5), + Var.create([10, 20]), + Var.create(5.5), [ "+", "-", @@ -1544,14 +1581,16 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", + "|", "^", "<<", ">>", + "&", ], ), ( - LiteralVar.create({"key": "value"}), - LiteralVar.create({"another_key": "another_value"}), + Var.create({"key": "value"}), + Var.create({"another_key": "another_value"}), [ "+", "-", @@ -1564,14 +1603,16 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", + "|", "^", "<<", ">>", + "&", ], ), ( - LiteralVar.create({"key": "value"}), - LiteralVar.create(5), + Var.create({"key": "value"}), + Var.create(5), [ "+", "-", @@ -1584,14 +1625,16 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", + "|", "^", "<<", ">>", + "&", ], ), ( - LiteralVar.create({"key": "value"}), - LiteralVar.create(True), + Var.create({"key": "value"}), + Var.create(True), [ "+", "-", @@ -1604,14 +1647,16 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", + "|", "^", "<<", ">>", + "&", ], ), ( - LiteralVar.create({"key": "value"}), - LiteralVar.create(5.5), + Var.create({"key": "value"}), + Var.create(5.5), [ "+", "-", @@ -1624,14 +1669,16 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", + "|", "^", "<<", ">>", + "&", ], ), ( - LiteralVar.create({"key": "value"}), - LiteralVar.create("5"), + Var.create({"key": "value"}), + Var.create("5"), [ "+", "-", @@ -1644,48 +1691,44 @@ 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): - print(eval(f"operand1_var {operator} operand2_var")) - # operand1_var.operation(op=operator, other=operand2_var) + operand1_var.operation(op=operator, other=operand2_var) with pytest.raises(TypeError): - print(eval(f"operand2_var {operator} operand1_var")) - # operand1_var.operation(op=operator, other=operand2_var, flip=True) + operand1_var.operation(op=operator, other=operand2_var, flip=True) @pytest.mark.parametrize( "var, expected", [ - (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("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(ATestState.value), + Var.create(ATestState.value, _var_is_string=True), f"{ATestState.get_full_name()}.value", ), ( LiteralVar.create(f"{ATestState.value} string"), f'({ATestState.get_full_name()}.value+" string")', ), - ( - LiteralVar.create(ATestState.dict_val), - f"{ATestState.get_full_name()}.dict_val", - ), + (Var.create(ATestState.dict_val), f"{ATestState.get_full_name()}.dict_val"), ], ) def test_var_name_unwrapped(var, expected): - assert str(var) == expected + assert var._var_name_unwrapped == expected def cv_fget(state: BaseState) -> int: @@ -1697,11 +1740,11 @@ def cv_fget(state: BaseState) -> int: [ (["a"], {"a"}), (["b"], {"b"}), - ([ImmutableComputedVar(fget=cv_fget)], {"cv_fget"}), + ([ComputedVar(fget=cv_fget)], {"cv_fget"}), ], ) -def test_computed_var_deps(deps: List[Union[str, ImmutableVar]], expected: Set[str]): - @immutable_computed_var( +def test_computed_var_deps(deps: List[Union[str, Var]], expected: Set[str]): + @computed_var( deps=deps, cache=True, ) @@ -1722,7 +1765,7 @@ def test_var(state) -> int: def test_invalid_computed_var_deps(deps: List): with pytest.raises(TypeError): - @immutable_computed_var( + @computed_var( deps=deps, cache=True, ) diff --git a/tests/utils/test_format.py b/tests/utils/test_format.py index 8c559f141dc..4623f0fb287 100644 --- a/tests/utils/test_format.py +++ b/tests/utils/test_format.py @@ -9,11 +9,10 @@ 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 Var +from reflex.vars import BaseVar, Var from tests.test_state import ( ChildState, ChildState2, @@ -274,16 +273,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 str(input) == output + assert format.format_var(input) == output @pytest.mark.parametrize( @@ -314,6 +313,110 @@ 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", [ @@ -337,10 +440,7 @@ def test_format_route(route: str, format_case: bool, expected: bool): ], ) def test_format_match( - condition: str, - match_cases: List[List[ImmutableVar]], - default: ImmutableVar, - expected: str, + condition: str, match_cases: List[BaseVar], default: BaseVar, expected: str ): """Test formatting a match statement. @@ -364,14 +464,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": ImmutableVar(_var_name="val", _var_type=str).guess_type(), + "b": BaseVar(_var_name="val", _var_type="str"), }, - r'{({ ["a"] : "foo \"{ \"bar\" }\" baz", ["b"] : val })}', + r'{{"a": "foo \"{ \"bar\" }\" baz", "b": val}}', ), ( EventChain( @@ -387,19 +487,18 @@ def test_format_match( handler=EventHandler(fn=mock_event), args=( ( - LiteralVar.create("arg"), - ImmutableVar( + Var.create_safe("arg"), + BaseVar( _var_name="_e", - ) - .to(ObjectVar, FrontendEvent) - .target.value, + _var_type=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( @@ -417,47 +516,37 @@ def test_format_match( ), '{(...args) => addEvents([Event("mock_event", {})], args, {"preventDefault": true})}', ), - ({"a": "red", "b": "blue"}, '{({ ["a"] : "red", ["b"] : "blue" })}'), - (ImmutableVar(_var_name="var", _var_type=int).guess_type(), "var"), + ({"a": "red", "b": "blue"}, '{{"a": "red", "b": "blue"}}'), + (BaseVar(_var_name="var", _var_type="int"), "{var}"), ( - ImmutableVar( + BaseVar( _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"]', + "{_}", ), ( - {"a": ImmutableVar(_var_name="val", _var_type=str).guess_type()}, - '{({ ["a"] : val })}', + BaseVar(_var_name='state.colors["a"]', _var_type="str"), + '{state.colors["a"]}', ), + ({"a": BaseVar(_var_name="val", _var_type="str")}, '{{"a": val}}'), + ({"a": BaseVar(_var_name='"val"', _var_type="str")}, '{{"a": "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"] })}', + {"a": BaseVar(_var_name='state.colors["val"]', _var_type="str")}, + '{{"a": state.colors["val"]}}', ), # tricky real-world case from markdown component ( { - "h1": ImmutableVar.create_safe( - f"(({{node, ...props}}) => )" - ) + "h1": f"{{({{node, ...props}}) => }}" }, - '{({ ["h1"] : (({node, ...props}) => ) })}', + '{{"h1": ({node, ...props}) => }}', ), ], ) -def test_format_prop(prop: ImmutableVar, formatted: str): +def test_format_prop(prop: Var, formatted: str): """Test that the formatted value of an prop is correct. Args: @@ -471,7 +560,7 @@ def test_format_prop(prop: ImmutableVar, formatted: str): "single_props,key_value_props,output", [ ( - [ImmutableVar.create_safe("{...props}")], + [ImmutableVar.create_safe("...props")], {"key": 42}, ["key={42}", "{...props}"], ), @@ -522,17 +611,43 @@ 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", [ ( - EventSpec(handler=EventHandler(fn=mock_event)), - '(Event("mock_event", ({ })))', + 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", {})])', ), ], ) -def test_format_event(input, output): - assert str(LiteralVar.create(input)) == output +def test_format_event_chain(input, output): + assert format.format_event_chain(input) == output @pytest.mark.parametrize( @@ -656,14 +771,29 @@ def test_format_ref(input, output): "input,output", [ (("my_array", None), "refs_my_array"), - (("my_array", LiteralVar.create(0)), "refs_my_array[0]"), - (("my_array", LiteralVar.create(1)), "refs_my_array[1]"), + (("my_array", Var.create(0)), "refs_my_array[0]"), + (("my_array", Var.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 7f5c2bc66eb..b516f5eb38a 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, Type +from typing import Any, Dict, List, 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,10 +29,20 @@ 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), ], ) @@ -130,41 +140,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, LiteralVar.create("hi"), ImmutableVar.create("bye")], + [1, Var.create_safe("hi"), Var.create_safe("bye", _var_is_local=False)], '[1, "hi", bye]', ), ( - (1, LiteralVar.create("hi"), ImmutableVar.create("bye")), + (1, Var.create_safe("hi"), Var.create_safe("bye", _var_is_local=False)), '[1, "hi", bye]', ), - ({1: 2, 3: 4}, "({ [1] : 2, [3] : 4 })"), + ({1: 2, 3: 4}, '{"1": 2, "3": 4}'), ( - {1: LiteralVar.create("hi"), 3: ImmutableVar.create("bye")}, - '({ [1] : "hi", [3] : bye })', + {1: Var.create_safe("hi"), 3: Var.create_safe("bye", _var_is_local=False)}, + '{"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"), @@ -193,28 +203,24 @@ 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): @@ -225,5 +231,6 @@ 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 = LiteralVar.create(value) - assert str(v) == expected + v = Var.create_safe(value) + assert v._var_full_name == expected + assert v._var_is_string == exp_var_is_string diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py index 654bd4c9023..e905ff58710 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.exceptions import ReflexError +from reflex.utils.serializers import serialize from reflex.vars import Var @@ -538,15 +538,11 @@ 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(ReflexError): - rx.box( - style=style, # type: ignore - ) + with pytest.raises(TypeError): + serialize(style) # type: ignore