Compare commits
27 Commits
main
...
reflex-0.6
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2b17a320d4 | ||
![]() |
4a3344ed52 | ||
![]() |
af9c8c3ad0 | ||
![]() |
1bb3e6f38c | ||
![]() |
18576dc904 | ||
![]() |
73f3454b43 | ||
![]() |
dfad519bae | ||
![]() |
41c995322b | ||
![]() |
5fcaa2a3b7 | ||
![]() |
056a33c913 | ||
![]() |
958031852c | ||
![]() |
6aada921b8 | ||
![]() |
58a4778891 | ||
![]() |
12982f5665 | ||
![]() |
ddb189aee4 | ||
![]() |
6ae66987b6 | ||
![]() |
45f5326bdd | ||
![]() |
af56972b4d | ||
![]() |
67a7c10eab | ||
![]() |
c67dffd2a3 | ||
![]() |
dba051e8ca | ||
![]() |
6e1550b89f | ||
![]() |
9497a89704 | ||
![]() |
cd49e82a6f | ||
![]() |
eeeb1180a2 | ||
![]() |
3a8e0cabb7 | ||
![]() |
100acfe0df |
8
.github/workflows/benchmarks.yml
vendored
8
.github/workflows/benchmarks.yml
vendored
@ -81,17 +81,13 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
# Show OS combos first in GUI
|
# Show OS combos first in GUI
|
||||||
os: [ubuntu-latest, windows-latest, macos-12]
|
os: [ubuntu-latest, windows-latest, macos-12]
|
||||||
python-version: ['3.8.18', '3.9.18', '3.10.13', '3.11.5', '3.12.0']
|
python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0']
|
||||||
exclude:
|
exclude:
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: '3.10.13'
|
python-version: '3.10.13'
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: '3.9.18'
|
python-version: '3.9.18'
|
||||||
- os: windows-latest
|
|
||||||
python-version: '3.8.18'
|
|
||||||
# keep only one python version for MacOS
|
# keep only one python version for MacOS
|
||||||
- os: macos-latest
|
|
||||||
python-version: '3.8.18'
|
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
python-version: '3.9.18'
|
python-version: '3.9.18'
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
@ -103,8 +99,6 @@ jobs:
|
|||||||
python-version: '3.10.11'
|
python-version: '3.10.11'
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: '3.9.13'
|
python-version: '3.9.13'
|
||||||
- os: windows-latest
|
|
||||||
python-version: '3.8.10'
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
|
@ -23,7 +23,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
state_manager: ['redis', 'memory']
|
state_manager: ['redis', 'memory']
|
||||||
python-version: ['3.8.18', '3.11.5', '3.12.0']
|
python-version: ['3.11.5', '3.12.0']
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
# Label used to access the service container
|
# Label used to access the service container
|
||||||
|
6
.github/workflows/integration_tests.yml
vendored
6
.github/workflows/integration_tests.yml
vendored
@ -43,21 +43,17 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
# Show OS combos first in GUI
|
# Show OS combos first in GUI
|
||||||
os: [ubuntu-latest, windows-latest, macos-12]
|
os: [ubuntu-latest, windows-latest, macos-12]
|
||||||
python-version: ['3.8.18', '3.9.18', '3.10.13', '3.11.5', '3.12.0']
|
python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0']
|
||||||
exclude:
|
exclude:
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: '3.10.13'
|
python-version: '3.10.13'
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: '3.9.18'
|
python-version: '3.9.18'
|
||||||
- os: windows-latest
|
|
||||||
python-version: '3.8.18'
|
|
||||||
include:
|
include:
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: '3.10.11'
|
python-version: '3.10.11'
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: '3.9.13'
|
python-version: '3.9.13'
|
||||||
- os: windows-latest
|
|
||||||
python-version: '3.8.10'
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
|
2
.github/workflows/integration_tests_wsl.yml
vendored
2
.github/workflows/integration_tests_wsl.yml
vendored
@ -37,6 +37,8 @@ jobs:
|
|||||||
path: reflex-examples
|
path: reflex-examples
|
||||||
|
|
||||||
- uses: Vampire/setup-wsl@v3
|
- uses: Vampire/setup-wsl@v3
|
||||||
|
with:
|
||||||
|
distribution: Ubuntu-24.04
|
||||||
|
|
||||||
- name: Install Python
|
- name: Install Python
|
||||||
shell: wsl-bash {0}
|
shell: wsl-bash {0}
|
||||||
|
6
.github/workflows/unit_tests.yml
vendored
6
.github/workflows/unit_tests.yml
vendored
@ -28,22 +28,18 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest, macos-12]
|
os: [ubuntu-latest, windows-latest, macos-12]
|
||||||
python-version: ['3.8.18', '3.9.18', '3.10.13', '3.11.5', '3.12.0']
|
python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0']
|
||||||
# Windows is a bit behind on Python version availability in Github
|
# Windows is a bit behind on Python version availability in Github
|
||||||
exclude:
|
exclude:
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: '3.10.13'
|
python-version: '3.10.13'
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: '3.9.18'
|
python-version: '3.9.18'
|
||||||
- os: windows-latest
|
|
||||||
python-version: '3.8.18'
|
|
||||||
include:
|
include:
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: '3.10.11'
|
python-version: '3.10.11'
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: '3.9.13'
|
python-version: '3.9.13'
|
||||||
- os: windows-latest
|
|
||||||
python-version: '3.8.10'
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
# Service containers to run with `runner-job`
|
# Service containers to run with `runner-job`
|
||||||
services:
|
services:
|
||||||
|
@ -8,7 +8,7 @@ Here is a quick guide on how to run Reflex repo locally so you can start contrib
|
|||||||
|
|
||||||
**Prerequisites:**
|
**Prerequisites:**
|
||||||
|
|
||||||
- Python >= 3.8
|
- Python >= 3.9
|
||||||
- Poetry version >= 1.4.0 and add it to your path (see [Poetry Docs](https://python-poetry.org/docs/#installation) for more info).
|
- Poetry version >= 1.4.0 and add it to your path (see [Poetry Docs](https://python-poetry.org/docs/#installation) for more info).
|
||||||
|
|
||||||
**1. Fork this repository:**
|
**1. Fork this repository:**
|
||||||
@ -87,7 +87,7 @@ poetry run ruff format .
|
|||||||
```
|
```
|
||||||
|
|
||||||
Consider installing git pre-commit hooks so Ruff, Pyright, Darglint and `make_pyi` will run automatically before each commit.
|
Consider installing git pre-commit hooks so Ruff, Pyright, Darglint and `make_pyi` will run automatically before each commit.
|
||||||
Note that pre-commit will only be installed when you use a Python version >= 3.8.
|
Note that pre-commit will only be installed when you use a Python version >= 3.9.
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
pre-commit install
|
pre-commit install
|
||||||
|
@ -35,7 +35,7 @@ See our [architecture page](https://reflex.dev/blog/2024-03-21-reflex-architectu
|
|||||||
|
|
||||||
## ⚙️ Installation
|
## ⚙️ Installation
|
||||||
|
|
||||||
Open a terminal and run (Requires Python 3.8+):
|
Open a terminal and run (Requires Python 3.9+):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -130,7 +130,6 @@ def render_multiple_pages(app, num: int):
|
|||||||
|
|
||||||
def AppWithOnePage():
|
def AppWithOnePage():
|
||||||
"""A reflex app with one page."""
|
"""A reflex app with one page."""
|
||||||
import reflex_chakra as rc
|
|
||||||
from rxconfig import config # type: ignore
|
from rxconfig import config # type: ignore
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
@ -145,7 +144,7 @@ def AppWithOnePage():
|
|||||||
|
|
||||||
def index() -> rx.Component:
|
def index() -> rx.Component:
|
||||||
return rx.center(
|
return rx.center(
|
||||||
rc.input(
|
rx.input(
|
||||||
id="token", value=State.router.session.client_token, is_read_only=True
|
id="token", value=State.router.session.client_token, is_read_only=True
|
||||||
),
|
),
|
||||||
rx.vstack(
|
rx.vstack(
|
||||||
|
@ -35,7 +35,7 @@ Auf unserer [Architektur-Seite](https://reflex.dev/blog/2024-03-21-reflex-archit
|
|||||||
|
|
||||||
## ⚙️ Installation
|
## ⚙️ Installation
|
||||||
|
|
||||||
Öffne ein Terminal und führe den folgenden Befehl aus (benötigt Python 3.8+):
|
Öffne ein Terminal und führe den folgenden Befehl aus (benötigt Python 3.9+):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -35,7 +35,7 @@ Consulta nuestra [página de arquitectura](https://reflex.dev/blog/2024-03-21-re
|
|||||||
|
|
||||||
## ⚙️ Instalación
|
## ⚙️ Instalación
|
||||||
|
|
||||||
Abra un terminal y ejecute (Requiere Python 3.8+):
|
Abra un terminal y ejecute (Requiere Python 3.9+):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -36,7 +36,7 @@ Reflex के अंदर के कामकाज को जानने क
|
|||||||
|
|
||||||
## ⚙️ इंस्टॉलेशन (Installation)
|
## ⚙️ इंस्टॉलेशन (Installation)
|
||||||
|
|
||||||
एक टर्मिनल खोलें और चलाएं (Python 3.8+ की आवश्यकता है):
|
एक टर्मिनल खोलें और चलाएं (Python 3.9+ की आवश्यकता है):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
## ⚙️ Installazione
|
## ⚙️ Installazione
|
||||||
|
|
||||||
Apri un terminale ed esegui (Richiede Python 3.8+):
|
Apri un terminale ed esegui (Richiede Python 3.9+):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -38,7 +38,7 @@ Reflex がどのように動作しているかを知るには、[アーキテク
|
|||||||
|
|
||||||
## ⚙️ インストール
|
## ⚙️ インストール
|
||||||
|
|
||||||
ターミナルを開いて以下のコマンドを実行してください。(Python 3.8 以上が必要です。):
|
ターミナルを開いて以下のコマンドを実行してください。(Python 3.9 以上が必要です。):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
---
|
---
|
||||||
## ⚙️ 설치
|
## ⚙️ 설치
|
||||||
|
|
||||||
터미널을 열고 실행하세요. (Python 3.8+ 필요):
|
터미널을 열고 실행하세요. (Python 3.9+ 필요):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
## ⚙️ Installation - نصب و راه اندازی
|
## ⚙️ Installation - نصب و راه اندازی
|
||||||
|
|
||||||
یک ترمینال را باز کنید و اجرا کنید (نیازمند Python 3.8+):
|
یک ترمینال را باز کنید و اجرا کنید (نیازمند Python 3.9+):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
---
|
---
|
||||||
## ⚙️ Instalação
|
## ⚙️ Instalação
|
||||||
|
|
||||||
Abra um terminal e execute (Requer Python 3.8+):
|
Abra um terminal e execute (Requer Python 3.9+):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
## ⚙️ Kurulum
|
## ⚙️ Kurulum
|
||||||
|
|
||||||
Bir terminal açın ve çalıştırın (Python 3.8+ gerekir):
|
Bir terminal açın ve çalıştırın (Python 3.9+ gerekir):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -35,7 +35,7 @@ Reflex 是一个使用纯Python构建全栈web应用的库。
|
|||||||
|
|
||||||
## ⚙️ 安装
|
## ⚙️ 安装
|
||||||
|
|
||||||
打开一个终端并且运行(要求Python3.8+):
|
打开一个终端并且运行(要求Python3.9+):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -37,7 +37,7 @@ Reflex 是一個可以用純 Python 構建全端網頁應用程式的函式庫
|
|||||||
|
|
||||||
## ⚙️ 安裝
|
## ⚙️ 安裝
|
||||||
|
|
||||||
開啟一個終端機並且執行 (需要 Python 3.8+):
|
開啟一個終端機並且執行 (需要 Python 3.9+):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM python:3.8
|
FROM python:3.9
|
||||||
|
|
||||||
ARG USERNAME=kerrigan
|
ARG USERNAME=kerrigan
|
||||||
RUN useradd -m $USERNAME
|
RUN useradd -m $USERNAME
|
||||||
|
@ -13,7 +13,6 @@ def BackgroundTask():
|
|||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import reflex_chakra as rc
|
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
from reflex.state import ImmutableStateError
|
from reflex.state import ImmutableStateError
|
||||||
@ -116,11 +115,11 @@ def BackgroundTask():
|
|||||||
|
|
||||||
def index() -> rx.Component:
|
def index() -> rx.Component:
|
||||||
return rx.vstack(
|
return rx.vstack(
|
||||||
rc.input(
|
rx.input(
|
||||||
id="token", value=State.router.session.client_token, is_read_only=True
|
id="token", value=State.router.session.client_token, is_read_only=True
|
||||||
),
|
),
|
||||||
rx.heading(State.counter, id="counter"),
|
rx.heading(State.counter, id="counter"),
|
||||||
rc.input(
|
rx.input(
|
||||||
id="iterations",
|
id="iterations",
|
||||||
placeholder="Iterations",
|
placeholder="Iterations",
|
||||||
value=State.iterations.to_string(), # type: ignore
|
value=State.iterations.to_string(), # type: ignore
|
||||||
|
@ -17,8 +17,6 @@ from . import utils
|
|||||||
|
|
||||||
def ClientSide():
|
def ClientSide():
|
||||||
"""App for testing client-side state."""
|
"""App for testing client-side state."""
|
||||||
import reflex_chakra as rc
|
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
class ClientSideState(rx.State):
|
class ClientSideState(rx.State):
|
||||||
@ -72,18 +70,18 @@ def ClientSide():
|
|||||||
|
|
||||||
def index():
|
def index():
|
||||||
return rx.fragment(
|
return rx.fragment(
|
||||||
rc.input(
|
rx.input(
|
||||||
value=ClientSideState.router.session.client_token,
|
value=ClientSideState.router.session.client_token,
|
||||||
is_read_only=True,
|
is_read_only=True,
|
||||||
id="token",
|
id="token",
|
||||||
),
|
),
|
||||||
rc.input(
|
rx.input(
|
||||||
placeholder="state var",
|
placeholder="state var",
|
||||||
value=ClientSideState.state_var,
|
value=ClientSideState.state_var,
|
||||||
on_change=ClientSideState.set_state_var, # type: ignore
|
on_change=ClientSideState.set_state_var, # type: ignore
|
||||||
id="state_var",
|
id="state_var",
|
||||||
),
|
),
|
||||||
rc.input(
|
rx.input(
|
||||||
placeholder="input value",
|
placeholder="input value",
|
||||||
value=ClientSideState.input_value,
|
value=ClientSideState.input_value,
|
||||||
on_change=ClientSideState.set_input_value, # type: ignore
|
on_change=ClientSideState.set_input_value, # type: ignore
|
||||||
@ -313,7 +311,6 @@ async def test_client_side_state(
|
|||||||
# no cookies should be set yet!
|
# no cookies should be set yet!
|
||||||
assert not driver.get_cookies()
|
assert not driver.get_cookies()
|
||||||
local_storage_items = local_storage.items()
|
local_storage_items = local_storage.items()
|
||||||
local_storage_items.pop("chakra-ui-color-mode", None)
|
|
||||||
local_storage_items.pop("last_compiled_time", None)
|
local_storage_items.pop("last_compiled_time", None)
|
||||||
assert not local_storage_items
|
assert not local_storage_items
|
||||||
|
|
||||||
@ -429,7 +426,6 @@ async def test_client_side_state(
|
|||||||
assert f"{sub_state_name}.c3" not in cookie_info_map(driver)
|
assert f"{sub_state_name}.c3" not in cookie_info_map(driver)
|
||||||
|
|
||||||
local_storage_items = local_storage.items()
|
local_storage_items = local_storage.items()
|
||||||
local_storage_items.pop("chakra-ui-color-mode", None)
|
|
||||||
local_storage_items.pop("last_compiled_time", None)
|
local_storage_items.pop("last_compiled_time", None)
|
||||||
assert local_storage_items.pop(f"{sub_state_name}.l1") == "l1 value"
|
assert local_storage_items.pop(f"{sub_state_name}.l1") == "l1 value"
|
||||||
assert local_storage_items.pop(f"{sub_state_name}.l2") == "l2 value"
|
assert local_storage_items.pop(f"{sub_state_name}.l2") == "l2 value"
|
||||||
|
@ -17,8 +17,6 @@ def DynamicRoute():
|
|||||||
"""App for testing dynamic routes."""
|
"""App for testing dynamic routes."""
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
import reflex_chakra as rc
|
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
class DynamicState(rx.State):
|
class DynamicState(rx.State):
|
||||||
@ -41,13 +39,13 @@ def DynamicRoute():
|
|||||||
|
|
||||||
def index():
|
def index():
|
||||||
return rx.fragment(
|
return rx.fragment(
|
||||||
rc.input(
|
rx.input(
|
||||||
value=DynamicState.router.session.client_token,
|
value=DynamicState.router.session.client_token,
|
||||||
is_read_only=True,
|
is_read_only=True,
|
||||||
id="token",
|
id="token",
|
||||||
),
|
),
|
||||||
rc.input(value=rx.State.page_id, is_read_only=True, id="page_id"), # type: ignore
|
rx.input(value=rx.State.page_id, is_read_only=True, id="page_id"), # type: ignore
|
||||||
rc.input(
|
rx.input(
|
||||||
value=DynamicState.router.page.raw_path,
|
value=DynamicState.router.page.raw_path,
|
||||||
is_read_only=True,
|
is_read_only=True,
|
||||||
id="raw_path",
|
id="raw_path",
|
||||||
@ -60,14 +58,72 @@ def DynamicRoute():
|
|||||||
id="link_page_next", # type: ignore
|
id="link_page_next", # type: ignore
|
||||||
),
|
),
|
||||||
rx.link("missing", href="/missing", id="link_missing"),
|
rx.link("missing", href="/missing", id="link_missing"),
|
||||||
rc.list(
|
rx.list( # type: ignore
|
||||||
rx.foreach(
|
rx.foreach(
|
||||||
DynamicState.order, # type: ignore
|
DynamicState.order, # type: ignore
|
||||||
lambda i: rc.list_item(rx.text(i)),
|
lambda i: rx.list_item(rx.text(i)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class ArgState(rx.State):
|
||||||
|
"""The app state."""
|
||||||
|
|
||||||
|
@rx.var
|
||||||
|
def arg(self) -> int:
|
||||||
|
return int(self.arg_str or 0)
|
||||||
|
|
||||||
|
class ArgSubState(ArgState):
|
||||||
|
@rx.var(cache=True)
|
||||||
|
def cached_arg(self) -> int:
|
||||||
|
return self.arg
|
||||||
|
|
||||||
|
@rx.var(cache=True)
|
||||||
|
def cached_arg_str(self) -> str:
|
||||||
|
return self.arg_str
|
||||||
|
|
||||||
|
@rx.page(route="/arg/[arg_str]")
|
||||||
|
def arg() -> rx.Component:
|
||||||
|
return rx.vstack(
|
||||||
|
rx.data_list.root(
|
||||||
|
rx.data_list.item(
|
||||||
|
rx.data_list.label("rx.State.arg_str (dynamic)"),
|
||||||
|
rx.data_list.value(rx.State.arg_str, id="state-arg_str"), # type: ignore
|
||||||
|
),
|
||||||
|
rx.data_list.item(
|
||||||
|
rx.data_list.label("ArgState.arg_str (dynamic) (inherited)"),
|
||||||
|
rx.data_list.value(ArgState.arg_str, id="argstate-arg_str"), # type: ignore
|
||||||
|
),
|
||||||
|
rx.data_list.item(
|
||||||
|
rx.data_list.label("ArgState.arg"),
|
||||||
|
rx.data_list.value(ArgState.arg, id="argstate-arg"),
|
||||||
|
),
|
||||||
|
rx.data_list.item(
|
||||||
|
rx.data_list.label("ArgSubState.arg_str (dynamic) (inherited)"),
|
||||||
|
rx.data_list.value(ArgSubState.arg_str, id="argsubstate-arg_str"), # type: ignore
|
||||||
|
),
|
||||||
|
rx.data_list.item(
|
||||||
|
rx.data_list.label("ArgSubState.arg (inherited)"),
|
||||||
|
rx.data_list.value(ArgSubState.arg, id="argsubstate-arg"),
|
||||||
|
),
|
||||||
|
rx.data_list.item(
|
||||||
|
rx.data_list.label("ArgSubState.cached_arg"),
|
||||||
|
rx.data_list.value(
|
||||||
|
ArgSubState.cached_arg, id="argsubstate-cached_arg"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
rx.data_list.item(
|
||||||
|
rx.data_list.label("ArgSubState.cached_arg_str"),
|
||||||
|
rx.data_list.value(
|
||||||
|
ArgSubState.cached_arg_str, id="argsubstate-cached_arg_str"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
rx.link("+", href=f"/arg/{ArgState.arg + 1}", id="next-page"),
|
||||||
|
align="center",
|
||||||
|
height="100vh",
|
||||||
|
)
|
||||||
|
|
||||||
@rx.page(route="/redirect-page/[page_id]", on_load=DynamicState.on_load_redir) # type: ignore
|
@rx.page(route="/redirect-page/[page_id]", on_load=DynamicState.on_load_redir) # type: ignore
|
||||||
def redirect_page():
|
def redirect_page():
|
||||||
return rx.fragment(rx.text("redirecting..."))
|
return rx.fragment(rx.text("redirecting..."))
|
||||||
@ -304,3 +360,50 @@ async def test_on_load_navigate_non_dynamic(
|
|||||||
link.click()
|
link.click()
|
||||||
assert urlsplit(driver.current_url).path == "/static/x/"
|
assert urlsplit(driver.current_url).path == "/static/x/"
|
||||||
await poll_for_order(["/static/x-no page id", "/static/x-no page id"])
|
await poll_for_order(["/static/x-no page id", "/static/x-no page id"])
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
async def test_render_dynamic_arg(
|
||||||
|
dynamic_route: AppHarness,
|
||||||
|
driver: WebDriver,
|
||||||
|
):
|
||||||
|
"""Assert that dynamic arg var is rendered correctly in different contexts.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
dynamic_route: harness for DynamicRoute app.
|
||||||
|
driver: WebDriver instance.
|
||||||
|
"""
|
||||||
|
assert dynamic_route.app_instance is not None
|
||||||
|
with poll_for_navigation(driver):
|
||||||
|
driver.get(f"{dynamic_route.frontend_url}/arg/0")
|
||||||
|
|
||||||
|
def assert_content(expected: str, expect_not: str):
|
||||||
|
ids = [
|
||||||
|
"state-arg_str",
|
||||||
|
"argstate-arg",
|
||||||
|
"argstate-arg_str",
|
||||||
|
"argsubstate-arg_str",
|
||||||
|
"argsubstate-arg",
|
||||||
|
"argsubstate-cached_arg",
|
||||||
|
"argsubstate-cached_arg_str",
|
||||||
|
]
|
||||||
|
for id in ids:
|
||||||
|
el = driver.find_element(By.ID, id)
|
||||||
|
assert el
|
||||||
|
assert (
|
||||||
|
dynamic_route.poll_for_content(el, exp_not_equal=expect_not) == expected
|
||||||
|
)
|
||||||
|
|
||||||
|
assert_content("0", "")
|
||||||
|
next_page_link = driver.find_element(By.ID, "next-page")
|
||||||
|
assert next_page_link
|
||||||
|
with poll_for_navigation(driver):
|
||||||
|
next_page_link.click()
|
||||||
|
assert driver.current_url == f"{dynamic_route.frontend_url}/arg/1/"
|
||||||
|
assert_content("1", "0")
|
||||||
|
next_page_link = driver.find_element(By.ID, "next-page")
|
||||||
|
assert next_page_link
|
||||||
|
with poll_for_navigation(driver):
|
||||||
|
next_page_link.click()
|
||||||
|
assert driver.current_url == f"{dynamic_route.frontend_url}/arg/2/"
|
||||||
|
assert_content("2", "1")
|
||||||
|
@ -16,8 +16,6 @@ def TestEventAction():
|
|||||||
"""App for testing event_actions."""
|
"""App for testing event_actions."""
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
import reflex_chakra as rc
|
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
class EventActionState(rx.State):
|
class EventActionState(rx.State):
|
||||||
@ -55,7 +53,7 @@ def TestEventAction():
|
|||||||
|
|
||||||
def index():
|
def index():
|
||||||
return rx.vstack(
|
return rx.vstack(
|
||||||
rc.input(
|
rx.input(
|
||||||
value=EventActionState.router.session.client_token,
|
value=EventActionState.router.session.client_token,
|
||||||
is_read_only=True,
|
is_read_only=True,
|
||||||
id="token",
|
id="token",
|
||||||
@ -148,10 +146,10 @@ def TestEventAction():
|
|||||||
200
|
200
|
||||||
).stop_propagation,
|
).stop_propagation,
|
||||||
),
|
),
|
||||||
rc.list(
|
rx.list( # type: ignore
|
||||||
rx.foreach(
|
rx.foreach(
|
||||||
EventActionState.order, # type: ignore
|
EventActionState.order, # type: ignore
|
||||||
rc.list_item,
|
rx.list_item,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
on_click=EventActionState.on_click("outer"), # type: ignore
|
on_click=EventActionState.on_click("outer"), # type: ignore
|
||||||
|
@ -18,8 +18,6 @@ def EventChain():
|
|||||||
import time
|
import time
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
import reflex_chakra as rc
|
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
# repeated here since the outer global isn't exported into the App module
|
# repeated here since the outer global isn't exported into the App module
|
||||||
@ -129,7 +127,7 @@ def EventChain():
|
|||||||
|
|
||||||
app = rx.App(state=rx.State)
|
app = rx.App(state=rx.State)
|
||||||
|
|
||||||
token_input = rc.input(
|
token_input = rx.input(
|
||||||
value=State.router.session.client_token, is_read_only=True, id="token"
|
value=State.router.session.client_token, is_read_only=True, id="token"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -137,7 +135,7 @@ def EventChain():
|
|||||||
def index():
|
def index():
|
||||||
return rx.fragment(
|
return rx.fragment(
|
||||||
token_input,
|
token_input,
|
||||||
rc.input(value=State.interim_value, is_read_only=True, id="interim_value"),
|
rx.input(value=State.interim_value, is_read_only=True, id="interim_value"),
|
||||||
rx.button(
|
rx.button(
|
||||||
"Return Event",
|
"Return Event",
|
||||||
id="return_event",
|
id="return_event",
|
||||||
|
@ -20,8 +20,6 @@ def FormSubmit(form_component):
|
|||||||
"""
|
"""
|
||||||
from typing import Dict, List
|
from typing import Dict, List
|
||||||
|
|
||||||
import reflex_chakra as rc
|
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
class FormState(rx.State):
|
class FormState(rx.State):
|
||||||
@ -37,28 +35,29 @@ def FormSubmit(form_component):
|
|||||||
@app.add_page
|
@app.add_page
|
||||||
def index():
|
def index():
|
||||||
return rx.vstack(
|
return rx.vstack(
|
||||||
rc.input(
|
rx.input(
|
||||||
value=FormState.router.session.client_token,
|
value=FormState.router.session.client_token,
|
||||||
is_read_only=True,
|
is_read_only=True,
|
||||||
id="token",
|
id="token",
|
||||||
),
|
),
|
||||||
eval(form_component)(
|
eval(form_component)(
|
||||||
rx.vstack(
|
rx.vstack(
|
||||||
rc.input(id="name_input"),
|
rx.input(id="name_input"),
|
||||||
rx.hstack(rc.pin_input(length=4, id="pin_input")),
|
|
||||||
rc.number_input(id="number_input"),
|
|
||||||
rx.checkbox(id="bool_input"),
|
rx.checkbox(id="bool_input"),
|
||||||
rx.switch(id="bool_input2"),
|
rx.switch(id="bool_input2"),
|
||||||
rx.checkbox(id="bool_input3"),
|
rx.checkbox(id="bool_input3"),
|
||||||
rx.switch(id="bool_input4"),
|
rx.switch(id="bool_input4"),
|
||||||
rx.slider(id="slider_input", default_value=[50], width="100%"),
|
rx.slider(id="slider_input", default_value=[50], width="100%"),
|
||||||
rc.range_slider(id="range_input"),
|
|
||||||
rx.radio(["option1", "option2"], id="radio_input"),
|
rx.radio(["option1", "option2"], id="radio_input"),
|
||||||
rx.radio(FormState.var_options, id="radio_input_var"),
|
rx.radio(FormState.var_options, id="radio_input_var"),
|
||||||
rc.select(["option1", "option2"], id="select_input"),
|
rx.select(
|
||||||
rc.select(FormState.var_options, id="select_input_var"),
|
["option1", "option2"],
|
||||||
|
name="select_input",
|
||||||
|
default_value="option1",
|
||||||
|
),
|
||||||
|
rx.select(FormState.var_options, id="select_input_var"),
|
||||||
rx.text_area(id="text_area_input"),
|
rx.text_area(id="text_area_input"),
|
||||||
rc.input(
|
rx.input(
|
||||||
id="debounce_input",
|
id="debounce_input",
|
||||||
debounce_timeout=0,
|
debounce_timeout=0,
|
||||||
on_change=rx.console_log,
|
on_change=rx.console_log,
|
||||||
@ -81,8 +80,6 @@ def FormSubmitName(form_component):
|
|||||||
"""
|
"""
|
||||||
from typing import Dict, List
|
from typing import Dict, List
|
||||||
|
|
||||||
import reflex_chakra as rc
|
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
class FormState(rx.State):
|
class FormState(rx.State):
|
||||||
@ -98,22 +95,19 @@ def FormSubmitName(form_component):
|
|||||||
@app.add_page
|
@app.add_page
|
||||||
def index():
|
def index():
|
||||||
return rx.vstack(
|
return rx.vstack(
|
||||||
rc.input(
|
rx.input(
|
||||||
value=FormState.router.session.client_token,
|
value=FormState.router.session.client_token,
|
||||||
is_read_only=True,
|
is_read_only=True,
|
||||||
id="token",
|
id="token",
|
||||||
),
|
),
|
||||||
eval(form_component)(
|
eval(form_component)(
|
||||||
rx.vstack(
|
rx.vstack(
|
||||||
rc.input(name="name_input"),
|
rx.input(name="name_input"),
|
||||||
rx.hstack(rc.pin_input(length=4, name="pin_input")),
|
|
||||||
rc.number_input(name="number_input"),
|
|
||||||
rx.checkbox(name="bool_input"),
|
rx.checkbox(name="bool_input"),
|
||||||
rx.switch(name="bool_input2"),
|
rx.switch(name="bool_input2"),
|
||||||
rx.checkbox(name="bool_input3"),
|
rx.checkbox(name="bool_input3"),
|
||||||
rx.switch(name="bool_input4"),
|
rx.switch(name="bool_input4"),
|
||||||
rx.slider(name="slider_input", default_value=[50], width="100%"),
|
rx.slider(name="slider_input", default_value=[50], width="100%"),
|
||||||
rc.range_slider(name="range_input"),
|
|
||||||
rx.radio(FormState.options, name="radio_input"),
|
rx.radio(FormState.options, name="radio_input"),
|
||||||
rx.select(
|
rx.select(
|
||||||
FormState.options,
|
FormState.options,
|
||||||
@ -121,21 +115,13 @@ def FormSubmitName(form_component):
|
|||||||
default_value=FormState.options[0],
|
default_value=FormState.options[0],
|
||||||
),
|
),
|
||||||
rx.text_area(name="text_area_input"),
|
rx.text_area(name="text_area_input"),
|
||||||
rc.input_group(
|
rx.input(
|
||||||
rc.input_left_element(rx.icon(tag="chevron_right")),
|
|
||||||
rc.input(
|
|
||||||
name="debounce_input",
|
name="debounce_input",
|
||||||
debounce_timeout=0,
|
debounce_timeout=0,
|
||||||
on_change=rx.console_log,
|
on_change=rx.console_log,
|
||||||
),
|
),
|
||||||
rc.input_right_element(rx.icon(tag="chevron_left")),
|
|
||||||
),
|
|
||||||
rc.button_group(
|
|
||||||
rx.button("Submit", type_="submit"),
|
rx.button("Submit", type_="submit"),
|
||||||
rx.icon_button(FormState.val, icon=rx.icon(tag="plus")),
|
rx.icon_button(FormState.val, icon=rx.icon(tag="plus")),
|
||||||
variant="outline",
|
|
||||||
is_attached=True,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
on_submit=FormState.form_submit,
|
on_submit=FormState.form_submit,
|
||||||
custom_attrs={"action": "/invalid"},
|
custom_attrs={"action": "/invalid"},
|
||||||
@ -152,16 +138,12 @@ def FormSubmitName(form_component):
|
|||||||
functools.partial(FormSubmitName, form_component="rx.form.root"),
|
functools.partial(FormSubmitName, form_component="rx.form.root"),
|
||||||
functools.partial(FormSubmit, form_component="rx.el.form"),
|
functools.partial(FormSubmit, form_component="rx.el.form"),
|
||||||
functools.partial(FormSubmitName, form_component="rx.el.form"),
|
functools.partial(FormSubmitName, form_component="rx.el.form"),
|
||||||
functools.partial(FormSubmit, form_component="rc.form"),
|
|
||||||
functools.partial(FormSubmitName, form_component="rc.form"),
|
|
||||||
],
|
],
|
||||||
ids=[
|
ids=[
|
||||||
"id-radix",
|
"id-radix",
|
||||||
"name-radix",
|
"name-radix",
|
||||||
"id-html",
|
"id-html",
|
||||||
"name-html",
|
"name-html",
|
||||||
"id-chakra",
|
|
||||||
"name-chakra",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def form_submit(request, tmp_path_factory) -> Generator[AppHarness, None, None]:
|
def form_submit(request, tmp_path_factory) -> Generator[AppHarness, None, None]:
|
||||||
@ -224,16 +206,6 @@ async def test_submit(driver, form_submit: AppHarness):
|
|||||||
name_input = driver.find_element(by, "name_input")
|
name_input = driver.find_element(by, "name_input")
|
||||||
name_input.send_keys("foo")
|
name_input.send_keys("foo")
|
||||||
|
|
||||||
pin_inputs = driver.find_elements(By.CLASS_NAME, "chakra-pin-input")
|
|
||||||
pin_values = ["8", "1", "6", "4"]
|
|
||||||
for i, pin_input in enumerate(pin_inputs):
|
|
||||||
pin_input.send_keys(pin_values[i])
|
|
||||||
|
|
||||||
number_input = driver.find_element(By.CLASS_NAME, "chakra-numberinput")
|
|
||||||
buttons = number_input.find_elements(By.XPATH, "//div[@role='button']")
|
|
||||||
for _ in range(3):
|
|
||||||
buttons[1].click()
|
|
||||||
|
|
||||||
checkbox_input = driver.find_element(By.XPATH, "//button[@role='checkbox']")
|
checkbox_input = driver.find_element(By.XPATH, "//button[@role='checkbox']")
|
||||||
checkbox_input.click()
|
checkbox_input.click()
|
||||||
|
|
||||||
@ -275,15 +247,12 @@ async def test_submit(driver, form_submit: AppHarness):
|
|||||||
print(form_data)
|
print(form_data)
|
||||||
|
|
||||||
assert form_data["name_input"] == "foo"
|
assert form_data["name_input"] == "foo"
|
||||||
assert form_data["pin_input"] == pin_values
|
|
||||||
assert form_data["number_input"] == "-3"
|
|
||||||
assert form_data["bool_input"]
|
assert form_data["bool_input"]
|
||||||
assert form_data["bool_input2"]
|
assert form_data["bool_input2"]
|
||||||
assert not form_data.get("bool_input3", False)
|
assert not form_data.get("bool_input3", False)
|
||||||
assert not form_data.get("bool_input4", False)
|
assert not form_data.get("bool_input4", False)
|
||||||
|
|
||||||
assert form_data["slider_input"] == "50"
|
assert form_data["slider_input"] == "50"
|
||||||
assert form_data["range_input"] == ["25", "75"]
|
|
||||||
assert form_data["radio_input"] == "option2"
|
assert form_data["radio_input"] == "option2"
|
||||||
assert form_data["select_input"] == "option1"
|
assert form_data["select_input"] == "option1"
|
||||||
assert form_data["text_area_input"] == "Some\nText"
|
assert form_data["text_area_input"] == "Some\nText"
|
||||||
|
@ -11,8 +11,6 @@ from reflex.testing import AppHarness
|
|||||||
|
|
||||||
def ServerSideEvent():
|
def ServerSideEvent():
|
||||||
"""App with inputs set via event handlers and set_value."""
|
"""App with inputs set via event handlers and set_value."""
|
||||||
import reflex_chakra as rc
|
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
class SSState(rx.State):
|
class SSState(rx.State):
|
||||||
@ -41,12 +39,12 @@ def ServerSideEvent():
|
|||||||
@app.add_page
|
@app.add_page
|
||||||
def index():
|
def index():
|
||||||
return rx.fragment(
|
return rx.fragment(
|
||||||
rc.input(
|
rx.input(
|
||||||
id="token", value=SSState.router.session.client_token, is_read_only=True
|
id="token", value=SSState.router.session.client_token, is_read_only=True
|
||||||
),
|
),
|
||||||
rc.input(default_value="a", id="a"),
|
rx.input(default_value="a", id="a"),
|
||||||
rc.input(default_value="b", id="b"),
|
rx.input(default_value="b", id="b"),
|
||||||
rc.input(default_value="c", id="c"),
|
rx.input(default_value="c", id="c"),
|
||||||
rx.button(
|
rx.button(
|
||||||
"Clear Immediate",
|
"Clear Immediate",
|
||||||
id="clear_immediate",
|
id="clear_immediate",
|
||||||
|
@ -10,89 +10,45 @@ from reflex.testing import AppHarness
|
|||||||
|
|
||||||
def Table():
|
def Table():
|
||||||
"""App using table component."""
|
"""App using table component."""
|
||||||
from typing import List
|
|
||||||
|
|
||||||
import reflex_chakra as rc
|
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
class TableState(rx.State):
|
|
||||||
rows: List[List[str]] = [
|
|
||||||
["John", "30", "New York"],
|
|
||||||
["Jane", "31", "San Fransisco"],
|
|
||||||
["Joe", "32", "Los Angeles"],
|
|
||||||
]
|
|
||||||
|
|
||||||
headers: List[str] = ["Name", "Age", "Location"]
|
|
||||||
|
|
||||||
footers: List[str] = ["footer1", "footer2", "footer3"]
|
|
||||||
|
|
||||||
caption: str = "random caption"
|
|
||||||
|
|
||||||
app = rx.App(state=rx.State)
|
app = rx.App(state=rx.State)
|
||||||
|
|
||||||
@app.add_page
|
@app.add_page
|
||||||
def index():
|
def index():
|
||||||
return rx.center(
|
return rx.center(
|
||||||
rc.input(
|
rx.input(
|
||||||
id="token",
|
id="token",
|
||||||
value=TableState.router.session.client_token,
|
value=rx.State.router.session.client_token,
|
||||||
is_read_only=True,
|
is_read_only=True,
|
||||||
),
|
),
|
||||||
rc.table_container(
|
rx.table.root(
|
||||||
rc.table(
|
rx.table.header(
|
||||||
headers=TableState.headers,
|
rx.table.row(
|
||||||
rows=TableState.rows,
|
rx.table.column_header_cell("Name"),
|
||||||
footers=TableState.footers,
|
rx.table.column_header_cell("Age"),
|
||||||
caption=TableState.caption,
|
rx.table.column_header_cell("Location"),
|
||||||
variant="striped",
|
),
|
||||||
color_scheme="blue",
|
),
|
||||||
|
rx.table.body(
|
||||||
|
rx.table.row(
|
||||||
|
rx.table.row_header_cell("John"),
|
||||||
|
rx.table.cell(30),
|
||||||
|
rx.table.cell("New York"),
|
||||||
|
),
|
||||||
|
rx.table.row(
|
||||||
|
rx.table.row_header_cell("Jane"),
|
||||||
|
rx.table.cell(31),
|
||||||
|
rx.table.cell("San Fransisco"),
|
||||||
|
),
|
||||||
|
rx.table.row(
|
||||||
|
rx.table.row_header_cell("Joe"),
|
||||||
|
rx.table.cell(32),
|
||||||
|
rx.table.cell("Los Angeles"),
|
||||||
|
),
|
||||||
|
),
|
||||||
width="100%",
|
width="100%",
|
||||||
),
|
),
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
@app.add_page
|
|
||||||
def another():
|
|
||||||
return rx.center(
|
|
||||||
rc.table_container(
|
|
||||||
rc.table( # type: ignore
|
|
||||||
rc.thead( # type: ignore
|
|
||||||
rc.tr( # type: ignore
|
|
||||||
rc.th("Name"),
|
|
||||||
rc.th("Age"),
|
|
||||||
rc.th("Location"),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
rc.tbody( # type: ignore
|
|
||||||
rc.tr( # type: ignore
|
|
||||||
rc.td("John"),
|
|
||||||
rc.td(30),
|
|
||||||
rc.td("New York"),
|
|
||||||
),
|
|
||||||
rc.tr( # type: ignore
|
|
||||||
rc.td("Jane"),
|
|
||||||
rc.td(31),
|
|
||||||
rc.td("San Francisco"),
|
|
||||||
),
|
|
||||||
rc.tr( # type: ignore
|
|
||||||
rc.td("Joe"),
|
|
||||||
rc.td(32),
|
|
||||||
rc.td("Los Angeles"),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
rc.tfoot( # type: ignore
|
|
||||||
rc.tr(
|
|
||||||
rc.td("footer1"),
|
|
||||||
rc.td("footer2"),
|
|
||||||
rc.td("footer3"),
|
|
||||||
) # type: ignore
|
|
||||||
),
|
|
||||||
rc.table_caption("random caption"),
|
|
||||||
variant="striped",
|
|
||||||
color_scheme="teal",
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -138,23 +94,20 @@ def driver(table: AppHarness):
|
|||||||
driver.quit()
|
driver.quit()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("route", ["", "/another"])
|
def test_table(driver, table: AppHarness):
|
||||||
def test_table(driver, table: AppHarness, route):
|
|
||||||
"""Test that a table component is rendered properly.
|
"""Test that a table component is rendered properly.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
driver: Selenium WebDriver open to the app
|
driver: Selenium WebDriver open to the app
|
||||||
table: Harness for Table app
|
table: Harness for Table app
|
||||||
route: Page route or path.
|
|
||||||
"""
|
"""
|
||||||
driver.get(f"{table.frontend_url}/{route}")
|
|
||||||
assert table.app_instance is not None, "app is not running"
|
assert table.app_instance is not None, "app is not running"
|
||||||
|
|
||||||
thead = driver.find_element(By.TAG_NAME, "thead")
|
thead = driver.find_element(By.TAG_NAME, "thead")
|
||||||
# poll till page is fully loaded.
|
# poll till page is fully loaded.
|
||||||
table.poll_for_content(element=thead)
|
table.poll_for_content(element=thead)
|
||||||
# check headers
|
# check headers
|
||||||
assert thead.find_element(By.TAG_NAME, "tr").text == "NAME AGE LOCATION"
|
assert thead.find_element(By.TAG_NAME, "tr").text == "Name Age Location"
|
||||||
# check first row value
|
# check first row value
|
||||||
assert (
|
assert (
|
||||||
driver.find_element(By.TAG_NAME, "tbody")
|
driver.find_element(By.TAG_NAME, "tbody")
|
||||||
@ -162,12 +115,3 @@ def test_table(driver, table: AppHarness, route):
|
|||||||
.text
|
.text
|
||||||
== "John 30 New York"
|
== "John 30 New York"
|
||||||
)
|
)
|
||||||
# check footer
|
|
||||||
assert (
|
|
||||||
driver.find_element(By.TAG_NAME, "tfoot")
|
|
||||||
.find_element(By.TAG_NAME, "tr")
|
|
||||||
.text.lower()
|
|
||||||
== "footer1 footer2 footer3"
|
|
||||||
)
|
|
||||||
# check caption
|
|
||||||
assert driver.find_element(By.TAG_NAME, "caption").text == "random caption"
|
|
||||||
|
@ -27,8 +27,6 @@ def TailwindApp(
|
|||||||
"""
|
"""
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import reflex_chakra as rc
|
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
class UnusedState(rx.State):
|
class UnusedState(rx.State):
|
||||||
@ -36,7 +34,7 @@ def TailwindApp(
|
|||||||
|
|
||||||
def index():
|
def index():
|
||||||
return rx.el.div(
|
return rx.el.div(
|
||||||
rc.text(paragraph_text, class_name=paragraph_class_name),
|
rx.text(paragraph_text, class_name=paragraph_class_name),
|
||||||
rx.el.p(paragraph_text, class_name=paragraph_class_name),
|
rx.el.p(paragraph_text, class_name=paragraph_class_name),
|
||||||
rx.text(paragraph_text, as_="p", class_name=paragraph_class_name),
|
rx.text(paragraph_text, as_="p", class_name=paragraph_class_name),
|
||||||
rx.el.div("Test external stylesheet", class_name="external"),
|
rx.el.div("Test external stylesheet", class_name="external"),
|
||||||
|
@ -16,8 +16,6 @@ def UploadFile():
|
|||||||
"""App for testing dynamic routes."""
|
"""App for testing dynamic routes."""
|
||||||
from typing import Dict, List
|
from typing import Dict, List
|
||||||
|
|
||||||
import reflex_chakra as rc
|
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
|
|
||||||
class UploadState(rx.State):
|
class UploadState(rx.State):
|
||||||
@ -46,7 +44,7 @@ def UploadFile():
|
|||||||
|
|
||||||
def index():
|
def index():
|
||||||
return rx.vstack(
|
return rx.vstack(
|
||||||
rc.input(
|
rx.input(
|
||||||
value=UploadState.router.session.client_token,
|
value=UploadState.router.session.client_token,
|
||||||
is_read_only=True,
|
is_read_only=True,
|
||||||
id="token",
|
id="token",
|
||||||
|
@ -14,11 +14,9 @@ def VarOperations():
|
|||||||
"""App with var operations."""
|
"""App with var operations."""
|
||||||
from typing import Dict, List
|
from typing import Dict, List
|
||||||
|
|
||||||
import reflex_chakra as rc
|
|
||||||
|
|
||||||
import reflex as rx
|
import reflex as rx
|
||||||
from reflex.ivars.base import LiteralVar
|
from reflex.vars.base import LiteralVar
|
||||||
from reflex.ivars.sequence import ArrayVar
|
from reflex.vars.sequence import ArrayVar
|
||||||
|
|
||||||
class Object(rx.Base):
|
class Object(rx.Base):
|
||||||
str: str = "hello"
|
str: str = "hello"
|
||||||
@ -552,10 +550,7 @@ def VarOperations():
|
|||||||
VarOperationState.html_str,
|
VarOperationState.html_str,
|
||||||
id="html_str",
|
id="html_str",
|
||||||
),
|
),
|
||||||
rc.highlight(
|
rx.el.mark("second"),
|
||||||
"second",
|
|
||||||
query=[VarOperationState.str_var2],
|
|
||||||
),
|
|
||||||
rx.text(ArrayVar.range(2, 5).join(","), id="list_join_range1"),
|
rx.text(ArrayVar.range(2, 5).join(","), id="list_join_range1"),
|
||||||
rx.text(ArrayVar.range(2, 10, 2).join(","), id="list_join_range2"),
|
rx.text(ArrayVar.range(2, 10, 2).join(","), id="list_join_range2"),
|
||||||
rx.text(ArrayVar.range(5, 0, -1).join(","), id="list_join_range3"),
|
rx.text(ArrayVar.range(5, 0, -1).join(","), id="list_join_range3"),
|
||||||
|
967
poetry.lock
generated
967
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "reflex"
|
name = "reflex"
|
||||||
version = "0.6.0a1"
|
version = "0.6.0"
|
||||||
description = "Web apps in pure Python."
|
description = "Web apps in pure Python."
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
authors = [
|
authors = [
|
||||||
@ -26,7 +26,7 @@ packages = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.8"
|
python = "^3.9"
|
||||||
dill = ">=0.3.8,<0.4"
|
dill = ">=0.3.8,<0.4"
|
||||||
fastapi = ">=0.96.0,!=0.111.0,!=0.111.1"
|
fastapi = ">=0.96.0,!=0.111.0,!=0.111.1"
|
||||||
gunicorn = ">=20.1.0,<24.0"
|
gunicorn = ">=20.1.0,<24.0"
|
||||||
@ -59,7 +59,7 @@ httpx = ">=0.25.1,<1.0"
|
|||||||
twine = ">=4.0.0,<6.0"
|
twine = ">=4.0.0,<6.0"
|
||||||
tomlkit = ">=0.12.4,<1.0"
|
tomlkit = ">=0.12.4,<1.0"
|
||||||
lazy_loader = ">=0.4"
|
lazy_loader = ">=0.4"
|
||||||
reflex-chakra = ">=0.6.0a"
|
reflex-chakra = ">=0.6.0a6"
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
pytest = ">=7.1.2,<8.0"
|
pytest = ">=7.1.2,<8.0"
|
||||||
@ -70,16 +70,11 @@ toml = ">=0.10.2,<1.0"
|
|||||||
pytest-asyncio = ">=0.20.1,<0.22.0" # https://github.com/pytest-dev/pytest-asyncio/issues/706
|
pytest-asyncio = ">=0.20.1,<0.22.0" # https://github.com/pytest-dev/pytest-asyncio/issues/706
|
||||||
pytest-cov = ">=4.0.0,<5.0"
|
pytest-cov = ">=4.0.0,<5.0"
|
||||||
ruff = "^0.4.9"
|
ruff = "^0.4.9"
|
||||||
pandas = [
|
pandas = ">=2.1.1,<3.0"
|
||||||
{version = ">=2.1.1,<3.0", python = ">=3.9,<3.13"},
|
pillow = ">=10.0.0,<11.0"
|
||||||
{version = ">=1.5.3,<2.0", python = ">=3.8,<3.9"},
|
|
||||||
]
|
|
||||||
pillow = [
|
|
||||||
{version = ">=10.0.0,<11.0", python = ">=3.8,<4.0"}
|
|
||||||
]
|
|
||||||
plotly = ">=5.13.0,<6.0"
|
plotly = ">=5.13.0,<6.0"
|
||||||
asynctest = ">=0.13.0,<1.0"
|
asynctest = ">=0.13.0,<1.0"
|
||||||
pre-commit = {version = ">=3.2.1", python = ">=3.8,<4.0"}
|
pre-commit = ">=3.2.1"
|
||||||
selenium = ">=4.11.0,<5.0"
|
selenium = ">=4.11.0,<5.0"
|
||||||
pytest-benchmark = ">=4.0.0,<5.0"
|
pytest-benchmark = ">=4.0.0,<5.0"
|
||||||
|
|
||||||
@ -93,7 +88,7 @@ build-backend = "poetry.core.masonry.api"
|
|||||||
[tool.pyright]
|
[tool.pyright]
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
target-version = "py38"
|
target-version = "py39"
|
||||||
lint.select = ["B", "D", "E", "F", "I", "SIM", "W"]
|
lint.select = ["B", "D", "E", "F", "I", "SIM", "W"]
|
||||||
lint.ignore = ["B008", "D203", "D205", "D213", "D401", "D406", "D407", "E501", "F403", "F405", "F541"]
|
lint.ignore = ["B008", "D203", "D205", "D213", "D401", "D406", "D407", "E501", "F403", "F405", "F541"]
|
||||||
lint.pydocstyle.convention = "google"
|
lint.pydocstyle.convention = "google"
|
||||||
|
@ -8,11 +8,11 @@ version = "0.0.1"
|
|||||||
description = "Reflex custom component {{ module_name }}"
|
description = "Reflex custom component {{ module_name }}"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = { text = "Apache-2.0" }
|
license = { text = "Apache-2.0" }
|
||||||
requires-python = ">=3.8"
|
requires-python = ">=3.9"
|
||||||
authors = [{ name = "", email = "YOUREMAIL@domain.com" }]
|
authors = [{ name = "", email = "YOUREMAIL@domain.com" }]
|
||||||
keywords = ["reflex","reflex-custom-components"]
|
keywords = ["reflex","reflex-custom-components"]
|
||||||
|
|
||||||
dependencies = ["reflex>=0.4.2"]
|
dependencies = ["reflex>={{ reflex_version }}"]
|
||||||
|
|
||||||
classifiers = ["Development Status :: 4 - Beta"]
|
classifiers = ["Development Status :: 4 - Beta"]
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ function AppWrap({children}) {
|
|||||||
|
|
||||||
export default function MyApp({ Component, pageProps }) {
|
export default function MyApp({ Component, pageProps }) {
|
||||||
return (
|
return (
|
||||||
<ThemeProvider defaultTheme={ defaultColorMode } storageKey="chakra-ui-color-mode" attribute="class">
|
<ThemeProvider defaultTheme={ defaultColorMode } attribute="class">
|
||||||
<AppWrap>
|
<AppWrap>
|
||||||
<StateProvider>
|
<StateProvider>
|
||||||
<EventLoopProvider>
|
<EventLoopProvider>
|
||||||
|
@ -85,10 +85,10 @@
|
|||||||
{% macro render_match_tag(component) %}
|
{% macro render_match_tag(component) %}
|
||||||
{
|
{
|
||||||
(() => {
|
(() => {
|
||||||
switch (JSON.stringify({{ component.cond._var_name }})) {
|
switch (JSON.stringify({{ component.cond._js_expr }})) {
|
||||||
{% for case in component.match_cases %}
|
{% for case in component.match_cases %}
|
||||||
{% for condition in case[:-1] %}
|
{% for condition in case[:-1] %}
|
||||||
case JSON.stringify({{ condition._var_name }}):
|
case JSON.stringify({{ condition._js_expr }}):
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
return {{ case[-1] }};
|
return {{ case[-1] }};
|
||||||
break;
|
break;
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
import { useColorMode as chakraUseColorMode } from "@chakra-ui/react";
|
|
||||||
import { useTheme } from "next-themes";
|
|
||||||
import { useEffect, useState } from "react";
|
|
||||||
import { ColorModeContext, defaultColorMode } from "/utils/context.js";
|
|
||||||
|
|
||||||
export default function ChakraColorModeProvider({ children }) {
|
|
||||||
const { theme, resolvedTheme, setTheme } = useTheme();
|
|
||||||
const { colorMode, toggleColorMode } = chakraUseColorMode();
|
|
||||||
const [resolvedColorMode, setResolvedColorMode] = useState(colorMode);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (colorMode != resolvedTheme) {
|
|
||||||
toggleColorMode();
|
|
||||||
}
|
|
||||||
setResolvedColorMode(resolvedTheme);
|
|
||||||
}, [theme, resolvedTheme]);
|
|
||||||
|
|
||||||
const rawColorMode = colorMode;
|
|
||||||
const setColorMode = (mode) => {
|
|
||||||
const allowedModes = ["light", "dark", "system"];
|
|
||||||
if (!allowedModes.includes(mode)) {
|
|
||||||
console.error(
|
|
||||||
`Invalid color mode "${mode}". Defaulting to "${defaultColorMode}".`
|
|
||||||
);
|
|
||||||
mode = defaultColorMode;
|
|
||||||
}
|
|
||||||
setTheme(mode);
|
|
||||||
};
|
|
||||||
return (
|
|
||||||
<ColorModeContext.Provider
|
|
||||||
value={{ rawColorMode, resolvedColorMode, toggleColorMode, setColorMode }}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</ColorModeContext.Provider>
|
|
||||||
);
|
|
||||||
}
|
|
@ -805,7 +805,9 @@ export const useEventLoop = (
|
|||||||
* @returns True if the value is truthy, false otherwise.
|
* @returns True if the value is truthy, false otherwise.
|
||||||
*/
|
*/
|
||||||
export const isTrue = (val) => {
|
export const isTrue = (val) => {
|
||||||
return Array.isArray(val) ? val.length > 0 : !!val;
|
if (Array.isArray(val)) return val.length > 0;
|
||||||
|
if (val === Object(val)) return Object.keys(val).length > 0;
|
||||||
|
return Boolean(val);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -206,6 +206,13 @@ RADIX_PRIMITIVES_MAPPING: dict = {
|
|||||||
"components.radix.primitives.form": [
|
"components.radix.primitives.form": [
|
||||||
"form",
|
"form",
|
||||||
],
|
],
|
||||||
|
"components.radix.primitives.progress": [
|
||||||
|
"progress",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
RADIX_PRIMITIVES_SHORTCUT_MAPPING: dict = {
|
||||||
|
k: v for k, v in RADIX_PRIMITIVES_MAPPING.items() if "progress" not in k
|
||||||
}
|
}
|
||||||
|
|
||||||
COMPONENTS_CORE_MAPPING: dict = {
|
COMPONENTS_CORE_MAPPING: dict = {
|
||||||
@ -248,7 +255,7 @@ RADIX_MAPPING: dict = {
|
|||||||
**RADIX_THEMES_COMPONENTS_MAPPING,
|
**RADIX_THEMES_COMPONENTS_MAPPING,
|
||||||
**RADIX_THEMES_TYPOGRAPHY_MAPPING,
|
**RADIX_THEMES_TYPOGRAPHY_MAPPING,
|
||||||
**RADIX_THEMES_LAYOUT_MAPPING,
|
**RADIX_THEMES_LAYOUT_MAPPING,
|
||||||
**RADIX_PRIMITIVES_MAPPING,
|
**RADIX_PRIMITIVES_SHORTCUT_MAPPING,
|
||||||
}
|
}
|
||||||
|
|
||||||
_MAPPING: dict = {
|
_MAPPING: dict = {
|
||||||
@ -338,7 +345,6 @@ _SUBMODULES: set[str] = {
|
|||||||
"testing",
|
"testing",
|
||||||
"utils",
|
"utils",
|
||||||
"vars",
|
"vars",
|
||||||
"ivars",
|
|
||||||
"config",
|
"config",
|
||||||
"compiler",
|
"compiler",
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ from . import compiler as compiler
|
|||||||
from . import components as components
|
from . import components as components
|
||||||
from . import config as config
|
from . import config as config
|
||||||
from . import event as event
|
from . import event as event
|
||||||
from . import ivars as ivars
|
|
||||||
from . import model as model
|
from . import model as model
|
||||||
from . import style as style
|
from . import style as style
|
||||||
from . import testing as testing
|
from . import testing as testing
|
||||||
@ -132,6 +131,7 @@ from .components.radix.themes.layout.container import container as container
|
|||||||
from .components.radix.themes.layout.flex import flex as flex
|
from .components.radix.themes.layout.flex import flex as flex
|
||||||
from .components.radix.themes.layout.grid import grid as grid
|
from .components.radix.themes.layout.grid import grid as grid
|
||||||
from .components.radix.themes.layout.list import list_item as list_item
|
from .components.radix.themes.layout.list import list_item as list_item
|
||||||
|
from .components.radix.themes.layout.list import list_ns as list # noqa
|
||||||
from .components.radix.themes.layout.list import ordered_list as ordered_list
|
from .components.radix.themes.layout.list import ordered_list as ordered_list
|
||||||
from .components.radix.themes.layout.list import unordered_list as unordered_list
|
from .components.radix.themes.layout.list import unordered_list as unordered_list
|
||||||
from .components.radix.themes.layout.section import section as section
|
from .components.radix.themes.layout.section import section as section
|
||||||
@ -197,6 +197,7 @@ RADIX_THEMES_COMPONENTS_MAPPING: dict
|
|||||||
RADIX_THEMES_LAYOUT_MAPPING: dict
|
RADIX_THEMES_LAYOUT_MAPPING: dict
|
||||||
RADIX_THEMES_TYPOGRAPHY_MAPPING: dict
|
RADIX_THEMES_TYPOGRAPHY_MAPPING: dict
|
||||||
RADIX_PRIMITIVES_MAPPING: dict
|
RADIX_PRIMITIVES_MAPPING: dict
|
||||||
|
RADIX_PRIMITIVES_SHORTCUT_MAPPING: dict
|
||||||
COMPONENTS_CORE_MAPPING: dict
|
COMPONENTS_CORE_MAPPING: dict
|
||||||
COMPONENTS_BASE_MAPPING: dict
|
COMPONENTS_BASE_MAPPING: dict
|
||||||
RADIX_MAPPING: dict
|
RADIX_MAPPING: dict
|
||||||
|
@ -9,6 +9,7 @@ import copy
|
|||||||
import functools
|
import functools
|
||||||
import inspect
|
import inspect
|
||||||
import io
|
import io
|
||||||
|
import json
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
@ -823,7 +824,7 @@ class App(MiddlewareMixin, LifespanMixin, Base):
|
|||||||
for dep in deps:
|
for dep in deps:
|
||||||
if dep not in state.vars and dep not in state.backend_vars:
|
if dep not in state.vars and dep not in state.backend_vars:
|
||||||
raise exceptions.VarDependencyError(
|
raise exceptions.VarDependencyError(
|
||||||
f"ComputedVar {var._var_name} on state {state.__name__} has an invalid dependency {dep}"
|
f"ComputedVar {var._js_expr} on state {state.__name__} has an invalid dependency {dep}"
|
||||||
)
|
)
|
||||||
|
|
||||||
for substate in state.class_subclasses:
|
for substate in state.class_subclasses:
|
||||||
@ -1531,8 +1532,9 @@ class EventNamespace(AsyncNamespace):
|
|||||||
sid: The Socket.IO session id.
|
sid: The Socket.IO session id.
|
||||||
data: The event data.
|
data: The event data.
|
||||||
"""
|
"""
|
||||||
|
fields = json.loads(data)
|
||||||
# Get the event.
|
# Get the event.
|
||||||
event = Event.parse_raw(data)
|
event = Event(**{k: v for k, v in fields.items() if k != "handler"})
|
||||||
|
|
||||||
self.token_to_sid[event.token] = sid
|
self.token_to_sid[event.token] = sid
|
||||||
self.sid_to_token[sid] = event.token
|
self.sid_to_token[sid] = event.token
|
||||||
|
@ -15,7 +15,7 @@ if constants.CompileVars.APP != "app":
|
|||||||
telemetry.send("compile")
|
telemetry.send("compile")
|
||||||
app_module = get_app(reload=False)
|
app_module = get_app(reload=False)
|
||||||
app = getattr(app_module, constants.CompileVars.APP)
|
app = getattr(app_module, constants.CompileVars.APP)
|
||||||
# For py3.8 and py3.9 compatibility when redis is used, we MUST add any decorator pages
|
# For py3.9 compatibility when redis is used, we MUST add any decorator pages
|
||||||
# before compiling the app in a thread to avoid event loop error (REF-2172).
|
# before compiling the app in a thread to avoid event loop error (REF-2172).
|
||||||
app._apply_decorated_pages()
|
app._apply_decorated_pages()
|
||||||
compile_future = ThreadPoolExecutor(max_workers=1).submit(app._compile)
|
compile_future = ThreadPoolExecutor(max_workers=1).submit(app._compile)
|
||||||
|
@ -110,7 +110,7 @@ class Base(BaseModel): # pyright: ignore [reportUnboundVariable]
|
|||||||
var: The variable to add a pydantic field for.
|
var: The variable to add a pydantic field for.
|
||||||
default_value: The default value of the field
|
default_value: The default value of the field
|
||||||
"""
|
"""
|
||||||
var_name = var._var_name.split(".")[-1]
|
var_name = var._js_expr.split(".")[-1]
|
||||||
new_field = ModelField.infer(
|
new_field = ModelField.infer(
|
||||||
name=var_name,
|
name=var_name,
|
||||||
value=default_value,
|
value=default_value,
|
||||||
|
@ -17,12 +17,12 @@ from reflex.components.component import (
|
|||||||
StatefulComponent,
|
StatefulComponent,
|
||||||
)
|
)
|
||||||
from reflex.config import get_config
|
from reflex.config import get_config
|
||||||
from reflex.ivars.base import ImmutableVar, LiteralVar
|
|
||||||
from reflex.state import BaseState
|
from reflex.state import BaseState
|
||||||
from reflex.style import SYSTEM_COLOR_MODE
|
from reflex.style import SYSTEM_COLOR_MODE
|
||||||
from reflex.utils.exec import is_prod_mode
|
from reflex.utils.exec import is_prod_mode
|
||||||
from reflex.utils.imports import ImportVar
|
from reflex.utils.imports import ImportVar
|
||||||
from reflex.utils.prerequisites import get_web_dir
|
from reflex.utils.prerequisites import get_web_dir
|
||||||
|
from reflex.vars.base import LiteralVar, Var
|
||||||
|
|
||||||
|
|
||||||
def _compile_document_root(root: Component) -> str:
|
def _compile_document_root(root: Component) -> str:
|
||||||
@ -320,7 +320,7 @@ def _compile_tailwind(
|
|||||||
def compile_document_root(
|
def compile_document_root(
|
||||||
head_components: list[Component],
|
head_components: list[Component],
|
||||||
html_lang: Optional[str] = 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,
|
||||||
) -> tuple[str, str]:
|
) -> tuple[str, str]:
|
||||||
"""Compile the document root.
|
"""Compile the document root.
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@ from pathlib import Path
|
|||||||
from typing import Any, Callable, Dict, Optional, Type, Union
|
from typing import Any, Callable, Dict, Optional, Type, Union
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.utils.prerequisites import get_web_dir
|
from reflex.utils.prerequisites import get_web_dir
|
||||||
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from pydantic.v1.fields import ModelField
|
from pydantic.v1.fields import ModelField
|
||||||
@ -268,7 +268,7 @@ def compile_custom_component(
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Concatenate the props.
|
# Concatenate the props.
|
||||||
props = [prop._var_name for prop in component.get_prop_vars()]
|
props = [prop._js_expr for prop in component.get_prop_vars()]
|
||||||
|
|
||||||
# Compile the component.
|
# Compile the component.
|
||||||
return (
|
return (
|
||||||
@ -286,7 +286,7 @@ def compile_custom_component(
|
|||||||
def create_document_root(
|
def create_document_root(
|
||||||
head_components: list[Component] | None = None,
|
head_components: list[Component] | None = None,
|
||||||
html_lang: Optional[str] = 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:
|
) -> Component:
|
||||||
"""Create the document root.
|
"""Create the document root.
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from reflex.components.base.fragment import Fragment
|
from reflex.components.base.fragment import Fragment
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.ivars.base import ImmutableVar
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
|
|
||||||
class AppWrap(Fragment):
|
class AppWrap(Fragment):
|
||||||
@ -15,4 +15,4 @@ class AppWrap(Fragment):
|
|||||||
Returns:
|
Returns:
|
||||||
A new AppWrap component containing {children}.
|
A new AppWrap component containing {children}.
|
||||||
"""
|
"""
|
||||||
return super().create(ImmutableVar.create("children"))
|
return super().create(Var(_js_expr="children"))
|
||||||
|
@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload
|
|||||||
|
|
||||||
from reflex.components.base.fragment import Fragment
|
from reflex.components.base.fragment import Fragment
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
class AppWrap(Fragment):
|
class AppWrap(Fragment):
|
||||||
@overload
|
@overload
|
||||||
@ -21,51 +21,41 @@ class AppWrap(Fragment):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "AppWrap":
|
) -> "AppWrap":
|
||||||
|
@ -7,8 +7,7 @@ from typing import Any, Iterator
|
|||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.components.tags import Tag
|
from reflex.components.tags import Tag
|
||||||
from reflex.components.tags.tagless import Tagless
|
from reflex.components.tags.tagless import Tagless
|
||||||
from reflex.ivars.base import ImmutableVar
|
from reflex.vars.base import Var
|
||||||
from reflex.vars import Var
|
|
||||||
|
|
||||||
|
|
||||||
class Bare(Component):
|
class Bare(Component):
|
||||||
@ -26,18 +25,18 @@ class Bare(Component):
|
|||||||
Returns:
|
Returns:
|
||||||
The component.
|
The component.
|
||||||
"""
|
"""
|
||||||
if isinstance(contents, ImmutableVar):
|
if isinstance(contents, Var):
|
||||||
return cls(contents=contents)
|
return cls(contents=contents)
|
||||||
else:
|
else:
|
||||||
contents = str(contents) if contents is not None else ""
|
contents = str(contents) if contents is not None else ""
|
||||||
return cls(contents=contents) # type: ignore
|
return cls(contents=contents) # type: ignore
|
||||||
|
|
||||||
def _render(self) -> Tag:
|
def _render(self) -> Tag:
|
||||||
if isinstance(self.contents, ImmutableVar):
|
if isinstance(self.contents, Var):
|
||||||
return Tagless(contents=f"{{{str(self.contents)}}}")
|
return Tagless(contents=f"{{{str(self.contents)}}}")
|
||||||
return Tagless(contents=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.
|
"""Walk all Vars used in this component.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload
|
|||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
class Body(Component):
|
class Body(Component):
|
||||||
@overload
|
@overload
|
||||||
@ -21,51 +21,41 @@ class Body(Component):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Body":
|
) -> "Body":
|
||||||
|
@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload
|
|||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
class NextDocumentLib(Component):
|
class NextDocumentLib(Component):
|
||||||
@overload
|
@overload
|
||||||
@ -21,51 +21,41 @@ class NextDocumentLib(Component):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "NextDocumentLib":
|
) -> "NextDocumentLib":
|
||||||
@ -98,51 +88,41 @@ class Html(NextDocumentLib):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Html":
|
) -> "Html":
|
||||||
@ -174,51 +154,41 @@ class DocumentHead(NextDocumentLib):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "DocumentHead":
|
) -> "DocumentHead":
|
||||||
@ -250,51 +220,41 @@ class Main(NextDocumentLib):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Main":
|
) -> "Main":
|
||||||
@ -326,51 +286,41 @@ class NextScript(NextDocumentLib):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "NextScript":
|
) -> "NextScript":
|
||||||
|
@ -9,10 +9,9 @@ from reflex.components.component import Component
|
|||||||
from reflex.components.el import div, p
|
from reflex.components.el import div, p
|
||||||
from reflex.constants import Hooks, Imports
|
from reflex.constants import Hooks, Imports
|
||||||
from reflex.event import EventChain, EventHandler
|
from reflex.event import EventChain, EventHandler
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.ivars.function import FunctionVar
|
|
||||||
from reflex.utils.imports import ImportVar
|
from reflex.utils.imports import ImportVar
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
from reflex.vars.function import FunctionVar
|
||||||
|
|
||||||
|
|
||||||
class ErrorBoundary(Component):
|
class ErrorBoundary(Component):
|
||||||
@ -22,12 +21,12 @@ class ErrorBoundary(Component):
|
|||||||
tag = "ErrorBoundary"
|
tag = "ErrorBoundary"
|
||||||
|
|
||||||
# Fired when the boundary catches an error.
|
# Fired when the boundary catches an error.
|
||||||
on_error: EventHandler[lambda error, info: [error, info]] = ImmutableVar( # type: ignore
|
on_error: EventHandler[lambda error, info: [error, info]] = Var( # type: ignore
|
||||||
"logFrontendError"
|
"logFrontendError"
|
||||||
).to(FunctionVar, EventChain)
|
).to(FunctionVar, EventChain)
|
||||||
|
|
||||||
# Rendered instead of the children when an error is caught.
|
# Rendered instead of the children when an error is caught.
|
||||||
Fallback_component: Var[Component] = ImmutableVar.create_safe("Fallback")._replace(
|
Fallback_component: Var[Component] = Var(_js_expr="Fallback")._replace(
|
||||||
_var_type=Component
|
_var_type=Component
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -39,7 +38,7 @@ class ErrorBoundary(Component):
|
|||||||
"""
|
"""
|
||||||
return Imports.EVENTS
|
return Imports.EVENTS
|
||||||
|
|
||||||
def add_hooks(self) -> List[str | ImmutableVar]:
|
def add_hooks(self) -> List[str | Var]:
|
||||||
"""Add hooks for the component.
|
"""Add hooks for the component.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@ -58,7 +57,7 @@ class ErrorBoundary(Component):
|
|||||||
fallback_container = div(
|
fallback_container = div(
|
||||||
p("Ooops...Unknown Reflex error has occured:"),
|
p("Ooops...Unknown Reflex error has occured:"),
|
||||||
p(
|
p(
|
||||||
ImmutableVar.create("error.message"),
|
Var(_js_expr="error.message"),
|
||||||
color="red",
|
color="red",
|
||||||
),
|
),
|
||||||
p("Please contact the support."),
|
p("Please contact the support."),
|
||||||
|
@ -7,74 +7,61 @@ from typing import Any, Callable, Dict, List, Optional, Union, overload
|
|||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.utils.imports import ImportVar
|
from reflex.utils.imports import ImportVar
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
class ErrorBoundary(Component):
|
class ErrorBoundary(Component):
|
||||||
def add_imports(self) -> dict[str, list[ImportVar]]: ...
|
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]: ...
|
def add_custom_code(self) -> List[str]: ...
|
||||||
@overload
|
@overload
|
||||||
@classmethod
|
@classmethod
|
||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
Fallback_component: Optional[Union[Var[Component], Component]] = None,
|
Fallback_component: Optional[Union[Component, Var[Component]]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_error: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = 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[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "ErrorBoundary":
|
) -> "ErrorBoundary":
|
||||||
|
@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload
|
|||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
class Fragment(Component):
|
class Fragment(Component):
|
||||||
@overload
|
@overload
|
||||||
@ -21,51 +21,41 @@ class Fragment(Component):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Fragment":
|
) -> "Fragment":
|
||||||
|
@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload
|
|||||||
|
|
||||||
from reflex.components.component import Component, MemoizationLeaf
|
from reflex.components.component import Component, MemoizationLeaf
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
class NextHeadLib(Component):
|
class NextHeadLib(Component):
|
||||||
@overload
|
@overload
|
||||||
@ -21,51 +21,41 @@ class NextHeadLib(Component):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "NextHeadLib":
|
) -> "NextHeadLib":
|
||||||
@ -97,51 +87,41 @@ class Head(NextHeadLib, MemoizationLeaf):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Head":
|
) -> "Head":
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""Display the title of the current page."""
|
"""Display the title of the current page."""
|
||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
|
|
||||||
class RawLink(Component):
|
class RawLink(Component):
|
||||||
|
@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload
|
|||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
class RawLink(Component):
|
class RawLink(Component):
|
||||||
@overload
|
@overload
|
||||||
@ -24,51 +23,41 @@ class RawLink(Component):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "RawLink":
|
) -> "RawLink":
|
||||||
@ -109,51 +98,41 @@ class ScriptTag(Component):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "ScriptTag":
|
) -> "ScriptTag":
|
||||||
|
@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload
|
|||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
class Title(Component):
|
class Title(Component):
|
||||||
def render(self) -> dict: ...
|
def render(self) -> dict: ...
|
||||||
@ -22,51 +22,41 @@ class Title(Component):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Title":
|
) -> "Title":
|
||||||
@ -103,51 +93,41 @@ class Meta(Component):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Meta":
|
) -> "Meta":
|
||||||
@ -189,51 +169,41 @@ class Description(Meta):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Description":
|
) -> "Description":
|
||||||
@ -275,51 +245,41 @@ class Image(Meta):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Image":
|
) -> "Image":
|
||||||
|
@ -9,8 +9,7 @@ from typing import Literal
|
|||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.event import EventHandler
|
from reflex.event import EventHandler
|
||||||
from reflex.ivars.base import LiteralVar
|
from reflex.vars.base import LiteralVar, Var
|
||||||
from reflex.vars import Var
|
|
||||||
|
|
||||||
|
|
||||||
class Script(Component):
|
class Script(Component):
|
||||||
|
@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload
|
|||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
class Script(Component):
|
class Script(Component):
|
||||||
@overload
|
@overload
|
||||||
@ -20,8 +19,8 @@ class Script(Component):
|
|||||||
src: Optional[Union[Var[str], str]] = None,
|
src: Optional[Union[Var[str], str]] = None,
|
||||||
strategy: Optional[
|
strategy: Optional[
|
||||||
Union[
|
Union[
|
||||||
Var[Literal["afterInteractive", "beforeInteractive", "lazyOnload"]],
|
|
||||||
Literal["afterInteractive", "beforeInteractive", "lazyOnload"],
|
Literal["afterInteractive", "beforeInteractive", "lazyOnload"],
|
||||||
|
Var[Literal["afterInteractive", "beforeInteractive", "lazyOnload"]],
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
@ -29,60 +28,44 @@ class Script(Component):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_error: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_load: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = 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[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_ready: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Script":
|
) -> "Script":
|
||||||
|
@ -43,7 +43,6 @@ from reflex.event import (
|
|||||||
call_event_handler,
|
call_event_handler,
|
||||||
get_handler_args,
|
get_handler_args,
|
||||||
)
|
)
|
||||||
from reflex.ivars.base import ImmutableVar, LiteralVar
|
|
||||||
from reflex.style import Style, format_as_emotion
|
from reflex.style import Style, format_as_emotion
|
||||||
from reflex.utils import format, imports, types
|
from reflex.utils import format, imports, types
|
||||||
from reflex.utils.imports import (
|
from reflex.utils.imports import (
|
||||||
@ -54,7 +53,8 @@ from reflex.utils.imports import (
|
|||||||
parse_imports,
|
parse_imports,
|
||||||
)
|
)
|
||||||
from reflex.utils.serializers import serializer
|
from reflex.utils.serializers import serializer
|
||||||
from reflex.vars import Var, VarData
|
from reflex.vars import VarData
|
||||||
|
from reflex.vars.base import LiteralVar, Var
|
||||||
|
|
||||||
|
|
||||||
class BaseComponent(Base, ABC):
|
class BaseComponent(Base, ABC):
|
||||||
@ -177,7 +177,7 @@ class Component(BaseComponent, ABC):
|
|||||||
style: Style = Style()
|
style: Style = Style()
|
||||||
|
|
||||||
# A mapping from event triggers to event chains.
|
# 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.
|
# The alias for the tag.
|
||||||
alias: Optional[str] = None
|
alias: Optional[str] = None
|
||||||
@ -195,7 +195,7 @@ class Component(BaseComponent, ABC):
|
|||||||
class_name: Any = None
|
class_name: Any = None
|
||||||
|
|
||||||
# Special component props.
|
# Special component props.
|
||||||
special_props: Set[ImmutableVar] = set()
|
special_props: List[Var] = []
|
||||||
|
|
||||||
# Whether the component should take the focus once the page is loaded
|
# Whether the component should take the focus once the page is loaded
|
||||||
autofocus: bool = False
|
autofocus: bool = False
|
||||||
@ -213,7 +213,7 @@ class Component(BaseComponent, ABC):
|
|||||||
_rename_props: Dict[str, str] = {}
|
_rename_props: Dict[str, str] = {}
|
||||||
|
|
||||||
# custom attribute
|
# custom attribute
|
||||||
custom_attrs: Dict[str, Union[ImmutableVar, str]] = {}
|
custom_attrs: Dict[str, Union[Var, str]] = {}
|
||||||
|
|
||||||
# When to memoize this component and its children.
|
# When to memoize this component and its children.
|
||||||
_memoization_mode: MemoizationMode = MemoizationMode()
|
_memoization_mode: MemoizationMode = MemoizationMode()
|
||||||
@ -249,7 +249,7 @@ class Component(BaseComponent, ABC):
|
|||||||
"""
|
"""
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
def add_hooks(self) -> list[str | ImmutableVar]:
|
def add_hooks(self) -> list[str | Var]:
|
||||||
"""Add hooks inside the component function.
|
"""Add hooks inside the component function.
|
||||||
|
|
||||||
Hooks are pieces of literal Javascript code that is inserted inside the
|
Hooks are pieces of literal Javascript code that is inserted inside the
|
||||||
@ -404,7 +404,7 @@ class Component(BaseComponent, ABC):
|
|||||||
passed_types = None
|
passed_types = None
|
||||||
try:
|
try:
|
||||||
# Try to create a var from the value.
|
# Try to create a var from the value.
|
||||||
if isinstance(value, ImmutableVar):
|
if isinstance(value, Var):
|
||||||
kwargs[key] = value
|
kwargs[key] = value
|
||||||
else:
|
else:
|
||||||
kwargs[key] = LiteralVar.create(value)
|
kwargs[key] = LiteralVar.create(value)
|
||||||
@ -447,11 +447,17 @@ class Component(BaseComponent, ABC):
|
|||||||
not passed_types
|
not passed_types
|
||||||
and not types._issubclass(passed_type, expected_type, value)
|
and not types._issubclass(passed_type, expected_type, value)
|
||||||
):
|
):
|
||||||
value_name = (
|
value_name = value._js_expr if isinstance(value, Var) else value
|
||||||
value._var_name if isinstance(value, ImmutableVar) else value
|
|
||||||
|
additional_info = (
|
||||||
|
" You can call `.bool()` on the value to convert it to a boolean."
|
||||||
|
if expected_type is bool and isinstance(value, Var)
|
||||||
|
else ""
|
||||||
)
|
)
|
||||||
|
|
||||||
raise TypeError(
|
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}."
|
f"Invalid var passed for prop {type(self).__name__}.{key}, expected type {expected_type}, got value {value_name} of type {passed_type}."
|
||||||
|
+ additional_info
|
||||||
)
|
)
|
||||||
# Check if the key is an event trigger.
|
# Check if the key is an event trigger.
|
||||||
if key in component_specific_triggers:
|
if key in component_specific_triggers:
|
||||||
@ -499,9 +505,13 @@ class Component(BaseComponent, ABC):
|
|||||||
self,
|
self,
|
||||||
args_spec: Any,
|
args_spec: Any,
|
||||||
value: Union[
|
value: Union[
|
||||||
Var, EventHandler, EventSpec, List[Union[EventHandler, EventSpec]], Callable
|
Var,
|
||||||
|
EventHandler,
|
||||||
|
EventSpec,
|
||||||
|
List[Union[EventHandler, EventSpec]],
|
||||||
|
Callable,
|
||||||
],
|
],
|
||||||
) -> Union[EventChain, ImmutableVar]:
|
) -> Union[EventChain, Var]:
|
||||||
"""Create an event chain from a variety of input types.
|
"""Create an event chain from a variety of input types.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -515,7 +525,7 @@ class Component(BaseComponent, ABC):
|
|||||||
ValueError: If the value is not a valid event chain.
|
ValueError: If the value is not a valid event chain.
|
||||||
"""
|
"""
|
||||||
# If it's an event chain var, return it.
|
# If it's an event chain var, return it.
|
||||||
if isinstance(value, ImmutableVar):
|
if isinstance(value, Var):
|
||||||
if value._var_type is not EventChain:
|
if value._var_type is not EventChain:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Invalid event chain: {repr(value)} of type {type(value)}"
|
f"Invalid event chain: {repr(value)} of type {type(value)}"
|
||||||
@ -539,7 +549,7 @@ class Component(BaseComponent, ABC):
|
|||||||
elif isinstance(v, Callable):
|
elif isinstance(v, Callable):
|
||||||
# Call the lambda to get the event chain.
|
# Call the lambda to get the event chain.
|
||||||
result = call_event_fn(v, args_spec)
|
result = call_event_fn(v, args_spec)
|
||||||
if isinstance(result, ImmutableVar):
|
if isinstance(result, Var):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Invalid event chain: {v}. Cannot use a Var-returning "
|
f"Invalid event chain: {v}. Cannot use a Var-returning "
|
||||||
"lambda inside an EventChain list."
|
"lambda inside an EventChain list."
|
||||||
@ -551,7 +561,7 @@ class Component(BaseComponent, ABC):
|
|||||||
# If the input is a callable, create an event chain.
|
# If the input is a callable, create an event chain.
|
||||||
elif isinstance(value, Callable):
|
elif isinstance(value, Callable):
|
||||||
result = call_event_fn(value, args_spec)
|
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.
|
# Recursively call this function if the lambda returned an EventChain Var.
|
||||||
return self._create_event_chain(args_spec, result)
|
return self._create_event_chain(args_spec, result)
|
||||||
events = result
|
events = result
|
||||||
@ -569,7 +579,7 @@ class Component(BaseComponent, ABC):
|
|||||||
event_actions.update(e.event_actions)
|
event_actions.update(e.event_actions)
|
||||||
|
|
||||||
# Return the event chain.
|
# Return the event chain.
|
||||||
if isinstance(args_spec, ImmutableVar):
|
if isinstance(args_spec, Var):
|
||||||
return EventChain(
|
return EventChain(
|
||||||
events=events,
|
events=events,
|
||||||
args_spec=None,
|
args_spec=None,
|
||||||
@ -655,7 +665,7 @@ class Component(BaseComponent, ABC):
|
|||||||
"""
|
"""
|
||||||
# Create the base tag.
|
# Create the base tag.
|
||||||
tag = Tag(
|
tag = Tag(
|
||||||
name=self.tag if not self.alias else self.alias,
|
name=(self.tag if not self.alias else self.alias) or "",
|
||||||
special_props=self.special_props,
|
special_props=self.special_props,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -669,7 +679,7 @@ class Component(BaseComponent, ABC):
|
|||||||
# Add ref to element if `id` is not None.
|
# Add ref to element if `id` is not None.
|
||||||
ref = self.get_ref()
|
ref = self.get_ref()
|
||||||
if ref is not None:
|
if ref is not None:
|
||||||
props["ref"] = ImmutableVar.create(ref)
|
props["ref"] = Var(_js_expr=ref)
|
||||||
else:
|
else:
|
||||||
props = props.copy()
|
props = props.copy()
|
||||||
|
|
||||||
@ -882,7 +892,7 @@ class Component(BaseComponent, ABC):
|
|||||||
Returns:
|
Returns:
|
||||||
The dictionary of the component style as value and the style notation as key.
|
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}
|
return {"css": self.style}
|
||||||
emotion_style = format_as_emotion(self.style)
|
emotion_style = format_as_emotion(self.style)
|
||||||
return (
|
return (
|
||||||
@ -998,8 +1008,8 @@ class Component(BaseComponent, ABC):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_vars_from_event_triggers(
|
def _get_vars_from_event_triggers(
|
||||||
event_triggers: dict[str, EventChain | ImmutableVar],
|
event_triggers: dict[str, EventChain | Var],
|
||||||
) -> Iterator[tuple[str, list[ImmutableVar]]]:
|
) -> Iterator[tuple[str, list[Var]]]:
|
||||||
"""Get the Vars associated with each event trigger.
|
"""Get the Vars associated with each event trigger.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -1009,7 +1019,7 @@ class Component(BaseComponent, ABC):
|
|||||||
tuple of (event_name, event_vars)
|
tuple of (event_name, event_vars)
|
||||||
"""
|
"""
|
||||||
for event_trigger, event in event_triggers.items():
|
for event_trigger, event in event_triggers.items():
|
||||||
if isinstance(event, ImmutableVar):
|
if isinstance(event, Var):
|
||||||
yield event_trigger, [event]
|
yield event_trigger, [event]
|
||||||
elif isinstance(event, EventChain):
|
elif isinstance(event, EventChain):
|
||||||
event_args = []
|
event_args = []
|
||||||
@ -1018,7 +1028,7 @@ class Component(BaseComponent, ABC):
|
|||||||
event_args.extend(args)
|
event_args.extend(args)
|
||||||
yield event_trigger, event_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.
|
"""Walk all Vars used in this component.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -1038,18 +1048,14 @@ class Component(BaseComponent, ABC):
|
|||||||
# Get Vars associated with component props.
|
# Get Vars associated with component props.
|
||||||
for prop in self.get_props():
|
for prop in self.get_props():
|
||||||
prop_var = getattr(self, prop)
|
prop_var = getattr(self, prop)
|
||||||
if isinstance(prop_var, ImmutableVar):
|
if isinstance(prop_var, Var):
|
||||||
vars.append(prop_var)
|
vars.append(prop_var)
|
||||||
|
|
||||||
# Style keeps track of its own VarData instance, so embed in a temp Var that is yielded.
|
# Style keeps track of its own VarData instance, so embed in a temp Var that is yielded.
|
||||||
if (
|
if isinstance(self.style, dict) and self.style or isinstance(self.style, Var):
|
||||||
isinstance(self.style, dict)
|
|
||||||
and self.style
|
|
||||||
or isinstance(self.style, ImmutableVar)
|
|
||||||
):
|
|
||||||
vars.append(
|
vars.append(
|
||||||
ImmutableVar(
|
Var(
|
||||||
_var_name="style",
|
_js_expr="style",
|
||||||
_var_type=str,
|
_var_type=str,
|
||||||
_var_data=VarData.merge(self.style._var_data),
|
_var_data=VarData.merge(self.style._var_data),
|
||||||
)
|
)
|
||||||
@ -1066,7 +1072,7 @@ class Component(BaseComponent, ABC):
|
|||||||
self.autofocus,
|
self.autofocus,
|
||||||
*self.custom_attrs.values(),
|
*self.custom_attrs.values(),
|
||||||
):
|
):
|
||||||
if isinstance(comp_prop, ImmutableVar):
|
if isinstance(comp_prop, Var):
|
||||||
vars.append(comp_prop)
|
vars.append(comp_prop)
|
||||||
elif isinstance(comp_prop, str):
|
elif isinstance(comp_prop, str):
|
||||||
# Collapse VarData encoded in f-strings.
|
# Collapse VarData encoded in f-strings.
|
||||||
@ -1095,7 +1101,7 @@ class Component(BaseComponent, ABC):
|
|||||||
for event in trigger.events:
|
for event in trigger.events:
|
||||||
if event.handler.state_full_name:
|
if event.handler.state_full_name:
|
||||||
return True
|
return True
|
||||||
elif isinstance(trigger, ImmutableVar) and trigger._var_state:
|
elif isinstance(trigger, Var) and trigger._var_state:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -1287,7 +1293,7 @@ class Component(BaseComponent, ABC):
|
|||||||
user_hooks = self._get_hooks()
|
user_hooks = self._get_hooks()
|
||||||
user_hooks_data = (
|
user_hooks_data = (
|
||||||
VarData.merge(user_hooks._get_all_var_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
|
else None
|
||||||
)
|
)
|
||||||
if user_hooks_data is not None:
|
if user_hooks_data is not None:
|
||||||
@ -1390,7 +1396,7 @@ class Component(BaseComponent, ABC):
|
|||||||
"""
|
"""
|
||||||
ref = self.get_ref()
|
ref = self.get_ref()
|
||||||
if ref is not None:
|
if ref is not None:
|
||||||
return f"const {ref} = useRef(null); {str(ImmutableVar.create_safe(ref).as_ref())} = {ref};"
|
return f"const {ref} = useRef(null); {str(Var(_js_expr=ref).as_ref())} = {ref};"
|
||||||
|
|
||||||
def _get_vars_hooks(self) -> dict[str, None]:
|
def _get_vars_hooks(self) -> dict[str, None]:
|
||||||
"""Get the hooks required by vars referenced in this component.
|
"""Get the hooks required by vars referenced in this component.
|
||||||
@ -1453,7 +1459,7 @@ class Component(BaseComponent, ABC):
|
|||||||
"""
|
"""
|
||||||
code = {}
|
code = {}
|
||||||
|
|
||||||
def extract_var_hooks(hook: ImmutableVar):
|
def extract_var_hooks(hook: Var):
|
||||||
_imports = {}
|
_imports = {}
|
||||||
var_data = VarData.merge(hook._get_all_var_data())
|
var_data = VarData.merge(hook._get_all_var_data())
|
||||||
if var_data is not None:
|
if var_data is not None:
|
||||||
@ -1470,7 +1476,7 @@ class Component(BaseComponent, ABC):
|
|||||||
# the order of the hooks in the final output)
|
# the order of the hooks in the final output)
|
||||||
for clz in reversed(tuple(self._iter_parent_classes_with_method("add_hooks"))):
|
for clz in reversed(tuple(self._iter_parent_classes_with_method("add_hooks"))):
|
||||||
for hook in clz.add_hooks(self):
|
for hook in clz.add_hooks(self):
|
||||||
if isinstance(hook, ImmutableVar):
|
if isinstance(hook, Var):
|
||||||
extract_var_hooks(hook)
|
extract_var_hooks(hook)
|
||||||
else:
|
else:
|
||||||
code[hook] = {}
|
code[hook] = {}
|
||||||
@ -1531,7 +1537,7 @@ class Component(BaseComponent, ABC):
|
|||||||
The ref name.
|
The ref name.
|
||||||
"""
|
"""
|
||||||
# do not create a ref if the id is dynamic or unspecified
|
# 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, Var):
|
||||||
return None
|
return None
|
||||||
return format.format_ref(self.id)
|
return format.format_ref(self.id)
|
||||||
|
|
||||||
@ -1770,15 +1776,15 @@ class CustomComponent(Component):
|
|||||||
"""
|
"""
|
||||||
return super()._render(props=self.props)
|
return super()._render(props=self.props)
|
||||||
|
|
||||||
def get_prop_vars(self) -> List[ImmutableVar]:
|
def get_prop_vars(self) -> List[Var]:
|
||||||
"""Get the prop vars.
|
"""Get the prop vars.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The prop vars.
|
The prop vars.
|
||||||
"""
|
"""
|
||||||
return [
|
return [
|
||||||
ImmutableVar(
|
Var(
|
||||||
_var_name=name,
|
_js_expr=name,
|
||||||
_var_type=(
|
_var_type=(
|
||||||
prop._var_type if types._isinstance(prop, Var) else type(prop)
|
prop._var_type if types._isinstance(prop, Var) else type(prop)
|
||||||
),
|
),
|
||||||
@ -1786,7 +1792,7 @@ class CustomComponent(Component):
|
|||||||
for name, prop in self.props.items()
|
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.
|
"""Walk all Vars used in this component.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -1797,7 +1803,7 @@ class CustomComponent(Component):
|
|||||||
"""
|
"""
|
||||||
return (
|
return (
|
||||||
super()._get_vars(include_children=include_children)
|
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)
|
+ self.get_component(self)._get_vars(include_children=include_children)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1968,7 +1974,7 @@ class StatefulComponent(BaseComponent):
|
|||||||
should_memoize = True
|
should_memoize = True
|
||||||
break
|
break
|
||||||
child = cls._child_var(child)
|
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
|
should_memoize = True
|
||||||
break
|
break
|
||||||
|
|
||||||
@ -2124,7 +2130,7 @@ class StatefulComponent(BaseComponent):
|
|||||||
def _get_memoized_event_triggers(
|
def _get_memoized_event_triggers(
|
||||||
cls,
|
cls,
|
||||||
component: Component,
|
component: Component,
|
||||||
) -> dict[str, tuple[ImmutableVar, str]]:
|
) -> dict[str, tuple[Var, str]]:
|
||||||
"""Memoize event handler functions with useCallback to avoid unnecessary re-renders.
|
"""Memoize event handler functions with useCallback to avoid unnecessary re-renders.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -2171,7 +2177,7 @@ class StatefulComponent(BaseComponent):
|
|||||||
|
|
||||||
# Store the memoized function name and hook code for this event trigger.
|
# Store the memoized function name and hook code for this event trigger.
|
||||||
trigger_memo[event_trigger] = (
|
trigger_memo[event_trigger] = (
|
||||||
ImmutableVar.create_safe(memo_name)._replace(
|
Var(_js_expr=memo_name)._replace(
|
||||||
_var_type=EventChain, merge_var_data=memo_var_data
|
_var_type=EventChain, merge_var_data=memo_var_data
|
||||||
),
|
),
|
||||||
f"const {memo_name} = useCallback({rendered_chain}, [{', '.join(var_deps)}])",
|
f"const {memo_name} = useCallback({rendered_chain}, [{', '.join(var_deps)}])",
|
||||||
@ -2244,7 +2250,7 @@ class StatefulComponent(BaseComponent):
|
|||||||
Returns:
|
Returns:
|
||||||
The tag to render.
|
The tag to render.
|
||||||
"""
|
"""
|
||||||
return dict(Tag(name=self.tag))
|
return dict(Tag(name=self.tag or ""))
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
"""Represent the component in React.
|
"""Represent the component in React.
|
||||||
|
@ -18,56 +18,52 @@ from reflex.components.radix.themes.typography.text import Text
|
|||||||
from reflex.components.sonner.toast import Toaster, ToastProps
|
from reflex.components.sonner.toast import Toaster, ToastProps
|
||||||
from reflex.constants import Dirs, Hooks, Imports
|
from reflex.constants import Dirs, Hooks, Imports
|
||||||
from reflex.constants.compiler import CompileVars
|
from reflex.constants.compiler import CompileVars
|
||||||
from reflex.ivars.base import ImmutableVar, LiteralVar
|
|
||||||
from reflex.ivars.function import FunctionStringVar
|
|
||||||
from reflex.ivars.number import BooleanVar
|
|
||||||
from reflex.ivars.sequence import LiteralArrayVar
|
|
||||||
from reflex.utils.imports import ImportVar
|
from reflex.utils.imports import ImportVar
|
||||||
from reflex.vars import Var, VarData
|
from reflex.vars import VarData
|
||||||
|
from reflex.vars.base import LiteralVar, Var
|
||||||
|
from reflex.vars.function import FunctionStringVar
|
||||||
|
from reflex.vars.number import BooleanVar
|
||||||
|
from reflex.vars.sequence import LiteralArrayVar
|
||||||
|
|
||||||
connect_error_var_data: VarData = VarData( # type: ignore
|
connect_error_var_data: VarData = VarData( # type: ignore
|
||||||
imports=Imports.EVENTS,
|
imports=Imports.EVENTS,
|
||||||
hooks={Hooks.EVENTS: None},
|
hooks={Hooks.EVENTS: None},
|
||||||
)
|
)
|
||||||
|
|
||||||
connect_errors: Var = ImmutableVar.create_safe(
|
connect_errors = Var(
|
||||||
value=CompileVars.CONNECT_ERROR,
|
_js_expr=CompileVars.CONNECT_ERROR, _var_data=connect_error_var_data
|
||||||
|
)
|
||||||
|
|
||||||
|
connection_error = Var(
|
||||||
|
_js_expr="((connectErrors.length > 0) ? connectErrors[connectErrors.length - 1].message : '')",
|
||||||
_var_data=connect_error_var_data,
|
_var_data=connect_error_var_data,
|
||||||
)
|
)
|
||||||
|
|
||||||
connection_error: Var = ImmutableVar.create_safe(
|
connection_errors_count = Var(
|
||||||
value="((connectErrors.length > 0) ? connectErrors[connectErrors.length - 1].message : '')",
|
_js_expr="connectErrors.length", _var_data=connect_error_var_data
|
||||||
_var_data=connect_error_var_data,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
connection_errors_count: Var = ImmutableVar.create_safe(
|
has_connection_errors = Var(
|
||||||
value="connectErrors.length",
|
_js_expr="(connectErrors.length > 0)", _var_data=connect_error_var_data
|
||||||
_var_data=connect_error_var_data,
|
|
||||||
)
|
|
||||||
|
|
||||||
has_connection_errors: Var = ImmutableVar.create_safe(
|
|
||||||
value="(connectErrors.length > 0)",
|
|
||||||
_var_data=connect_error_var_data,
|
|
||||||
).to(BooleanVar)
|
).to(BooleanVar)
|
||||||
|
|
||||||
has_too_many_connection_errors: Var = ImmutableVar.create_safe(
|
has_too_many_connection_errors = Var(
|
||||||
value="(connectErrors.length >= 2)",
|
_js_expr="(connectErrors.length >= 2)", _var_data=connect_error_var_data
|
||||||
_var_data=connect_error_var_data,
|
|
||||||
).to(BooleanVar)
|
).to(BooleanVar)
|
||||||
|
|
||||||
|
|
||||||
class WebsocketTargetURL(ImmutableVar):
|
class WebsocketTargetURL(Var):
|
||||||
"""A component that renders the websocket target URL."""
|
"""A component that renders the websocket target URL."""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(cls) -> ImmutableVar:
|
def create(cls) -> Var:
|
||||||
"""Create a websocket target URL component.
|
"""Create a websocket target URL component.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The websocket target URL component.
|
The websocket target URL component.
|
||||||
"""
|
"""
|
||||||
return ImmutableVar(
|
return Var(
|
||||||
_var_name="getBackendURL(env.EVENT).href",
|
_js_expr="getBackendURL(env.EVENT).href",
|
||||||
_var_data=VarData(
|
_var_data=VarData(
|
||||||
imports={
|
imports={
|
||||||
"/env.json": [ImportVar(tag="env", is_default=True)],
|
"/env.json": [ImportVar(tag="env", is_default=True)],
|
||||||
@ -95,7 +91,7 @@ def default_connection_error() -> list[str | Var | Component]:
|
|||||||
class ConnectionToaster(Toaster):
|
class ConnectionToaster(Toaster):
|
||||||
"""A connection toaster component."""
|
"""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.
|
"""Add the hooks for the connection toaster.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@ -125,8 +121,8 @@ class ConnectionToaster(Toaster):
|
|||||||
),
|
),
|
||||||
).call(
|
).call(
|
||||||
# TODO: This breaks the assumption that Vars are JS expressions
|
# TODO: This breaks the assumption that Vars are JS expressions
|
||||||
ImmutableVar.create_safe(
|
Var(
|
||||||
f"""
|
_js_expr=f"""
|
||||||
() => {{
|
() => {{
|
||||||
if ({str(has_too_many_connection_errors)}) {{
|
if ({str(has_too_many_connection_errors)}) {{
|
||||||
if (!userDismissed) {{
|
if (!userDismissed) {{
|
||||||
@ -238,7 +234,7 @@ class WifiOffPulse(Icon):
|
|||||||
Returns:
|
Returns:
|
||||||
The icon component with default props applied.
|
The icon component with default props applied.
|
||||||
"""
|
"""
|
||||||
pulse_var = ImmutableVar.create("pulse")
|
pulse_var = Var(_js_expr="pulse")
|
||||||
return super().create(
|
return super().create(
|
||||||
"wifi_off",
|
"wifi_off",
|
||||||
color=props.pop("color", "crimson"),
|
color=props.pop("color", "crimson"),
|
||||||
|
@ -9,27 +9,40 @@ from reflex.components.component import Component
|
|||||||
from reflex.components.el.elements.typography import Div
|
from reflex.components.el.elements.typography import Div
|
||||||
from reflex.components.lucide.icon import Icon
|
from reflex.components.lucide.icon import Icon
|
||||||
from reflex.components.sonner.toast import Toaster, ToastProps
|
from reflex.components.sonner.toast import Toaster, ToastProps
|
||||||
|
from reflex.constants.compiler import CompileVars
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.utils.imports import ImportVar
|
from reflex.utils.imports import ImportVar
|
||||||
from reflex.vars import Var, VarData
|
from reflex.vars import VarData
|
||||||
|
from reflex.vars.base import Var
|
||||||
|
from reflex.vars.number import BooleanVar
|
||||||
|
|
||||||
connect_error_var_data: VarData
|
connect_error_var_data: VarData
|
||||||
connect_errors: Var
|
connect_errors = Var(
|
||||||
connection_error: Var
|
_js_expr=CompileVars.CONNECT_ERROR, _var_data=connect_error_var_data
|
||||||
connection_errors_count: Var
|
)
|
||||||
has_connection_errors: Var
|
connection_error = Var(
|
||||||
has_too_many_connection_errors: Var
|
_js_expr="((connectErrors.length > 0) ? connectErrors[connectErrors.length - 1].message : '')",
|
||||||
|
_var_data=connect_error_var_data,
|
||||||
|
)
|
||||||
|
connection_errors_count = Var(
|
||||||
|
_js_expr="connectErrors.length", _var_data=connect_error_var_data
|
||||||
|
)
|
||||||
|
has_connection_errors = Var(
|
||||||
|
_js_expr="(connectErrors.length > 0)", _var_data=connect_error_var_data
|
||||||
|
).to(BooleanVar)
|
||||||
|
has_too_many_connection_errors = Var(
|
||||||
|
_js_expr="(connectErrors.length >= 2)", _var_data=connect_error_var_data
|
||||||
|
).to(BooleanVar)
|
||||||
|
|
||||||
class WebsocketTargetURL(ImmutableVar):
|
class WebsocketTargetURL(Var):
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(cls) -> ImmutableVar: ... # type: ignore
|
def create(cls) -> Var: ... # type: ignore
|
||||||
|
|
||||||
def default_connection_error() -> list[str | Var | Component]: ...
|
def default_connection_error() -> list[str | Var | Component]: ...
|
||||||
|
|
||||||
class ConnectionToaster(Toaster):
|
class ConnectionToaster(Toaster):
|
||||||
def add_hooks(self) -> list[str | ImmutableVar]: ...
|
def add_hooks(self) -> list[str | Var]: ...
|
||||||
@overload
|
@overload
|
||||||
@classmethod
|
@classmethod
|
||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
@ -41,24 +54,24 @@ class ConnectionToaster(Toaster):
|
|||||||
visible_toasts: Optional[Union[Var[int], int]] = None,
|
visible_toasts: Optional[Union[Var[int], int]] = None,
|
||||||
position: Optional[
|
position: Optional[
|
||||||
Union[
|
Union[
|
||||||
|
Literal[
|
||||||
|
"bottom-center",
|
||||||
|
"bottom-left",
|
||||||
|
"bottom-right",
|
||||||
|
"top-center",
|
||||||
|
"top-left",
|
||||||
|
"top-right",
|
||||||
|
],
|
||||||
Var[
|
Var[
|
||||||
Literal[
|
Literal[
|
||||||
"top-left",
|
|
||||||
"top-center",
|
|
||||||
"top-right",
|
|
||||||
"bottom-left",
|
|
||||||
"bottom-center",
|
"bottom-center",
|
||||||
|
"bottom-left",
|
||||||
"bottom-right",
|
"bottom-right",
|
||||||
|
"top-center",
|
||||||
|
"top-left",
|
||||||
|
"top-right",
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
Literal[
|
|
||||||
"top-left",
|
|
||||||
"top-center",
|
|
||||||
"top-right",
|
|
||||||
"bottom-left",
|
|
||||||
"bottom-center",
|
|
||||||
"bottom-right",
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
close_button: Optional[Union[Var[bool], bool]] = None,
|
close_button: Optional[Union[Var[bool], bool]] = None,
|
||||||
@ -66,60 +79,50 @@ class ConnectionToaster(Toaster):
|
|||||||
dir: Optional[Union[Var[str], str]] = None,
|
dir: Optional[Union[Var[str], str]] = None,
|
||||||
hotkey: Optional[Union[Var[str], str]] = None,
|
hotkey: Optional[Union[Var[str], str]] = None,
|
||||||
invert: Optional[Union[Var[bool], bool]] = None,
|
invert: Optional[Union[Var[bool], bool]] = None,
|
||||||
toast_options: Optional[Union[Var[ToastProps], ToastProps]] = None,
|
toast_options: Optional[Union[ToastProps, Var[ToastProps]]] = None,
|
||||||
gap: Optional[Union[Var[int], int]] = None,
|
gap: Optional[Union[Var[int], int]] = None,
|
||||||
loading_icon: Optional[Union[Var[Icon], Icon]] = None,
|
loading_icon: Optional[Union[Icon, Var[Icon]]] = None,
|
||||||
pause_when_page_is_hidden: Optional[Union[Var[bool], bool]] = None,
|
pause_when_page_is_hidden: Optional[Union[Var[bool], bool]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "ConnectionToaster":
|
) -> "ConnectionToaster":
|
||||||
@ -165,51 +168,41 @@ class ConnectionBanner(Component):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "ConnectionBanner":
|
) -> "ConnectionBanner":
|
||||||
@ -234,51 +227,41 @@ class ConnectionModal(Component):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "ConnectionModal":
|
) -> "ConnectionModal":
|
||||||
@ -304,51 +287,41 @@ class WifiOffPulse(Icon):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "WifiOffPulse":
|
) -> "WifiOffPulse":
|
||||||
@ -378,80 +351,70 @@ class ConnectionPulser(Div):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "ConnectionPulser":
|
) -> "ConnectionPulser":
|
||||||
|
@ -13,10 +13,9 @@ from __future__ import annotations
|
|||||||
from reflex import constants
|
from reflex import constants
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.components.core.cond import cond
|
from reflex.components.core.cond import cond
|
||||||
from reflex.ivars.base import ImmutableVar
|
from reflex.vars.base import Var
|
||||||
from reflex.vars import Var
|
|
||||||
|
|
||||||
route_not_found: Var = ImmutableVar.create_safe(constants.ROUTE_NOT_FOUND)
|
route_not_found: Var = Var(_js_expr=constants.ROUTE_NOT_FOUND)
|
||||||
|
|
||||||
|
|
||||||
class ClientSideRouting(Component):
|
class ClientSideRouting(Component):
|
||||||
|
@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload
|
|||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
route_not_found: Var
|
route_not_found: Var
|
||||||
|
|
||||||
@ -26,51 +25,41 @@ class ClientSideRouting(Component):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "ClientSideRouting":
|
) -> "ClientSideRouting":
|
||||||
@ -105,51 +94,41 @@ class Default404Page(Component):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Default404Page":
|
) -> "Default404Page":
|
||||||
|
@ -9,7 +9,8 @@ from reflex.components.tags.tag import Tag
|
|||||||
from reflex.event import EventChain, EventHandler
|
from reflex.event import EventChain, EventHandler
|
||||||
from reflex.utils.format import format_prop, wrap
|
from reflex.utils.format import format_prop, wrap
|
||||||
from reflex.utils.imports import ImportVar
|
from reflex.utils.imports import ImportVar
|
||||||
from reflex.vars import Var, get_unique_variable_name
|
from reflex.vars import get_unique_variable_name
|
||||||
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
|
|
||||||
class Clipboard(Fragment):
|
class Clipboard(Fragment):
|
||||||
|
@ -7,10 +7,9 @@ from typing import Any, Callable, Dict, List, Optional, Union, overload
|
|||||||
|
|
||||||
from reflex.components.base.fragment import Fragment
|
from reflex.components.base.fragment import Fragment
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.utils.imports import ImportVar
|
from reflex.utils.imports import ImportVar
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
class Clipboard(Fragment):
|
class Clipboard(Fragment):
|
||||||
@overload
|
@overload
|
||||||
@ -18,63 +17,51 @@ class Clipboard(Fragment):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
targets: Optional[Union[Var[List[str]], List[str]]] = None,
|
targets: Optional[Union[List[str], Var[List[str]]]] = None,
|
||||||
on_paste_event_actions: Optional[
|
on_paste_event_actions: Optional[
|
||||||
Union[Var[Dict[str, Union[bool, int]]], Dict[str, Union[bool, int]]]
|
Union[Dict[str, Union[bool, int]], Var[Dict[str, Union[bool, int]]]]
|
||||||
] = None,
|
] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_paste: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_paste: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Clipboard":
|
) -> "Clipboard":
|
||||||
|
@ -8,11 +8,11 @@ from reflex.components.base.fragment import Fragment
|
|||||||
from reflex.components.component import BaseComponent, Component, MemoizationLeaf
|
from reflex.components.component import BaseComponent, Component, MemoizationLeaf
|
||||||
from reflex.components.tags import CondTag, Tag
|
from reflex.components.tags import CondTag, Tag
|
||||||
from reflex.constants import Dirs
|
from reflex.constants import Dirs
|
||||||
from reflex.ivars.base import ImmutableVar, LiteralVar
|
|
||||||
from reflex.ivars.number import ternary_operation
|
|
||||||
from reflex.style import LIGHT_COLOR_MODE, resolved_color_mode
|
from reflex.style import LIGHT_COLOR_MODE, resolved_color_mode
|
||||||
from reflex.utils.imports import ImportDict, ImportVar
|
from reflex.utils.imports import ImportDict, ImportVar
|
||||||
from reflex.vars import Var, VarData
|
from reflex.vars import VarData
|
||||||
|
from reflex.vars.base import LiteralVar, Var
|
||||||
|
from reflex.vars.number import ternary_operation
|
||||||
|
|
||||||
_IS_TRUE_IMPORT: ImportDict = {
|
_IS_TRUE_IMPORT: ImportDict = {
|
||||||
f"/{Dirs.STATE_PATH}": [ImportVar(tag="isTrue")],
|
f"/{Dirs.STATE_PATH}": [ImportVar(tag="isTrue")],
|
||||||
@ -119,10 +119,10 @@ def cond(condition: Any, c1: Component) -> Component: ...
|
|||||||
|
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
def cond(condition: Any, c1: Any, c2: Any) -> ImmutableVar: ...
|
def cond(condition: Any, c1: Any, c2: Any) -> Var: ...
|
||||||
|
|
||||||
|
|
||||||
def cond(condition: Any, c1: Any, c2: Any = None) -> Component | ImmutableVar:
|
def cond(condition: Any, c1: Any, c2: Any = None) -> Component | Var:
|
||||||
"""Create a conditional component or Prop.
|
"""Create a conditional component or Prop.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -7,8 +7,8 @@ from typing import Any, Type, Union
|
|||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.constants import EventTriggers
|
from reflex.constants import EventTriggers
|
||||||
from reflex.event import EventHandler
|
from reflex.event import EventHandler
|
||||||
from reflex.ivars.base import ImmutableVar
|
from reflex.vars import VarData
|
||||||
from reflex.vars import Var, VarData
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
DEFAULT_DEBOUNCE_TIMEOUT = 300
|
DEFAULT_DEBOUNCE_TIMEOUT = 300
|
||||||
|
|
||||||
@ -107,14 +107,14 @@ class DebounceInput(Component):
|
|||||||
props[field] = getattr(child, field)
|
props[field] = getattr(child, field)
|
||||||
child_ref = child.get_ref()
|
child_ref = child.get_ref()
|
||||||
if props.get("input_ref") is None and child_ref:
|
if props.get("input_ref") is None and child_ref:
|
||||||
props["input_ref"] = ImmutableVar.create_safe(child_ref)
|
props["input_ref"] = Var(_js_expr=child_ref, _var_type=str)
|
||||||
props["id"] = child.id
|
props["id"] = child.id
|
||||||
|
|
||||||
# Set the child element to wrap, including any imports/hooks from the child.
|
# Set the child element to wrap, including any imports/hooks from the child.
|
||||||
props.setdefault(
|
props.setdefault(
|
||||||
"element",
|
"element",
|
||||||
ImmutableVar(
|
Var(
|
||||||
_var_name=str(child.alias or child.tag),
|
_js_expr=str(child.alias or child.tag),
|
||||||
_var_type=Type[Component],
|
_var_type=Type[Component],
|
||||||
_var_data=VarData(
|
_var_data=VarData(
|
||||||
imports=child._get_imports(),
|
imports=child._get_imports(),
|
||||||
|
@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Type, Union, overload
|
|||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
DEFAULT_DEBOUNCE_TIMEOUT = 300
|
DEFAULT_DEBOUNCE_TIMEOUT = 300
|
||||||
|
|
||||||
@ -23,62 +22,50 @@ class DebounceInput(Component):
|
|||||||
debounce_timeout: Optional[Union[Var[int], int]] = None,
|
debounce_timeout: Optional[Union[Var[int], int]] = None,
|
||||||
force_notify_by_enter: Optional[Union[Var[bool], bool]] = None,
|
force_notify_by_enter: Optional[Union[Var[bool], bool]] = None,
|
||||||
force_notify_on_blur: Optional[Union[Var[bool], bool]] = None,
|
force_notify_on_blur: Optional[Union[Var[bool], bool]] = None,
|
||||||
value: Optional[Union[Var[Union[float, int, str]], str, int, float]] = None,
|
value: Optional[Union[Var[Union[float, int, str]], float, int, str]] = None,
|
||||||
input_ref: Optional[Union[Var[str], str]] = None,
|
input_ref: Optional[Union[Var[str], str]] = None,
|
||||||
element: Optional[Union[Var[Type[Component]], Type[Component]]] = None,
|
element: Optional[Union[Type[Component], Var[Type[Component]]]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_change: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "DebounceInput":
|
) -> "DebounceInput":
|
||||||
|
@ -9,9 +9,8 @@ from reflex.components.base.fragment import Fragment
|
|||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.components.tags import IterTag
|
from reflex.components.tags import IterTag
|
||||||
from reflex.constants import MemoizationMode
|
from reflex.constants import MemoizationMode
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.state import ComponentState
|
from reflex.state import ComponentState
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import LiteralVar, Var
|
||||||
|
|
||||||
|
|
||||||
class ForeachVarError(TypeError):
|
class ForeachVarError(TypeError):
|
||||||
@ -52,7 +51,7 @@ class Foreach(Component):
|
|||||||
ForeachVarError: If the iterable is of type Any.
|
ForeachVarError: If the iterable is of type Any.
|
||||||
TypeError: If the render function is a ComponentState.
|
TypeError: If the render function is a ComponentState.
|
||||||
"""
|
"""
|
||||||
iterable = ImmutableVar.create_safe(iterable)
|
iterable = LiteralVar.create(iterable)
|
||||||
if iterable._var_type == Any:
|
if iterable._var_type == Any:
|
||||||
raise ForeachVarError(
|
raise ForeachVarError(
|
||||||
f"Could not foreach over var `{str(iterable)}` of type Any. "
|
f"Could not foreach over var `{str(iterable)}` of type Any. "
|
||||||
@ -130,7 +129,7 @@ class Foreach(Component):
|
|||||||
iterable_state=str(tag.iterable),
|
iterable_state=str(tag.iterable),
|
||||||
arg_name=tag.arg_var_name,
|
arg_name=tag.arg_var_name,
|
||||||
arg_index=tag.get_index_var_arg(),
|
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__,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
from reflex.components.el.elements.typography import Div
|
from reflex.components.el.elements.typography import Div
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
|
|
||||||
class Html(Div):
|
class Html(Div):
|
||||||
|
@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload
|
|||||||
|
|
||||||
from reflex.components.el.elements.typography import Div
|
from reflex.components.el.elements.typography import Div
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
class Html(Div):
|
class Html(Div):
|
||||||
@overload
|
@overload
|
||||||
@ -18,82 +17,72 @@ class Html(Div):
|
|||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
dangerouslySetInnerHTML: Optional[
|
dangerouslySetInnerHTML: Optional[
|
||||||
Union[Var[Dict[str, str]], Dict[str, str]]
|
Union[Dict[str, str], Var[Dict[str, str]]]
|
||||||
] = None,
|
] = None,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Html":
|
) -> "Html":
|
||||||
|
@ -6,12 +6,12 @@ from typing import Any, Dict, List, Optional, Tuple, Union
|
|||||||
from reflex.components.base import Fragment
|
from reflex.components.base import Fragment
|
||||||
from reflex.components.component import BaseComponent, Component, MemoizationLeaf
|
from reflex.components.component import BaseComponent, Component, MemoizationLeaf
|
||||||
from reflex.components.tags import MatchTag, Tag
|
from reflex.components.tags import MatchTag, Tag
|
||||||
from reflex.ivars.base import ImmutableVar, LiteralVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.utils import format, types
|
from reflex.utils import format, types
|
||||||
from reflex.utils.exceptions import MatchTypeError
|
from reflex.utils.exceptions import MatchTypeError
|
||||||
from reflex.utils.imports import ImportDict
|
from reflex.utils.imports import ImportDict
|
||||||
from reflex.vars import Var, VarData
|
from reflex.vars import VarData
|
||||||
|
from reflex.vars.base import LiteralVar, Var
|
||||||
|
|
||||||
|
|
||||||
class Match(MemoizationLeaf):
|
class Match(MemoizationLeaf):
|
||||||
@ -27,7 +27,7 @@ class Match(MemoizationLeaf):
|
|||||||
default: Any
|
default: Any
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(cls, cond: Any, *cases) -> Union[Component, ImmutableVar]:
|
def create(cls, cond: Any, *cases) -> Union[Component, Var]:
|
||||||
"""Create a Match Component.
|
"""Create a Match Component.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -56,7 +56,7 @@ class Match(MemoizationLeaf):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _create_condition_var(cls, cond: Any) -> ImmutableVar:
|
def _create_condition_var(cls, cond: Any) -> Var:
|
||||||
"""Convert the condition to a Var.
|
"""Convert the condition to a Var.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -77,7 +77,7 @@ class Match(MemoizationLeaf):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def _process_cases(
|
def _process_cases(
|
||||||
cls, cases: List
|
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.
|
"""Process the list of match cases and the catchall default case.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -125,7 +125,7 @@ class Match(MemoizationLeaf):
|
|||||||
return case_element
|
return case_element
|
||||||
|
|
||||||
@classmethod
|
@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.
|
"""Process the individual match cases.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -157,7 +157,7 @@ class Match(MemoizationLeaf):
|
|||||||
if not isinstance(element, BaseComponent)
|
if not isinstance(element, BaseComponent)
|
||||||
else element
|
else element
|
||||||
)
|
)
|
||||||
if not isinstance(el, (ImmutableVar, BaseComponent)):
|
if not isinstance(el, (Var, BaseComponent)):
|
||||||
raise ValueError("Case element must be a var or component")
|
raise ValueError("Case element must be a var or component")
|
||||||
case_list.append(el)
|
case_list.append(el)
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ class Match(MemoizationLeaf):
|
|||||||
return match_cases
|
return match_cases
|
||||||
|
|
||||||
@classmethod
|
@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.
|
"""Validate that match cases have the same return types.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -180,24 +180,24 @@ class Match(MemoizationLeaf):
|
|||||||
|
|
||||||
if types._isinstance(first_case_return, BaseComponent):
|
if types._isinstance(first_case_return, BaseComponent):
|
||||||
return_type = BaseComponent
|
return_type = BaseComponent
|
||||||
elif types._isinstance(first_case_return, ImmutableVar):
|
elif types._isinstance(first_case_return, Var):
|
||||||
return_type = ImmutableVar
|
return_type = Var
|
||||||
|
|
||||||
for index, case in enumerate(match_cases):
|
for index, case in enumerate(match_cases):
|
||||||
if not types._issubclass(type(case[-1]), return_type):
|
if not types._issubclass(type(case[-1]), return_type):
|
||||||
raise MatchTypeError(
|
raise MatchTypeError(
|
||||||
f"Match cases should have the same return types. Case {index} with return "
|
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]._js_expr if isinstance(case[-1], Var) else textwrap.shorten(str(case[-1]), width=250)}`"
|
||||||
f" of type {type(case[-1])!r} is not {return_type}"
|
f" of type {type(case[-1])!r} is not {return_type}"
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _create_match_cond_var_or_component(
|
def _create_match_cond_var_or_component(
|
||||||
cls,
|
cls,
|
||||||
match_cond_var: ImmutableVar,
|
match_cond_var: Var,
|
||||||
match_cases: List[List[ImmutableVar]],
|
match_cases: List[List[Var]],
|
||||||
default: Optional[Union[ImmutableVar, BaseComponent]],
|
default: Optional[Union[Var, BaseComponent]],
|
||||||
) -> Union[Component, ImmutableVar]:
|
) -> Union[Component, Var]:
|
||||||
"""Create and return the match condition var or component.
|
"""Create and return the match condition var or component.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -232,8 +232,8 @@ class Match(MemoizationLeaf):
|
|||||||
) or not types._isinstance(default, Var):
|
) or not types._isinstance(default, Var):
|
||||||
raise ValueError("Return types of match cases should be Vars.")
|
raise ValueError("Return types of match cases should be Vars.")
|
||||||
|
|
||||||
return ImmutableVar(
|
return Var(
|
||||||
_var_name=format.format_match(
|
_js_expr=format.format_match(
|
||||||
cond=str(match_cond_var),
|
cond=str(match_cond_var),
|
||||||
match_cases=match_cases,
|
match_cases=match_cases,
|
||||||
default=default, # type: ignore
|
default=default, # type: ignore
|
||||||
|
@ -19,10 +19,10 @@ from reflex.event import (
|
|||||||
call_script,
|
call_script,
|
||||||
parse_args_spec,
|
parse_args_spec,
|
||||||
)
|
)
|
||||||
from reflex.ivars.base import ImmutableCallableVar, ImmutableVar, LiteralVar
|
|
||||||
from reflex.ivars.sequence import LiteralStringVar
|
|
||||||
from reflex.utils.imports import ImportVar
|
from reflex.utils.imports import ImportVar
|
||||||
from reflex.vars import Var, VarData
|
from reflex.vars import VarData
|
||||||
|
from reflex.vars.base import CallableVar, LiteralVar, Var
|
||||||
|
from reflex.vars.sequence import LiteralStringVar
|
||||||
|
|
||||||
DEFAULT_UPLOAD_ID: str = "default"
|
DEFAULT_UPLOAD_ID: str = "default"
|
||||||
|
|
||||||
@ -37,8 +37,8 @@ upload_files_context_var_data: VarData = VarData(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ImmutableCallableVar
|
@CallableVar
|
||||||
def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar:
|
def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> Var:
|
||||||
"""Get the file upload drop trigger.
|
"""Get the file upload drop trigger.
|
||||||
|
|
||||||
This var is passed to the dropzone component to update the file list when a
|
This var is passed to the dropzone component to update the file list when a
|
||||||
@ -58,8 +58,8 @@ def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar:
|
|||||||
}})
|
}})
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return ImmutableVar(
|
return Var(
|
||||||
_var_name=var_name,
|
_js_expr=var_name,
|
||||||
_var_type=EventChain,
|
_var_type=EventChain,
|
||||||
_var_data=VarData.merge(
|
_var_data=VarData.merge(
|
||||||
upload_files_context_var_data, id_var._get_all_var_data()
|
upload_files_context_var_data, id_var._get_all_var_data()
|
||||||
@ -67,8 +67,8 @@ def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ImmutableCallableVar
|
@CallableVar
|
||||||
def selected_files(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar:
|
def selected_files(id_: str = DEFAULT_UPLOAD_ID) -> Var:
|
||||||
"""Get the list of selected files.
|
"""Get the list of selected files.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -78,8 +78,8 @@ def selected_files(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar:
|
|||||||
A var referencing the list of selected file paths.
|
A var referencing the list of selected file paths.
|
||||||
"""
|
"""
|
||||||
id_var = LiteralStringVar.create(id_)
|
id_var = LiteralStringVar.create(id_)
|
||||||
return ImmutableVar(
|
return Var(
|
||||||
_var_name=f"(filesById[{str(id_var)}] ? filesById[{str(id_var)}].map((f) => (f.path || f.name)) : [])",
|
_js_expr=f"(filesById[{str(id_var)}] ? filesById[{str(id_var)}].map((f) => (f.path || f.name)) : [])",
|
||||||
_var_type=List[str],
|
_var_type=List[str],
|
||||||
_var_data=VarData.merge(
|
_var_data=VarData.merge(
|
||||||
upload_files_context_var_data, id_var._get_all_var_data()
|
upload_files_context_var_data, id_var._get_all_var_data()
|
||||||
@ -132,8 +132,8 @@ def get_upload_dir() -> Path:
|
|||||||
return uploaded_files_dir
|
return uploaded_files_dir
|
||||||
|
|
||||||
|
|
||||||
uploaded_files_url_prefix = ImmutableVar(
|
uploaded_files_url_prefix = Var(
|
||||||
_var_name="getBackendURL(env.UPLOAD)",
|
_js_expr="getBackendURL(env.UPLOAD)",
|
||||||
_var_data=VarData(
|
_var_data=VarData(
|
||||||
imports={
|
imports={
|
||||||
f"/{Dirs.STATE_PATH}": "getBackendURL",
|
f"/{Dirs.STATE_PATH}": "getBackendURL",
|
||||||
@ -247,9 +247,7 @@ class Upload(MemoizationLeaf):
|
|||||||
}
|
}
|
||||||
# The file input to use.
|
# The file input to use.
|
||||||
upload = Input.create(type="file")
|
upload = Input.create(type="file")
|
||||||
upload.special_props = {
|
upload.special_props = [Var(_js_expr="{...getInputProps()}", _var_type=None)]
|
||||||
ImmutableVar(_var_name="{...getInputProps()}", _var_type=None)
|
|
||||||
}
|
|
||||||
|
|
||||||
# The dropzone to use.
|
# The dropzone to use.
|
||||||
zone = Box.create(
|
zone = Box.create(
|
||||||
@ -257,9 +255,7 @@ class Upload(MemoizationLeaf):
|
|||||||
*children,
|
*children,
|
||||||
**{k: v for k, v in props.items() if k not in supported_props},
|
**{k: v for k, v in props.items() if k not in supported_props},
|
||||||
)
|
)
|
||||||
zone.special_props = {
|
zone.special_props = [Var(_js_expr="{...getRootProps()}", _var_type=None)]
|
||||||
ImmutableVar(_var_name="{...getRootProps()}", _var_type=None)
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create the component.
|
# Create the component.
|
||||||
upload_props["id"] = props.get("id", DEFAULT_UPLOAD_ID)
|
upload_props["id"] = props.get("id", DEFAULT_UPLOAD_ID)
|
||||||
@ -287,9 +283,7 @@ class Upload(MemoizationLeaf):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _update_arg_tuple_for_on_drop(
|
def _update_arg_tuple_for_on_drop(cls, arg_value: tuple[Var, Var]):
|
||||||
cls, arg_value: tuple[ImmutableVar, ImmutableVar]
|
|
||||||
):
|
|
||||||
"""Helper to update caller-provided EventSpec args for direct use with on_drop.
|
"""Helper to update caller-provided EventSpec args for direct use with on_drop.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -298,7 +292,7 @@ class Upload(MemoizationLeaf):
|
|||||||
Returns:
|
Returns:
|
||||||
The updated arg_value tuple when arg is "files", otherwise the original arg_value.
|
The updated arg_value tuple when arg is "files", otherwise the original arg_value.
|
||||||
"""
|
"""
|
||||||
if arg_value[0]._var_name == "files":
|
if arg_value[0]._js_expr == "files":
|
||||||
placeholder = parse_args_spec(_on_drop_spec)[0]
|
placeholder = parse_args_spec(_on_drop_spec)[0]
|
||||||
return (arg_value[0], placeholder)
|
return (arg_value[0], placeholder)
|
||||||
return arg_value
|
return arg_value
|
||||||
|
@ -13,25 +13,25 @@ from reflex.event import (
|
|||||||
EventHandler,
|
EventHandler,
|
||||||
EventSpec,
|
EventSpec,
|
||||||
)
|
)
|
||||||
from reflex.ivars.base import ImmutableCallableVar, ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.utils.imports import ImportVar
|
from reflex.utils.imports import ImportVar
|
||||||
from reflex.vars import Var, VarData
|
from reflex.vars import VarData
|
||||||
|
from reflex.vars.base import CallableVar, Var
|
||||||
|
|
||||||
DEFAULT_UPLOAD_ID: str
|
DEFAULT_UPLOAD_ID: str
|
||||||
upload_files_context_var_data: VarData
|
upload_files_context_var_data: VarData
|
||||||
|
|
||||||
@ImmutableCallableVar
|
@CallableVar
|
||||||
def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar: ...
|
def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> Var: ...
|
||||||
@ImmutableCallableVar
|
@CallableVar
|
||||||
def selected_files(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar: ...
|
def selected_files(id_: str = DEFAULT_UPLOAD_ID) -> Var: ...
|
||||||
@CallableEventSpec
|
@CallableEventSpec
|
||||||
def clear_selected_files(id_: str = DEFAULT_UPLOAD_ID) -> EventSpec: ...
|
def clear_selected_files(id_: str = DEFAULT_UPLOAD_ID) -> EventSpec: ...
|
||||||
def cancel_upload(upload_id: str) -> EventSpec: ...
|
def cancel_upload(upload_id: str) -> EventSpec: ...
|
||||||
def get_upload_dir() -> Path: ...
|
def get_upload_dir() -> Path: ...
|
||||||
|
|
||||||
uploaded_files_url_prefix = ImmutableVar(
|
uploaded_files_url_prefix = Var(
|
||||||
_var_name="getBackendURL(env.UPLOAD)",
|
_js_expr="getBackendURL(env.UPLOAD)",
|
||||||
_var_data=VarData(
|
_var_data=VarData(
|
||||||
imports={
|
imports={
|
||||||
f"/{Dirs.STATE_PATH}": "getBackendURL",
|
f"/{Dirs.STATE_PATH}": "getBackendURL",
|
||||||
@ -53,51 +53,41 @@ class UploadFilesProvider(Component):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "UploadFilesProvider":
|
) -> "UploadFilesProvider":
|
||||||
@ -126,7 +116,7 @@ class Upload(MemoizationLeaf):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
accept: Optional[Union[Var[Optional[Dict[str, List]]], Dict[str, List]]] = None,
|
accept: Optional[Union[Dict[str, List], Var[Optional[Dict[str, List]]]]] = None,
|
||||||
disabled: Optional[Union[Var[bool], bool]] = None,
|
disabled: Optional[Union[Var[bool], bool]] = None,
|
||||||
max_files: Optional[Union[Var[int], int]] = None,
|
max_files: Optional[Union[Var[int], int]] = None,
|
||||||
max_size: Optional[Union[Var[int], int]] = None,
|
max_size: Optional[Union[Var[int], int]] = None,
|
||||||
@ -140,54 +130,42 @@ class Upload(MemoizationLeaf):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_drop: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = 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[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Upload":
|
) -> "Upload":
|
||||||
@ -223,7 +201,7 @@ class StyledUpload(Upload):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
accept: Optional[Union[Var[Optional[Dict[str, List]]], Dict[str, List]]] = None,
|
accept: Optional[Union[Dict[str, List], Var[Optional[Dict[str, List]]]]] = None,
|
||||||
disabled: Optional[Union[Var[bool], bool]] = None,
|
disabled: Optional[Union[Var[bool], bool]] = None,
|
||||||
max_files: Optional[Union[Var[int], int]] = None,
|
max_files: Optional[Union[Var[int], int]] = None,
|
||||||
max_size: Optional[Union[Var[int], int]] = None,
|
max_size: Optional[Union[Var[int], int]] = None,
|
||||||
@ -237,54 +215,42 @@ class StyledUpload(Upload):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_drop: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = 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[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "StyledUpload":
|
) -> "StyledUpload":
|
||||||
@ -320,7 +286,7 @@ class UploadNamespace(ComponentNamespace):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def __call__(
|
def __call__(
|
||||||
*children,
|
*children,
|
||||||
accept: Optional[Union[Var[Optional[Dict[str, List]]], Dict[str, List]]] = None,
|
accept: Optional[Union[Dict[str, List], Var[Optional[Dict[str, List]]]]] = None,
|
||||||
disabled: Optional[Union[Var[bool], bool]] = None,
|
disabled: Optional[Union[Var[bool], bool]] = None,
|
||||||
max_files: Optional[Union[Var[int], int]] = None,
|
max_files: Optional[Union[Var[int], int]] = None,
|
||||||
max_size: Optional[Union[Var[int], int]] = None,
|
max_size: Optional[Union[Var[int], int]] = None,
|
||||||
@ -334,54 +300,42 @@ class UploadNamespace(ComponentNamespace):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_drop: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = 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[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "StyledUpload":
|
) -> "StyledUpload":
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Dict, Literal, Optional, Union
|
from typing import Any, Dict, Literal, Optional, Union
|
||||||
|
|
||||||
from typing_extensions import get_args
|
from typing_extensions import get_args
|
||||||
|
|
||||||
@ -13,11 +13,10 @@ from reflex.components.radix.themes.components.button import Button
|
|||||||
from reflex.components.radix.themes.layout.box import Box
|
from reflex.components.radix.themes.layout.box import Box
|
||||||
from reflex.constants.colors import Color
|
from reflex.constants.colors import Color
|
||||||
from reflex.event import set_clipboard
|
from reflex.event import set_clipboard
|
||||||
from reflex.ivars.base import ImmutableVar, LiteralVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.utils import format
|
from reflex.utils import format
|
||||||
from reflex.utils.imports import ImportDict, ImportVar
|
from reflex.utils.imports import ImportDict, ImportVar
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import LiteralVar, Var
|
||||||
|
|
||||||
LiteralCodeBlockTheme = Literal[
|
LiteralCodeBlockTheme = Literal[
|
||||||
"a11y-dark",
|
"a11y-dark",
|
||||||
@ -375,7 +374,7 @@ class CodeBlock(Component):
|
|||||||
alias = "SyntaxHighlighter"
|
alias = "SyntaxHighlighter"
|
||||||
|
|
||||||
# The theme to use ("light" or "dark").
|
# The theme to use ("light" or "dark").
|
||||||
theme: Var[LiteralCodeBlockTheme] = "one-light" # type: ignore
|
theme: Var[Any] = "one-light" # type: ignore
|
||||||
|
|
||||||
# The language to use.
|
# The language to use.
|
||||||
language: Var[LiteralCodeLanguage] = "python" # type: ignore
|
language: Var[LiteralCodeLanguage] = "python" # type: ignore
|
||||||
@ -481,13 +480,13 @@ class CodeBlock(Component):
|
|||||||
if "theme" not in props:
|
if "theme" not in props:
|
||||||
# Default color scheme responds to global color mode.
|
# Default color scheme responds to global color mode.
|
||||||
props["theme"] = color_mode_cond(
|
props["theme"] = color_mode_cond(
|
||||||
light=ImmutableVar.create_safe("oneLight"),
|
light=Var(_js_expr="oneLight"),
|
||||||
dark=ImmutableVar.create_safe("oneDark"),
|
dark=Var(_js_expr="oneDark"),
|
||||||
)
|
)
|
||||||
|
|
||||||
# react-syntax-highlighter doesnt have an explicit "light" or "dark" theme so we use one-light and one-dark
|
# 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.
|
# 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"])
|
props["theme"] = cls.convert_theme_name(props["theme"])
|
||||||
|
|
||||||
if can_copy:
|
if can_copy:
|
||||||
@ -513,7 +512,7 @@ class CodeBlock(Component):
|
|||||||
# Carry the children (code) via props
|
# Carry the children (code) via props
|
||||||
if children:
|
if children:
|
||||||
props["code"] = children[0]
|
props["code"] = children[0]
|
||||||
if not isinstance(props["code"], ImmutableVar):
|
if not isinstance(props["code"], Var):
|
||||||
props["code"] = LiteralVar.create(props["code"])
|
props["code"] = LiteralVar.create(props["code"])
|
||||||
|
|
||||||
# Create the component.
|
# Create the component.
|
||||||
@ -534,8 +533,8 @@ class CodeBlock(Component):
|
|||||||
def _render(self):
|
def _render(self):
|
||||||
out = super()._render()
|
out = super()._render()
|
||||||
|
|
||||||
theme = self.theme.upcast()._replace(
|
theme = self.theme._replace(
|
||||||
_var_name=replace_quotes_with_camel_case(str(self.theme))
|
_js_expr=replace_quotes_with_camel_case(str(self.theme))
|
||||||
)
|
)
|
||||||
|
|
||||||
out.add_props(style=theme).remove_props("theme", "code").add_props(
|
out.add_props(style=theme).remove_props("theme", "code").add_props(
|
||||||
|
@ -8,10 +8,9 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload
|
|||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.constants.colors import Color
|
from reflex.constants.colors import Color
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.utils.imports import ImportDict
|
from reflex.utils.imports import ImportDict
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
LiteralCodeBlockTheme = Literal[
|
LiteralCodeBlockTheme = Literal[
|
||||||
"a11y-dark",
|
"a11y-dark",
|
||||||
@ -353,108 +352,290 @@ class CodeBlock(Component):
|
|||||||
*children,
|
*children,
|
||||||
can_copy: Optional[bool] = False,
|
can_copy: Optional[bool] = False,
|
||||||
copy_button: Optional[Union[Component, bool]] = None,
|
copy_button: Optional[Union[Component, bool]] = None,
|
||||||
theme: Optional[
|
theme: Optional[Union[Any, Var[Any]]] = None,
|
||||||
Union[
|
|
||||||
Var[
|
|
||||||
Literal[
|
|
||||||
"a11y-dark",
|
|
||||||
"atom-dark",
|
|
||||||
"cb",
|
|
||||||
"coldark-cold",
|
|
||||||
"coldark-dark",
|
|
||||||
"coy",
|
|
||||||
"coy-without-shadows",
|
|
||||||
"darcula",
|
|
||||||
"dark",
|
|
||||||
"dracula",
|
|
||||||
"duotone-dark",
|
|
||||||
"duotone-earth",
|
|
||||||
"duotone-forest",
|
|
||||||
"duotone-light",
|
|
||||||
"duotone-sea",
|
|
||||||
"duotone-space",
|
|
||||||
"funky",
|
|
||||||
"ghcolors",
|
|
||||||
"gruvbox-dark",
|
|
||||||
"gruvbox-light",
|
|
||||||
"holi-theme",
|
|
||||||
"hopscotch",
|
|
||||||
"light",
|
|
||||||
"lucario",
|
|
||||||
"material-dark",
|
|
||||||
"material-light",
|
|
||||||
"material-oceanic",
|
|
||||||
"night-owl",
|
|
||||||
"nord",
|
|
||||||
"okaidia",
|
|
||||||
"one-dark",
|
|
||||||
"one-light",
|
|
||||||
"pojoaque",
|
|
||||||
"prism",
|
|
||||||
"shades-of-purple",
|
|
||||||
"solarized-dark-atom",
|
|
||||||
"solarizedlight",
|
|
||||||
"synthwave84",
|
|
||||||
"tomorrow",
|
|
||||||
"twilight",
|
|
||||||
"vs",
|
|
||||||
"vs-dark",
|
|
||||||
"vsc-dark-plus",
|
|
||||||
"xonokai",
|
|
||||||
"z-touch",
|
|
||||||
]
|
|
||||||
],
|
|
||||||
Literal[
|
|
||||||
"a11y-dark",
|
|
||||||
"atom-dark",
|
|
||||||
"cb",
|
|
||||||
"coldark-cold",
|
|
||||||
"coldark-dark",
|
|
||||||
"coy",
|
|
||||||
"coy-without-shadows",
|
|
||||||
"darcula",
|
|
||||||
"dark",
|
|
||||||
"dracula",
|
|
||||||
"duotone-dark",
|
|
||||||
"duotone-earth",
|
|
||||||
"duotone-forest",
|
|
||||||
"duotone-light",
|
|
||||||
"duotone-sea",
|
|
||||||
"duotone-space",
|
|
||||||
"funky",
|
|
||||||
"ghcolors",
|
|
||||||
"gruvbox-dark",
|
|
||||||
"gruvbox-light",
|
|
||||||
"holi-theme",
|
|
||||||
"hopscotch",
|
|
||||||
"light",
|
|
||||||
"lucario",
|
|
||||||
"material-dark",
|
|
||||||
"material-light",
|
|
||||||
"material-oceanic",
|
|
||||||
"night-owl",
|
|
||||||
"nord",
|
|
||||||
"okaidia",
|
|
||||||
"one-dark",
|
|
||||||
"one-light",
|
|
||||||
"pojoaque",
|
|
||||||
"prism",
|
|
||||||
"shades-of-purple",
|
|
||||||
"solarized-dark-atom",
|
|
||||||
"solarizedlight",
|
|
||||||
"synthwave84",
|
|
||||||
"tomorrow",
|
|
||||||
"twilight",
|
|
||||||
"vs",
|
|
||||||
"vs-dark",
|
|
||||||
"vsc-dark-plus",
|
|
||||||
"xonokai",
|
|
||||||
"z-touch",
|
|
||||||
],
|
|
||||||
]
|
|
||||||
] = None,
|
|
||||||
language: Optional[
|
language: Optional[
|
||||||
Union[
|
Union[
|
||||||
|
Literal[
|
||||||
|
"abap",
|
||||||
|
"abnf",
|
||||||
|
"actionscript",
|
||||||
|
"ada",
|
||||||
|
"agda",
|
||||||
|
"al",
|
||||||
|
"antlr4",
|
||||||
|
"apacheconf",
|
||||||
|
"apex",
|
||||||
|
"apl",
|
||||||
|
"applescript",
|
||||||
|
"aql",
|
||||||
|
"arduino",
|
||||||
|
"arff",
|
||||||
|
"asciidoc",
|
||||||
|
"asm6502",
|
||||||
|
"asmatmel",
|
||||||
|
"aspnet",
|
||||||
|
"autohotkey",
|
||||||
|
"autoit",
|
||||||
|
"avisynth",
|
||||||
|
"avro-idl",
|
||||||
|
"bash",
|
||||||
|
"basic",
|
||||||
|
"batch",
|
||||||
|
"bbcode",
|
||||||
|
"bicep",
|
||||||
|
"birb",
|
||||||
|
"bison",
|
||||||
|
"bnf",
|
||||||
|
"brainfuck",
|
||||||
|
"brightscript",
|
||||||
|
"bro",
|
||||||
|
"bsl",
|
||||||
|
"c",
|
||||||
|
"cfscript",
|
||||||
|
"chaiscript",
|
||||||
|
"cil",
|
||||||
|
"clike",
|
||||||
|
"clojure",
|
||||||
|
"cmake",
|
||||||
|
"cobol",
|
||||||
|
"coffeescript",
|
||||||
|
"concurnas",
|
||||||
|
"coq",
|
||||||
|
"core",
|
||||||
|
"cpp",
|
||||||
|
"crystal",
|
||||||
|
"csharp",
|
||||||
|
"cshtml",
|
||||||
|
"csp",
|
||||||
|
"css",
|
||||||
|
"css-extras",
|
||||||
|
"csv",
|
||||||
|
"cypher",
|
||||||
|
"d",
|
||||||
|
"dart",
|
||||||
|
"dataweave",
|
||||||
|
"dax",
|
||||||
|
"dhall",
|
||||||
|
"diff",
|
||||||
|
"django",
|
||||||
|
"dns-zone-file",
|
||||||
|
"docker",
|
||||||
|
"dot",
|
||||||
|
"ebnf",
|
||||||
|
"editorconfig",
|
||||||
|
"eiffel",
|
||||||
|
"ejs",
|
||||||
|
"elixir",
|
||||||
|
"elm",
|
||||||
|
"erb",
|
||||||
|
"erlang",
|
||||||
|
"etlua",
|
||||||
|
"excel-formula",
|
||||||
|
"factor",
|
||||||
|
"false",
|
||||||
|
"firestore-security-rules",
|
||||||
|
"flow",
|
||||||
|
"fortran",
|
||||||
|
"fsharp",
|
||||||
|
"ftl",
|
||||||
|
"gap",
|
||||||
|
"gcode",
|
||||||
|
"gdscript",
|
||||||
|
"gedcom",
|
||||||
|
"gherkin",
|
||||||
|
"git",
|
||||||
|
"glsl",
|
||||||
|
"gml",
|
||||||
|
"gn",
|
||||||
|
"go",
|
||||||
|
"go-module",
|
||||||
|
"graphql",
|
||||||
|
"groovy",
|
||||||
|
"haml",
|
||||||
|
"handlebars",
|
||||||
|
"haskell",
|
||||||
|
"haxe",
|
||||||
|
"hcl",
|
||||||
|
"hlsl",
|
||||||
|
"hoon",
|
||||||
|
"hpkp",
|
||||||
|
"hsts",
|
||||||
|
"http",
|
||||||
|
"ichigojam",
|
||||||
|
"icon",
|
||||||
|
"icu-message-format",
|
||||||
|
"idris",
|
||||||
|
"iecst",
|
||||||
|
"ignore",
|
||||||
|
"index",
|
||||||
|
"inform7",
|
||||||
|
"ini",
|
||||||
|
"io",
|
||||||
|
"j",
|
||||||
|
"java",
|
||||||
|
"javadoc",
|
||||||
|
"javadoclike",
|
||||||
|
"javascript",
|
||||||
|
"javastacktrace",
|
||||||
|
"jexl",
|
||||||
|
"jolie",
|
||||||
|
"jq",
|
||||||
|
"js-extras",
|
||||||
|
"js-templates",
|
||||||
|
"jsdoc",
|
||||||
|
"json",
|
||||||
|
"json5",
|
||||||
|
"jsonp",
|
||||||
|
"jsstacktrace",
|
||||||
|
"jsx",
|
||||||
|
"julia",
|
||||||
|
"keepalived",
|
||||||
|
"keyman",
|
||||||
|
"kotlin",
|
||||||
|
"kumir",
|
||||||
|
"kusto",
|
||||||
|
"latex",
|
||||||
|
"latte",
|
||||||
|
"less",
|
||||||
|
"lilypond",
|
||||||
|
"liquid",
|
||||||
|
"lisp",
|
||||||
|
"livescript",
|
||||||
|
"llvm",
|
||||||
|
"log",
|
||||||
|
"lolcode",
|
||||||
|
"lua",
|
||||||
|
"magma",
|
||||||
|
"makefile",
|
||||||
|
"markdown",
|
||||||
|
"markup",
|
||||||
|
"markup-templating",
|
||||||
|
"matlab",
|
||||||
|
"maxscript",
|
||||||
|
"mel",
|
||||||
|
"mermaid",
|
||||||
|
"mizar",
|
||||||
|
"mongodb",
|
||||||
|
"monkey",
|
||||||
|
"moonscript",
|
||||||
|
"n1ql",
|
||||||
|
"n4js",
|
||||||
|
"nand2tetris-hdl",
|
||||||
|
"naniscript",
|
||||||
|
"nasm",
|
||||||
|
"neon",
|
||||||
|
"nevod",
|
||||||
|
"nginx",
|
||||||
|
"nim",
|
||||||
|
"nix",
|
||||||
|
"nsis",
|
||||||
|
"objectivec",
|
||||||
|
"ocaml",
|
||||||
|
"opencl",
|
||||||
|
"openqasm",
|
||||||
|
"oz",
|
||||||
|
"parigp",
|
||||||
|
"parser",
|
||||||
|
"pascal",
|
||||||
|
"pascaligo",
|
||||||
|
"pcaxis",
|
||||||
|
"peoplecode",
|
||||||
|
"perl",
|
||||||
|
"php",
|
||||||
|
"php-extras",
|
||||||
|
"phpdoc",
|
||||||
|
"plsql",
|
||||||
|
"powerquery",
|
||||||
|
"powershell",
|
||||||
|
"processing",
|
||||||
|
"prolog",
|
||||||
|
"promql",
|
||||||
|
"properties",
|
||||||
|
"protobuf",
|
||||||
|
"psl",
|
||||||
|
"pug",
|
||||||
|
"puppet",
|
||||||
|
"pure",
|
||||||
|
"purebasic",
|
||||||
|
"purescript",
|
||||||
|
"python",
|
||||||
|
"q",
|
||||||
|
"qml",
|
||||||
|
"qore",
|
||||||
|
"qsharp",
|
||||||
|
"r",
|
||||||
|
"racket",
|
||||||
|
"reason",
|
||||||
|
"regex",
|
||||||
|
"rego",
|
||||||
|
"renpy",
|
||||||
|
"rest",
|
||||||
|
"rip",
|
||||||
|
"roboconf",
|
||||||
|
"robotframework",
|
||||||
|
"ruby",
|
||||||
|
"rust",
|
||||||
|
"sas",
|
||||||
|
"sass",
|
||||||
|
"scala",
|
||||||
|
"scheme",
|
||||||
|
"scss",
|
||||||
|
"shell-session",
|
||||||
|
"smali",
|
||||||
|
"smalltalk",
|
||||||
|
"smarty",
|
||||||
|
"sml",
|
||||||
|
"solidity",
|
||||||
|
"solution-file",
|
||||||
|
"soy",
|
||||||
|
"sparql",
|
||||||
|
"splunk-spl",
|
||||||
|
"sqf",
|
||||||
|
"sql",
|
||||||
|
"squirrel",
|
||||||
|
"stan",
|
||||||
|
"stylus",
|
||||||
|
"swift",
|
||||||
|
"systemd",
|
||||||
|
"t4-cs",
|
||||||
|
"t4-templating",
|
||||||
|
"t4-vb",
|
||||||
|
"tap",
|
||||||
|
"tcl",
|
||||||
|
"textile",
|
||||||
|
"toml",
|
||||||
|
"tremor",
|
||||||
|
"tsx",
|
||||||
|
"tt2",
|
||||||
|
"turtle",
|
||||||
|
"twig",
|
||||||
|
"typescript",
|
||||||
|
"typoscript",
|
||||||
|
"unrealscript",
|
||||||
|
"uorazor",
|
||||||
|
"uri",
|
||||||
|
"v",
|
||||||
|
"vala",
|
||||||
|
"vbnet",
|
||||||
|
"velocity",
|
||||||
|
"verilog",
|
||||||
|
"vhdl",
|
||||||
|
"vim",
|
||||||
|
"visual-basic",
|
||||||
|
"warpscript",
|
||||||
|
"wasm",
|
||||||
|
"web-idl",
|
||||||
|
"wiki",
|
||||||
|
"wolfram",
|
||||||
|
"wren",
|
||||||
|
"xeora",
|
||||||
|
"xml-doc",
|
||||||
|
"xojo",
|
||||||
|
"xquery",
|
||||||
|
"yaml",
|
||||||
|
"yang",
|
||||||
|
"zig",
|
||||||
|
],
|
||||||
Var[
|
Var[
|
||||||
Literal[
|
Literal[
|
||||||
"abap",
|
"abap",
|
||||||
@ -738,287 +919,6 @@ class CodeBlock(Component):
|
|||||||
"zig",
|
"zig",
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
Literal[
|
|
||||||
"abap",
|
|
||||||
"abnf",
|
|
||||||
"actionscript",
|
|
||||||
"ada",
|
|
||||||
"agda",
|
|
||||||
"al",
|
|
||||||
"antlr4",
|
|
||||||
"apacheconf",
|
|
||||||
"apex",
|
|
||||||
"apl",
|
|
||||||
"applescript",
|
|
||||||
"aql",
|
|
||||||
"arduino",
|
|
||||||
"arff",
|
|
||||||
"asciidoc",
|
|
||||||
"asm6502",
|
|
||||||
"asmatmel",
|
|
||||||
"aspnet",
|
|
||||||
"autohotkey",
|
|
||||||
"autoit",
|
|
||||||
"avisynth",
|
|
||||||
"avro-idl",
|
|
||||||
"bash",
|
|
||||||
"basic",
|
|
||||||
"batch",
|
|
||||||
"bbcode",
|
|
||||||
"bicep",
|
|
||||||
"birb",
|
|
||||||
"bison",
|
|
||||||
"bnf",
|
|
||||||
"brainfuck",
|
|
||||||
"brightscript",
|
|
||||||
"bro",
|
|
||||||
"bsl",
|
|
||||||
"c",
|
|
||||||
"cfscript",
|
|
||||||
"chaiscript",
|
|
||||||
"cil",
|
|
||||||
"clike",
|
|
||||||
"clojure",
|
|
||||||
"cmake",
|
|
||||||
"cobol",
|
|
||||||
"coffeescript",
|
|
||||||
"concurnas",
|
|
||||||
"coq",
|
|
||||||
"core",
|
|
||||||
"cpp",
|
|
||||||
"crystal",
|
|
||||||
"csharp",
|
|
||||||
"cshtml",
|
|
||||||
"csp",
|
|
||||||
"css",
|
|
||||||
"css-extras",
|
|
||||||
"csv",
|
|
||||||
"cypher",
|
|
||||||
"d",
|
|
||||||
"dart",
|
|
||||||
"dataweave",
|
|
||||||
"dax",
|
|
||||||
"dhall",
|
|
||||||
"diff",
|
|
||||||
"django",
|
|
||||||
"dns-zone-file",
|
|
||||||
"docker",
|
|
||||||
"dot",
|
|
||||||
"ebnf",
|
|
||||||
"editorconfig",
|
|
||||||
"eiffel",
|
|
||||||
"ejs",
|
|
||||||
"elixir",
|
|
||||||
"elm",
|
|
||||||
"erb",
|
|
||||||
"erlang",
|
|
||||||
"etlua",
|
|
||||||
"excel-formula",
|
|
||||||
"factor",
|
|
||||||
"false",
|
|
||||||
"firestore-security-rules",
|
|
||||||
"flow",
|
|
||||||
"fortran",
|
|
||||||
"fsharp",
|
|
||||||
"ftl",
|
|
||||||
"gap",
|
|
||||||
"gcode",
|
|
||||||
"gdscript",
|
|
||||||
"gedcom",
|
|
||||||
"gherkin",
|
|
||||||
"git",
|
|
||||||
"glsl",
|
|
||||||
"gml",
|
|
||||||
"gn",
|
|
||||||
"go",
|
|
||||||
"go-module",
|
|
||||||
"graphql",
|
|
||||||
"groovy",
|
|
||||||
"haml",
|
|
||||||
"handlebars",
|
|
||||||
"haskell",
|
|
||||||
"haxe",
|
|
||||||
"hcl",
|
|
||||||
"hlsl",
|
|
||||||
"hoon",
|
|
||||||
"hpkp",
|
|
||||||
"hsts",
|
|
||||||
"http",
|
|
||||||
"ichigojam",
|
|
||||||
"icon",
|
|
||||||
"icu-message-format",
|
|
||||||
"idris",
|
|
||||||
"iecst",
|
|
||||||
"ignore",
|
|
||||||
"index",
|
|
||||||
"inform7",
|
|
||||||
"ini",
|
|
||||||
"io",
|
|
||||||
"j",
|
|
||||||
"java",
|
|
||||||
"javadoc",
|
|
||||||
"javadoclike",
|
|
||||||
"javascript",
|
|
||||||
"javastacktrace",
|
|
||||||
"jexl",
|
|
||||||
"jolie",
|
|
||||||
"jq",
|
|
||||||
"js-extras",
|
|
||||||
"js-templates",
|
|
||||||
"jsdoc",
|
|
||||||
"json",
|
|
||||||
"json5",
|
|
||||||
"jsonp",
|
|
||||||
"jsstacktrace",
|
|
||||||
"jsx",
|
|
||||||
"julia",
|
|
||||||
"keepalived",
|
|
||||||
"keyman",
|
|
||||||
"kotlin",
|
|
||||||
"kumir",
|
|
||||||
"kusto",
|
|
||||||
"latex",
|
|
||||||
"latte",
|
|
||||||
"less",
|
|
||||||
"lilypond",
|
|
||||||
"liquid",
|
|
||||||
"lisp",
|
|
||||||
"livescript",
|
|
||||||
"llvm",
|
|
||||||
"log",
|
|
||||||
"lolcode",
|
|
||||||
"lua",
|
|
||||||
"magma",
|
|
||||||
"makefile",
|
|
||||||
"markdown",
|
|
||||||
"markup",
|
|
||||||
"markup-templating",
|
|
||||||
"matlab",
|
|
||||||
"maxscript",
|
|
||||||
"mel",
|
|
||||||
"mermaid",
|
|
||||||
"mizar",
|
|
||||||
"mongodb",
|
|
||||||
"monkey",
|
|
||||||
"moonscript",
|
|
||||||
"n1ql",
|
|
||||||
"n4js",
|
|
||||||
"nand2tetris-hdl",
|
|
||||||
"naniscript",
|
|
||||||
"nasm",
|
|
||||||
"neon",
|
|
||||||
"nevod",
|
|
||||||
"nginx",
|
|
||||||
"nim",
|
|
||||||
"nix",
|
|
||||||
"nsis",
|
|
||||||
"objectivec",
|
|
||||||
"ocaml",
|
|
||||||
"opencl",
|
|
||||||
"openqasm",
|
|
||||||
"oz",
|
|
||||||
"parigp",
|
|
||||||
"parser",
|
|
||||||
"pascal",
|
|
||||||
"pascaligo",
|
|
||||||
"pcaxis",
|
|
||||||
"peoplecode",
|
|
||||||
"perl",
|
|
||||||
"php",
|
|
||||||
"php-extras",
|
|
||||||
"phpdoc",
|
|
||||||
"plsql",
|
|
||||||
"powerquery",
|
|
||||||
"powershell",
|
|
||||||
"processing",
|
|
||||||
"prolog",
|
|
||||||
"promql",
|
|
||||||
"properties",
|
|
||||||
"protobuf",
|
|
||||||
"psl",
|
|
||||||
"pug",
|
|
||||||
"puppet",
|
|
||||||
"pure",
|
|
||||||
"purebasic",
|
|
||||||
"purescript",
|
|
||||||
"python",
|
|
||||||
"q",
|
|
||||||
"qml",
|
|
||||||
"qore",
|
|
||||||
"qsharp",
|
|
||||||
"r",
|
|
||||||
"racket",
|
|
||||||
"reason",
|
|
||||||
"regex",
|
|
||||||
"rego",
|
|
||||||
"renpy",
|
|
||||||
"rest",
|
|
||||||
"rip",
|
|
||||||
"roboconf",
|
|
||||||
"robotframework",
|
|
||||||
"ruby",
|
|
||||||
"rust",
|
|
||||||
"sas",
|
|
||||||
"sass",
|
|
||||||
"scala",
|
|
||||||
"scheme",
|
|
||||||
"scss",
|
|
||||||
"shell-session",
|
|
||||||
"smali",
|
|
||||||
"smalltalk",
|
|
||||||
"smarty",
|
|
||||||
"sml",
|
|
||||||
"solidity",
|
|
||||||
"solution-file",
|
|
||||||
"soy",
|
|
||||||
"sparql",
|
|
||||||
"splunk-spl",
|
|
||||||
"sqf",
|
|
||||||
"sql",
|
|
||||||
"squirrel",
|
|
||||||
"stan",
|
|
||||||
"stylus",
|
|
||||||
"swift",
|
|
||||||
"systemd",
|
|
||||||
"t4-cs",
|
|
||||||
"t4-templating",
|
|
||||||
"t4-vb",
|
|
||||||
"tap",
|
|
||||||
"tcl",
|
|
||||||
"textile",
|
|
||||||
"toml",
|
|
||||||
"tremor",
|
|
||||||
"tsx",
|
|
||||||
"tt2",
|
|
||||||
"turtle",
|
|
||||||
"twig",
|
|
||||||
"typescript",
|
|
||||||
"typoscript",
|
|
||||||
"unrealscript",
|
|
||||||
"uorazor",
|
|
||||||
"uri",
|
|
||||||
"v",
|
|
||||||
"vala",
|
|
||||||
"vbnet",
|
|
||||||
"velocity",
|
|
||||||
"verilog",
|
|
||||||
"vhdl",
|
|
||||||
"vim",
|
|
||||||
"visual-basic",
|
|
||||||
"warpscript",
|
|
||||||
"wasm",
|
|
||||||
"web-idl",
|
|
||||||
"wiki",
|
|
||||||
"wolfram",
|
|
||||||
"wren",
|
|
||||||
"xeora",
|
|
||||||
"xml-doc",
|
|
||||||
"xojo",
|
|
||||||
"xquery",
|
|
||||||
"yaml",
|
|
||||||
"yang",
|
|
||||||
"zig",
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
code: Optional[Union[Var[str], str]] = None,
|
code: Optional[Union[Var[str], str]] = None,
|
||||||
@ -1026,57 +926,47 @@ class CodeBlock(Component):
|
|||||||
starting_line_number: Optional[Union[Var[int], int]] = None,
|
starting_line_number: Optional[Union[Var[int], int]] = None,
|
||||||
wrap_long_lines: Optional[Union[Var[bool], bool]] = None,
|
wrap_long_lines: Optional[Union[Var[bool], bool]] = None,
|
||||||
custom_style: Optional[Dict[str, Union[str, Var, Color]]] = None,
|
custom_style: Optional[Dict[str, Union[str, Var, Color]]] = None,
|
||||||
code_tag_props: Optional[Union[Var[Dict[str, str]], Dict[str, str]]] = None,
|
code_tag_props: Optional[Union[Dict[str, str], Var[Dict[str, str]]]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "CodeBlock":
|
) -> "CodeBlock":
|
||||||
|
@ -9,12 +9,12 @@ from reflex.base import Base
|
|||||||
from reflex.components.component import Component, NoSSRComponent
|
from reflex.components.component import Component, NoSSRComponent
|
||||||
from reflex.components.literals import LiteralRowMarker
|
from reflex.components.literals import LiteralRowMarker
|
||||||
from reflex.event import EventHandler
|
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 import console, format, types
|
||||||
from reflex.utils.imports import ImportDict, ImportVar
|
from reflex.utils.imports import ImportDict, ImportVar
|
||||||
from reflex.utils.serializers import serializer
|
from reflex.utils.serializers import serializer
|
||||||
from reflex.vars import Var, get_unique_variable_name
|
from reflex.vars import get_unique_variable_name
|
||||||
|
from reflex.vars.base import Var
|
||||||
|
from reflex.vars.sequence import ArrayVar
|
||||||
|
|
||||||
|
|
||||||
# TODO: Fix the serialization issue for custom types.
|
# TODO: Fix the serialization issue for custom types.
|
||||||
@ -295,7 +295,7 @@ class DataEditor(NoSSRComponent):
|
|||||||
|
|
||||||
# Define the name of the getData callback associated with this component and assign to get_cell_content.
|
# Define the name of the getData callback associated with this component and assign to get_cell_content.
|
||||||
data_callback = f"getData_{editor_id}"
|
data_callback = f"getData_{editor_id}"
|
||||||
self.get_cell_content = ImmutableVar.create(data_callback) # type: ignore
|
self.get_cell_content = Var(_js_expr=data_callback) # type: ignore
|
||||||
|
|
||||||
code = [f"function {data_callback}([col, row])" "{"]
|
code = [f"function {data_callback}([col, row])" "{"]
|
||||||
|
|
||||||
@ -333,18 +333,16 @@ class DataEditor(NoSSRComponent):
|
|||||||
|
|
||||||
# If rows is not provided, determine from data.
|
# If rows is not provided, determine from data.
|
||||||
if rows is None:
|
if rows is None:
|
||||||
if isinstance(data, ImmutableVar) and not isinstance(data, ArrayVar):
|
if isinstance(data, Var) and not isinstance(data, ArrayVar):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"DataEditor data must be an ArrayVar if rows is not provided."
|
"DataEditor data must be an ArrayVar if rows is not provided."
|
||||||
)
|
)
|
||||||
props["rows"] = (
|
props["rows"] = data.length() if isinstance(data, Var) else len(data)
|
||||||
data.length() if isinstance(data, ImmutableVar) else len(data)
|
|
||||||
)
|
|
||||||
|
|
||||||
if not isinstance(columns, ImmutableVar) and len(columns):
|
if not isinstance(columns, Var) and len(columns):
|
||||||
if (
|
if (
|
||||||
types.is_dataframe(type(data))
|
types.is_dataframe(type(data))
|
||||||
or isinstance(data, ImmutableVar)
|
or isinstance(data, Var)
|
||||||
and types.is_dataframe(data._var_type)
|
and types.is_dataframe(data._var_type)
|
||||||
):
|
):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
|
@ -9,11 +9,10 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload
|
|||||||
from reflex.base import Base
|
from reflex.base import Base
|
||||||
from reflex.components.component import NoSSRComponent
|
from reflex.components.component import NoSSRComponent
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.utils.imports import ImportDict
|
from reflex.utils.imports import ImportDict
|
||||||
from reflex.utils.serializers import serializer
|
from reflex.utils.serializers import serializer
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
class GridColumnIcons(Enum):
|
class GridColumnIcons(Enum):
|
||||||
Array = "array"
|
Array = "array"
|
||||||
@ -89,9 +88,9 @@ class DataEditor(NoSSRComponent):
|
|||||||
*children,
|
*children,
|
||||||
rows: Optional[Union[Var[int], int]] = None,
|
rows: Optional[Union[Var[int], int]] = None,
|
||||||
columns: Optional[
|
columns: Optional[
|
||||||
Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]
|
Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]
|
||||||
] = None,
|
] = None,
|
||||||
data: Optional[Union[Var[List[List[Any]]], List[List[Any]]]] = None,
|
data: Optional[Union[List[List[Any]], Var[List[List[Any]]]]] = None,
|
||||||
get_cell_content: Optional[Union[Var[str], str]] = None,
|
get_cell_content: Optional[Union[Var[str], str]] = None,
|
||||||
get_cell_for_selection: Optional[Union[Var[bool], bool]] = None,
|
get_cell_for_selection: Optional[Union[Var[bool], bool]] = None,
|
||||||
on_paste: Optional[Union[Var[bool], bool]] = None,
|
on_paste: Optional[Union[Var[bool], bool]] = None,
|
||||||
@ -107,8 +106,8 @@ class DataEditor(NoSSRComponent):
|
|||||||
row_height: Optional[Union[Var[int], int]] = None,
|
row_height: Optional[Union[Var[int], int]] = None,
|
||||||
row_markers: Optional[
|
row_markers: Optional[
|
||||||
Union[
|
Union[
|
||||||
Var[Literal["none", "number", "checkbox", "both", "clickable-number"]],
|
Literal["both", "checkbox", "clickable-number", "none", "number"],
|
||||||
Literal["none", "number", "checkbox", "both", "clickable-number"],
|
Var[Literal["both", "checkbox", "clickable-number", "none", "number"]],
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
row_marker_start_index: Optional[Union[Var[int], int]] = None,
|
row_marker_start_index: Optional[Union[Var[int], int]] = None,
|
||||||
@ -118,8 +117,8 @@ class DataEditor(NoSSRComponent):
|
|||||||
vertical_border: Optional[Union[Var[bool], bool]] = None,
|
vertical_border: Optional[Union[Var[bool], bool]] = None,
|
||||||
column_select: Optional[
|
column_select: Optional[
|
||||||
Union[
|
Union[
|
||||||
Var[Literal["none", "single", "multi"]],
|
Literal["multi", "none", "single"],
|
||||||
Literal["none", "single", "multi"],
|
Var[Literal["multi", "none", "single"]],
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
prevent_diagonal_scrolling: Optional[Union[Var[bool], bool]] = None,
|
prevent_diagonal_scrolling: Optional[Union[Var[bool], bool]] = None,
|
||||||
@ -128,106 +127,94 @@ class DataEditor(NoSSRComponent):
|
|||||||
scroll_offset_x: Optional[Union[Var[int], int]] = None,
|
scroll_offset_x: Optional[Union[Var[int], int]] = None,
|
||||||
scroll_offset_y: Optional[Union[Var[int], int]] = None,
|
scroll_offset_y: Optional[Union[Var[int], int]] = None,
|
||||||
theme: Optional[
|
theme: Optional[
|
||||||
Union[Var[Union[DataEditorTheme, Dict]], DataEditorTheme, Dict]
|
Union[DataEditorTheme, Dict, Var[Union[DataEditorTheme, Dict]]]
|
||||||
] = None,
|
] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_cell_activated: Optional[
|
on_cell_activated: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_cell_clicked: Optional[
|
on_cell_clicked: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_cell_context_menu: Optional[
|
on_cell_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_cell_edited: Optional[
|
on_cell_edited: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_column_resize: Optional[
|
on_column_resize: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_delete: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_delete: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_finished_editing: Optional[
|
on_finished_editing: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_group_header_clicked: Optional[
|
on_group_header_clicked: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_group_header_context_menu: Optional[
|
on_group_header_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_group_header_renamed: Optional[
|
on_group_header_renamed: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_header_clicked: Optional[
|
on_header_clicked: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_header_context_menu: Optional[
|
on_header_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_header_menu_click: Optional[
|
on_header_menu_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_item_hovered: Optional[
|
on_item_hovered: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_row_appended: Optional[
|
on_row_appended: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_selection_cleared: Optional[
|
on_selection_cleared: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "DataEditor":
|
) -> "DataEditor":
|
||||||
|
@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload
|
|||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
class Element(Component):
|
class Element(Component):
|
||||||
@overload
|
@overload
|
||||||
@ -21,51 +21,41 @@ class Element(Component):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Element":
|
) -> "Element":
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from reflex.components.el.element import Element
|
from reflex.components.el.element import Element
|
||||||
from reflex.vars import Var as Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
|
|
||||||
class BaseHTML(Element):
|
class BaseHTML(Element):
|
||||||
|
@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload
|
|||||||
|
|
||||||
from reflex.components.el.element import Element
|
from reflex.components.el.element import Element
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
class BaseHTML(Element):
|
class BaseHTML(Element):
|
||||||
@overload
|
@overload
|
||||||
@ -17,80 +16,70 @@ class BaseHTML(Element):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "BaseHTML":
|
) -> "BaseHTML":
|
||||||
|
@ -11,13 +11,13 @@ from reflex.components.el.element import Element
|
|||||||
from reflex.components.tags.tag import Tag
|
from reflex.components.tags.tag import Tag
|
||||||
from reflex.constants import Dirs, EventTriggers
|
from reflex.constants import Dirs, EventTriggers
|
||||||
from reflex.event import EventChain, EventHandler
|
from reflex.event import EventChain, EventHandler
|
||||||
from reflex.ivars.base import ImmutableVar, LiteralVar
|
|
||||||
from reflex.utils.imports import ImportDict
|
from reflex.utils.imports import ImportDict
|
||||||
from reflex.vars import Var, VarData
|
from reflex.vars import VarData
|
||||||
|
from reflex.vars.base import LiteralVar, Var
|
||||||
|
|
||||||
from .base import BaseHTML
|
from .base import BaseHTML
|
||||||
|
|
||||||
FORM_DATA = ImmutableVar.create("form_data")
|
FORM_DATA = Var(_js_expr="form_data")
|
||||||
HANDLE_SUBMIT_JS_JINJA2 = Environment().from_string(
|
HANDLE_SUBMIT_JS_JINJA2 = Environment().from_string(
|
||||||
"""
|
"""
|
||||||
const handleSubmit_{{ handle_submit_unique_name }} = useCallback((ev) => {
|
const handleSubmit_{{ handle_submit_unique_name }} = useCallback((ev) => {
|
||||||
@ -197,8 +197,8 @@ class Form(BaseHTML):
|
|||||||
if EventTriggers.ON_SUBMIT in self.event_triggers:
|
if EventTriggers.ON_SUBMIT in self.event_triggers:
|
||||||
render_tag.add_props(
|
render_tag.add_props(
|
||||||
**{
|
**{
|
||||||
EventTriggers.ON_SUBMIT: ImmutableVar(
|
EventTriggers.ON_SUBMIT: Var(
|
||||||
_var_name=f"handleSubmit_{self.handle_submit_unique_name}",
|
_js_expr=f"handleSubmit_{self.handle_submit_unique_name}",
|
||||||
_var_type=EventChain,
|
_var_type=EventChain,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -212,21 +212,21 @@ class Form(BaseHTML):
|
|||||||
# when ref start with refs_ it's an array of refs, so we need different method
|
# when ref start with refs_ it's an array of refs, so we need different method
|
||||||
# to collect data
|
# to collect data
|
||||||
if ref.startswith("refs_"):
|
if ref.startswith("refs_"):
|
||||||
ref_var = ImmutableVar.create_safe(ref[:-3]).as_ref()
|
ref_var = Var(_js_expr=ref[:-3]).as_ref()
|
||||||
form_refs[ref[len("refs_") : -3]] = ImmutableVar.create_safe(
|
form_refs[ref[len("refs_") : -3]] = Var(
|
||||||
f"getRefValues({str(ref_var)})",
|
_js_expr=f"getRefValues({str(ref_var)})",
|
||||||
_var_data=VarData.merge(ref_var._get_all_var_data()),
|
_var_data=VarData.merge(ref_var._get_all_var_data()),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
ref_var = ImmutableVar.create_safe(ref).as_ref()
|
ref_var = Var(_js_expr=ref).as_ref()
|
||||||
form_refs[ref[4:]] = ImmutableVar.create_safe(
|
form_refs[ref[4:]] = Var(
|
||||||
f"getRefValue({str(ref_var)})",
|
_js_expr=f"getRefValue({str(ref_var)})",
|
||||||
_var_data=VarData.merge(ref_var._get_all_var_data()),
|
_var_data=VarData.merge(ref_var._get_all_var_data()),
|
||||||
)
|
)
|
||||||
# print(repr(form_refs))
|
# print(repr(form_refs))
|
||||||
return 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 super()._get_vars(include_children=include_children)
|
||||||
yield from self._get_form_refs().values()
|
yield from self._get_form_refs().values()
|
||||||
|
|
||||||
@ -624,15 +624,15 @@ class Textarea(BaseHTML):
|
|||||||
"Cannot combine `enter_key_submit` with `on_key_down`.",
|
"Cannot combine `enter_key_submit` with `on_key_down`.",
|
||||||
)
|
)
|
||||||
tag.add_props(
|
tag.add_props(
|
||||||
on_key_down=ImmutableVar.create_safe(
|
on_key_down=Var(
|
||||||
f"(e) => enterKeySubmitOnKeyDown(e, {str(self.enter_key_submit)})",
|
_js_expr=f"(e) => enterKeySubmitOnKeyDown(e, {str(self.enter_key_submit)})",
|
||||||
_var_data=VarData.merge(self.enter_key_submit._get_all_var_data()),
|
_var_data=VarData.merge(self.enter_key_submit._get_all_var_data()),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if self.auto_height is not None:
|
if self.auto_height is not None:
|
||||||
tag.add_props(
|
tag.add_props(
|
||||||
on_input=ImmutableVar.create_safe(
|
on_input=Var(
|
||||||
f"(e) => autoHeightOnInput(e, {str(self.auto_height)})",
|
_js_expr=f"(e) => autoHeightOnInput(e, {str(self.auto_height)})",
|
||||||
_var_data=VarData.merge(self.auto_height._get_all_var_data()),
|
_var_data=VarData.merge(self.auto_height._get_all_var_data()),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
from .base import BaseHTML
|
from .base import BaseHTML
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,7 @@ from typing import Any, Union
|
|||||||
|
|
||||||
from reflex import Component, ComponentNamespace
|
from reflex import Component, ComponentNamespace
|
||||||
from reflex.constants.colors import Color
|
from reflex.constants.colors import Color
|
||||||
from reflex.vars import Var as Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
from .base import BaseHTML
|
from .base import BaseHTML
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,9 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
||||||
|
|
||||||
from typing import Set, Union
|
from typing import List, Union
|
||||||
|
|
||||||
from reflex.components.el.element import Element
|
from reflex.components.el.element import Element
|
||||||
from reflex.ivars.base import ImmutableVar
|
from reflex.vars.base import Var
|
||||||
from reflex.vars import Var as Var
|
|
||||||
|
|
||||||
from .base import BaseHTML
|
from .base import BaseHTML
|
||||||
|
|
||||||
@ -90,9 +89,7 @@ class StyleEl(Element): # noqa: E742
|
|||||||
|
|
||||||
media: Var[Union[str, int, bool]]
|
media: Var[Union[str, int, bool]]
|
||||||
|
|
||||||
special_props: Set[ImmutableVar] = {
|
special_props: List[Var] = [Var(_js_expr="suppressHydrationWarning")]
|
||||||
ImmutableVar.create_safe("suppressHydrationWarning")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
base = Base.create
|
base = Base.create
|
||||||
|
@ -7,9 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload
|
|||||||
|
|
||||||
from reflex.components.el.element import Element
|
from reflex.components.el.element import Element
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
from .base import BaseHTML
|
from .base import BaseHTML
|
||||||
|
|
||||||
@ -19,82 +18,72 @@ class Base(BaseHTML):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
href: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
href: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
target: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Base":
|
) -> "Base":
|
||||||
@ -137,80 +126,70 @@ class Head(BaseHTML):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Head":
|
) -> "Head":
|
||||||
@ -254,92 +233,82 @@ class Link(BaseHTML):
|
|||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
cross_origin: Optional[
|
cross_origin: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
href: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
href: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
href_lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
href_lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
integrity: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
integrity: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
media: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
media: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
referrer_policy: Optional[
|
referrer_policy: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
rel: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
rel: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
sizes: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
sizes: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Link":
|
) -> "Link":
|
||||||
@ -391,84 +360,74 @@ class Meta(BaseHTML):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
char_set: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
char_set: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
content: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
content: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
http_equiv: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
http_equiv: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
name: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Meta":
|
) -> "Meta":
|
||||||
@ -520,51 +479,41 @@ class Title(Element):
|
|||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Title":
|
) -> "Title":
|
||||||
@ -591,57 +540,47 @@ class StyleEl(Element):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
media: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
media: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "StyleEl":
|
) -> "StyleEl":
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from reflex.vars import Var as Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
from .base import BaseHTML
|
from .base import BaseHTML
|
||||||
|
|
||||||
|
@ -6,9 +6,8 @@
|
|||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, Callable, Dict, Optional, Union, overload
|
||||||
|
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
from .base import BaseHTML
|
from .base import BaseHTML
|
||||||
|
|
||||||
@ -18,81 +17,71 @@ class Details(BaseHTML):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
open: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
open: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Details":
|
) -> "Details":
|
||||||
@ -136,81 +125,71 @@ class Dialog(BaseHTML):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
open: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
open: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Dialog":
|
) -> "Dialog":
|
||||||
@ -254,80 +233,70 @@ class Summary(BaseHTML):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Summary":
|
) -> "Summary":
|
||||||
@ -370,80 +339,70 @@ class Slot(BaseHTML):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Slot":
|
) -> "Slot":
|
||||||
@ -486,80 +445,70 @@ class Template(BaseHTML):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Template":
|
) -> "Template":
|
||||||
@ -602,80 +551,70 @@ class Math(BaseHTML):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Math":
|
) -> "Math":
|
||||||
@ -718,81 +657,71 @@ class Html(BaseHTML):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
manifest: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
manifest: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Html":
|
) -> "Html":
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from reflex.vars import Var as Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
from .base import BaseHTML
|
from .base import BaseHTML
|
||||||
|
|
||||||
|
@ -6,9 +6,8 @@
|
|||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, Callable, Dict, Optional, Union, overload
|
||||||
|
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventHandler, EventSpec
|
||||||
from reflex.ivars.base import ImmutableVar
|
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
from .base import BaseHTML
|
from .base import BaseHTML
|
||||||
|
|
||||||
@ -18,80 +17,70 @@ class Canvas(BaseHTML):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Canvas":
|
) -> "Canvas":
|
||||||
@ -134,80 +123,70 @@ class Noscript(BaseHTML):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Noscript":
|
) -> "Noscript":
|
||||||
@ -250,93 +229,83 @@ class Script(BaseHTML):
|
|||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
cls,
|
cls,
|
||||||
*children,
|
*children,
|
||||||
async_: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
async_: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
char_set: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
char_set: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
cross_origin: Optional[
|
cross_origin: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
defer: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
defer: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
integrity: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
integrity: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
language: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
language: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
referrer_policy: Optional[
|
referrer_policy: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
src: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
src: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
type: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
auto_capitalize: Optional[
|
auto_capitalize: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
content_editable: Optional[
|
content_editable: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
context_menu: Optional[
|
context_menu: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
dir: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
draggable: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
enter_key_hint: Optional[
|
enter_key_hint: Optional[
|
||||||
Union[Var[Union[bool, int, str]], str, int, bool]
|
Union[Var[Union[bool, int, str]], bool, int, str]
|
||||||
] = None,
|
] = None,
|
||||||
hidden: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
input_mode: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
item_prop: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
lang: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
role: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
slot: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
spell_check: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
tab_index: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
title: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None,
|
title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[
|
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_double_click: Optional[
|
on_double_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
|
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_down: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_enter: Optional[
|
on_mouse_enter: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_leave: Optional[
|
on_mouse_leave: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_move: Optional[
|
on_mouse_move: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_out: Optional[
|
on_mouse_out: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_over: Optional[
|
on_mouse_over: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
on_mouse_up: Optional[
|
on_mouse_up: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
||||||
on_unmount: Optional[
|
on_unmount: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
Union[EventHandler, EventSpec, list, Callable, Var]
|
||||||
] = None,
|
] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Script":
|
) -> "Script":
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
||||||
|
|
||||||
from reflex.vars import Var as Var
|
|
||||||
|
|
||||||
from .base import BaseHTML
|
from .base import BaseHTML
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from reflex.vars import Var as Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
from .base import BaseHTML
|
from .base import BaseHTML
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from reflex.vars import Var as Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
from .base import BaseHTML
|
from .base import BaseHTML
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user