Merge branch 'main' into lendemor/expose_get_state_at_top_level
This commit is contained in:
commit
6b9865cf1d
2
.github/actions/setup_build_env/action.yml
vendored
2
.github/actions/setup_build_env/action.yml
vendored
@ -18,7 +18,7 @@ inputs:
|
|||||||
poetry-version:
|
poetry-version:
|
||||||
description: 'Poetry version to install'
|
description: 'Poetry version to install'
|
||||||
required: false
|
required: false
|
||||||
default: '1.3.1'
|
default: '1.8.3'
|
||||||
run-poetry-install:
|
run-poetry-install:
|
||||||
description: 'Whether to run poetry install on current dir'
|
description: 'Whether to run poetry install on current dir'
|
||||||
required: false
|
required: false
|
||||||
|
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:
|
||||||
|
40
.github/workflows/check_node_latest.yml
vendored
Normal file
40
.github/workflows/check_node_latest.yml
vendored
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
name: integration-node-latest
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
env:
|
||||||
|
TELEMETRY_ENABLED: false
|
||||||
|
REFLEX_USE_SYSTEM_NODE: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check_latest_node:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: ['3.12']
|
||||||
|
node-version: ['node']
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/setup_build_env
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
run-poetry-install: true
|
||||||
|
create-venv-at-path: .venv
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
- run: |
|
||||||
|
poetry run uv pip install pyvirtualdisplay pillow
|
||||||
|
poetry run playwright install --with-deps
|
||||||
|
- run: |
|
||||||
|
poetry run pytest tests/test_node_version.py
|
||||||
|
poetry run pytest tests/integration
|
||||||
|
|
||||||
|
|
||||||
|
|
88
.github/workflows/check_outdated_dependencies.yml
vendored
Normal file
88
.github/workflows/check_outdated_dependencies.yml
vendored
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
name: check-outdated-dependencies
|
||||||
|
|
||||||
|
on:
|
||||||
|
push: # This will trigger the action when a pull request is opened or updated.
|
||||||
|
branches:
|
||||||
|
- 'release/**' # This will trigger the action when any branch starting with "release/" is created.
|
||||||
|
workflow_dispatch: # Allow manual triggering if needed.
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
backend:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: ./.github/actions/setup_build_env
|
||||||
|
with:
|
||||||
|
python-version: '3.9'
|
||||||
|
run-poetry-install: true
|
||||||
|
create-venv-at-path: .venv
|
||||||
|
|
||||||
|
- name: Check outdated backend dependencies
|
||||||
|
run: |
|
||||||
|
outdated=$(poetry show -oT)
|
||||||
|
echo "Outdated:"
|
||||||
|
echo "$outdated"
|
||||||
|
|
||||||
|
filtered_outdated=$(echo "$outdated" | grep -vE 'pyright|ruff' || true)
|
||||||
|
|
||||||
|
if [ ! -z "$filtered_outdated" ]; then
|
||||||
|
echo "Outdated dependencies found:"
|
||||||
|
echo "$filtered_outdated"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "All dependencies are up to date. (pyright and ruff are ignored)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
frontend:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/setup_build_env
|
||||||
|
with:
|
||||||
|
python-version: '3.10.11'
|
||||||
|
run-poetry-install: true
|
||||||
|
create-venv-at-path: .venv
|
||||||
|
- name: Clone Reflex Website Repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: reflex-dev/reflex-web
|
||||||
|
ref: main
|
||||||
|
path: reflex-web
|
||||||
|
- name: Install Requirements for reflex-web
|
||||||
|
working-directory: ./reflex-web
|
||||||
|
run: poetry run uv pip install -r requirements.txt
|
||||||
|
- name: Install additional dependencies for DB access
|
||||||
|
run: poetry run uv pip install psycopg2-binary
|
||||||
|
- name: Init Website for reflex-web
|
||||||
|
working-directory: ./reflex-web
|
||||||
|
run: poetry run reflex init
|
||||||
|
- name: Run Website and Check for errors
|
||||||
|
run: |
|
||||||
|
poetry run bash scripts/integration.sh ./reflex-web dev
|
||||||
|
- name: Check outdated frontend dependencies
|
||||||
|
working-directory: ./reflex-web/.web
|
||||||
|
run: |
|
||||||
|
raw_outdated=$(/home/runner/.local/share/reflex/bun/bin/bun outdated)
|
||||||
|
outdated=$(echo "$raw_outdated" | grep -vE '\|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\|' || true)
|
||||||
|
echo "Outdated:"
|
||||||
|
echo "$outdated"
|
||||||
|
|
||||||
|
# Ignore 3rd party dependencies that are not updated.
|
||||||
|
filtered_outdated=$(echo "$outdated" | grep -vE 'Package|@chakra-ui|lucide-react|@splinetool/runtime|ag-grid-react|framer-motion|react-markdown|remark-math|remark-gfm|rehype-katex|rehype-raw|remark-unwrap-images' || true)
|
||||||
|
no_extra=$(echo "$filtered_outdated" | grep -vE '\|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-' || true)
|
||||||
|
|
||||||
|
|
||||||
|
if [ ! -z "$no_extra" ]; then
|
||||||
|
echo "Outdated dependencies found:"
|
||||||
|
echo "$filtered_outdated"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "All dependencies are up to date. (3rd party packages are ignored)"
|
||||||
|
fi
|
||||||
|
|
@ -23,8 +23,8 @@ 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-22.04
|
||||||
services:
|
services:
|
||||||
# Label used to access the service container
|
# Label used to access the service container
|
||||||
redis:
|
redis:
|
||||||
@ -51,7 +51,7 @@ jobs:
|
|||||||
SCREENSHOT_DIR: /tmp/screenshots
|
SCREENSHOT_DIR: /tmp/screenshots
|
||||||
REDIS_URL: ${{ matrix.state_manager == 'redis' && 'redis://localhost:6379' || '' }}
|
REDIS_URL: ${{ matrix.state_manager == 'redis' && 'redis://localhost:6379' || '' }}
|
||||||
run: |
|
run: |
|
||||||
poetry run pytest integration
|
poetry run pytest tests/integration
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
name: Upload failed test screenshots
|
name: Upload failed test screenshots
|
||||||
if: always()
|
if: always()
|
||||||
|
53
.github/workflows/integration_tests.yml
vendored
53
.github/workflows/integration_tests.yml
vendored
@ -42,22 +42,18 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
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]
|
||||||
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:
|
||||||
@ -126,7 +122,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
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]
|
||||||
python-version: ['3.10.11', '3.11.4']
|
python-version: ['3.10.11', '3.11.4']
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@ -165,4 +161,45 @@ jobs:
|
|||||||
poetry run python benchmarks/benchmark_web_size.py --os "${{ matrix.os }}"
|
poetry run python benchmarks/benchmark_web_size.py --os "${{ matrix.os }}"
|
||||||
--python-version "${{ matrix.python-version }}" --commit-sha "${{ github.sha }}"
|
--python-version "${{ matrix.python-version }}" --commit-sha "${{ github.sha }}"
|
||||||
--pr-id "${{ github.event.pull_request.id }}" --branch-name "${{ github.head_ref || github.ref_name }}"
|
--pr-id "${{ github.event.pull_request.id }}" --branch-name "${{ github.head_ref || github.ref_name }}"
|
||||||
--app-name "reflex-web" --path ./reflex-web/.web
|
--app-name "reflex-web" --path ./reflex-web/.web
|
||||||
|
|
||||||
|
reflex-web-macos:
|
||||||
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
python-version: ['3.11.5', '3.12.0']
|
||||||
|
runs-on: macos-12
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/setup_build_env
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
run-poetry-install: true
|
||||||
|
create-venv-at-path: .venv
|
||||||
|
- name: Clone Reflex Website Repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: reflex-dev/reflex-web
|
||||||
|
ref: main
|
||||||
|
path: reflex-web
|
||||||
|
- name: Install Requirements for reflex-web
|
||||||
|
working-directory: ./reflex-web
|
||||||
|
run: poetry run uv pip install -r requirements.txt
|
||||||
|
- name: Install additional dependencies for DB access
|
||||||
|
run: poetry run uv pip install psycopg2-binary
|
||||||
|
- name: Init Website for reflex-web
|
||||||
|
working-directory: ./reflex-web
|
||||||
|
run: poetry run reflex init
|
||||||
|
- name: Run Website and Check for errors
|
||||||
|
run: |
|
||||||
|
# Check that npm is home
|
||||||
|
npm -v
|
||||||
|
poetry run bash scripts/integration.sh ./reflex-web prod
|
||||||
|
- name: Measure and upload .web size
|
||||||
|
run:
|
||||||
|
poetry run python benchmarks/benchmark_web_size.py --os "${{ matrix.os }}"
|
||||||
|
--python-version "${{ matrix.python-version }}" --commit-sha "${{ github.sha }}"
|
||||||
|
--pr-id "${{ github.event.pull_request.id }}" --branch-name "${{ github.head_ref || github.ref_name }}"
|
||||||
|
--app-name "reflex-web" --path ./reflex-web/.web
|
||||||
|
|
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}
|
||||||
|
@ -28,5 +28,5 @@ jobs:
|
|||||||
# Run reflex init in a docker container
|
# Run reflex init in a docker container
|
||||||
|
|
||||||
# cwd is repo root
|
# cwd is repo root
|
||||||
docker build -f integration/init-test/Dockerfile -t reflex-init-test integration/init-test
|
docker build -f tests/integration/init-test/Dockerfile -t reflex-init-test tests/integration/init-test
|
||||||
docker run --rm -v $(pwd):/reflex-repo/ reflex-init-test /reflex-repo/integration/init-test/in_docker_test_script.sh
|
docker run --rm -v $(pwd):/reflex-repo/ reflex-init-test /reflex-repo/tests/integration/init-test/in_docker_test_script.sh
|
||||||
|
43
.github/workflows/unit_tests.yml
vendored
43
.github/workflows/unit_tests.yml
vendored
@ -27,24 +27,21 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest, macos-12]
|
os: [ubuntu-latest, windows-latest]
|
||||||
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:
|
||||||
# Label used to access the service container
|
# Label used to access the service container
|
||||||
@ -69,17 +66,43 @@ jobs:
|
|||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: |
|
run: |
|
||||||
export PYTHONUNBUFFERED=1
|
export PYTHONUNBUFFERED=1
|
||||||
poetry run pytest tests --cov --no-cov-on-fail --cov-report=
|
poetry run pytest tests/units --cov --no-cov-on-fail --cov-report=
|
||||||
- name: Run unit tests w/ redis
|
- name: Run unit tests w/ redis
|
||||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||||
run: |
|
run: |
|
||||||
export PYTHONUNBUFFERED=1
|
export PYTHONUNBUFFERED=1
|
||||||
export REDIS_URL=redis://localhost:6379
|
export REDIS_URL=redis://localhost:6379
|
||||||
poetry run pytest tests --cov --no-cov-on-fail --cov-report=
|
poetry run pytest tests/units --cov --no-cov-on-fail --cov-report=
|
||||||
# Change to explicitly install v1 when reflex-hosting-cli is compatible with v2
|
# Change to explicitly install v1 when reflex-hosting-cli is compatible with v2
|
||||||
- name: Run unit tests w/ pydantic v1
|
- name: Run unit tests w/ pydantic v1
|
||||||
run: |
|
run: |
|
||||||
export PYTHONUNBUFFERED=1
|
export PYTHONUNBUFFERED=1
|
||||||
poetry run uv pip install "pydantic~=1.10"
|
poetry run uv pip install "pydantic~=1.10"
|
||||||
poetry run pytest tests --cov --no-cov-on-fail --cov-report=
|
poetry run pytest tests/units --cov --no-cov-on-fail --cov-report=
|
||||||
- run: poetry run coverage html
|
- name: Generate coverage report
|
||||||
|
run: poetry run coverage html
|
||||||
|
|
||||||
|
unit-tests-macos:
|
||||||
|
timeout-minutes: 30
|
||||||
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0']
|
||||||
|
runs-on: macos-12
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/setup_build_env
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
run-poetry-install: true
|
||||||
|
create-venv-at-path: .venv
|
||||||
|
- name: Run unit tests
|
||||||
|
run: |
|
||||||
|
export PYTHONUNBUFFERED=1
|
||||||
|
poetry run pytest tests/units --cov --no-cov-on-fail --cov-report=
|
||||||
|
- name: Run unit tests w/ pydantic v1
|
||||||
|
run: |
|
||||||
|
export PYTHONUNBUFFERED=1
|
||||||
|
poetry run uv pip install "pydantic~=1.10"
|
||||||
|
poetry run pytest tests/units --cov --no-cov-on-fail --cov-report=
|
@ -3,10 +3,10 @@ fail_fast: true
|
|||||||
repos:
|
repos:
|
||||||
|
|
||||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||||
rev: v0.4.10
|
rev: v0.6.9
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
args: [integration, reflex, tests]
|
args: [reflex, tests]
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: ["--fix", "--exit-non-zero-on-fix"]
|
args: ["--fix", "--exit-non-zero-on-fix"]
|
||||||
exclude: '^integration/benchmarks/'
|
exclude: '^integration/benchmarks/'
|
||||||
@ -25,7 +25,7 @@ repos:
|
|||||||
rev: v1.1.313
|
rev: v1.1.313
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyright
|
- id: pyright
|
||||||
args: [integration, reflex, tests]
|
args: [reflex, tests]
|
||||||
language: system
|
language: system
|
||||||
|
|
||||||
- repo: https://github.com/terrencepreilly/darglint
|
- repo: https://github.com/terrencepreilly/darglint
|
||||||
|
@ -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:**
|
||||||
@ -69,7 +69,7 @@ In your `reflex` directory run make sure all the unit tests are still passing us
|
|||||||
This will fail if code coverage is below 70%.
|
This will fail if code coverage is below 70%.
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
poetry run pytest tests --cov --no-cov-on-fail --cov-report=
|
poetry run pytest tests/units --cov --no-cov-on-fail --cov-report=
|
||||||
```
|
```
|
||||||
|
|
||||||
Next make sure all the following tests pass. This ensures that every new change has proper documentation and type checking.
|
Next make sure all the following tests pass. This ensures that every new change has proper documentation and type checking.
|
||||||
@ -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
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
### **✨ Performant, customizable web apps in pure Python. Deploy in seconds. ✨**
|
### **✨ Performant, customizable web apps in pure Python. Deploy in seconds. ✨**
|
||||||
[](https://badge.fury.io/py/reflex)
|
[](https://badge.fury.io/py/reflex)
|
||||||

|
|
||||||

|

|
||||||
[](https://reflex.dev/docs/getting-started/introduction)
|
[](https://reflex.dev/docs/getting-started/introduction)
|
||||||
[](https://discord.gg/T5WSbC2YtQ)
|
[](https://discord.gg/T5WSbC2YtQ)
|
||||||
@ -18,7 +17,7 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md)
|
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -35,7 +34,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
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from utils import send_data_to_posthog
|
from utils import send_data_to_posthog
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ def insert_benchmarking_data(
|
|||||||
send_data_to_posthog("lighthouse_benchmark", properties)
|
send_data_to_posthog("lighthouse_benchmark", properties)
|
||||||
|
|
||||||
|
|
||||||
def get_lighthouse_scores(directory_path: str) -> dict:
|
def get_lighthouse_scores(directory_path: str | Path) -> dict:
|
||||||
"""Extracts the Lighthouse scores from the JSON files in the specified directory.
|
"""Extracts the Lighthouse scores from the JSON files in the specified directory.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -38,24 +38,21 @@ def get_lighthouse_scores(directory_path: str) -> dict:
|
|||||||
dict: The Lighthouse scores.
|
dict: The Lighthouse scores.
|
||||||
"""
|
"""
|
||||||
scores = {}
|
scores = {}
|
||||||
|
directory_path = Path(directory_path)
|
||||||
try:
|
try:
|
||||||
for filename in os.listdir(directory_path):
|
for filename in directory_path.iterdir():
|
||||||
if filename.endswith(".json") and filename != "manifest.json":
|
if filename.suffix == ".json" and filename.stem != "manifest":
|
||||||
file_path = os.path.join(directory_path, filename)
|
file_path = directory_path / filename
|
||||||
with open(file_path, "r") as file:
|
data = json.loads(file_path.read_text())
|
||||||
data = json.load(file)
|
# Extract scores and add them to the dictionary with the filename as key
|
||||||
# Extract scores and add them to the dictionary with the filename as key
|
scores[data["finalUrl"].replace("http://localhost:3000/", "/")] = {
|
||||||
scores[data["finalUrl"].replace("http://localhost:3000/", "/")] = {
|
"performance_score": data["categories"]["performance"]["score"],
|
||||||
"performance_score": data["categories"]["performance"]["score"],
|
"accessibility_score": data["categories"]["accessibility"]["score"],
|
||||||
"accessibility_score": data["categories"]["accessibility"][
|
"best_practices_score": data["categories"]["best-practices"][
|
||||||
"score"
|
"score"
|
||||||
],
|
],
|
||||||
"best_practices_score": data["categories"]["best-practices"][
|
"seo_score": data["categories"]["seo"]["score"],
|
||||||
"score"
|
}
|
||||||
],
|
|
||||||
"seo_score": data["categories"]["seo"]["score"],
|
|
||||||
}
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return {"error": e}
|
return {"error": e}
|
||||||
|
|
||||||
|
@ -2,11 +2,12 @@
|
|||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from utils import get_directory_size, get_python_version, send_data_to_posthog
|
from utils import get_directory_size, get_python_version, send_data_to_posthog
|
||||||
|
|
||||||
|
|
||||||
def get_package_size(venv_path, os_name):
|
def get_package_size(venv_path: Path, os_name):
|
||||||
"""Get the size of a specified package.
|
"""Get the size of a specified package.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -26,14 +27,12 @@ def get_package_size(venv_path, os_name):
|
|||||||
|
|
||||||
is_windows = "windows" in os_name
|
is_windows = "windows" in os_name
|
||||||
|
|
||||||
full_path = (
|
package_dir: Path = (
|
||||||
["lib", f"python{python_version}", "site-packages"]
|
venv_path / "lib" / f"python{python_version}" / "site-packages"
|
||||||
if not is_windows
|
if not is_windows
|
||||||
else ["Lib", "site-packages"]
|
else venv_path / "Lib" / "site-packages"
|
||||||
)
|
)
|
||||||
|
if not package_dir.exists():
|
||||||
package_dir = os.path.join(venv_path, *full_path)
|
|
||||||
if not os.path.exists(package_dir):
|
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Error: Virtual environment does not exist or is not activated."
|
"Error: Virtual environment does not exist or is not activated."
|
||||||
)
|
)
|
||||||
@ -63,9 +62,9 @@ def insert_benchmarking_data(
|
|||||||
path: The path to the dir or file to check size.
|
path: The path to the dir or file to check size.
|
||||||
"""
|
"""
|
||||||
if "./dist" in path:
|
if "./dist" in path:
|
||||||
size = get_directory_size(path)
|
size = get_directory_size(Path(path))
|
||||||
else:
|
else:
|
||||||
size = get_package_size(path, os_type_version)
|
size = get_package_size(Path(path), os_type_version)
|
||||||
|
|
||||||
# Prepare the event data
|
# Prepare the event data
|
||||||
properties = {
|
properties = {
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from utils import get_directory_size, send_data_to_posthog
|
from utils import get_directory_size, send_data_to_posthog
|
||||||
|
|
||||||
@ -28,7 +29,7 @@ def insert_benchmarking_data(
|
|||||||
pr_id: The id of the PR.
|
pr_id: The id of the PR.
|
||||||
path: The path to the dir or file to check size.
|
path: The path to the dir or file to check size.
|
||||||
"""
|
"""
|
||||||
size = get_directory_size(path)
|
size = get_directory_size(Path(path))
|
||||||
|
|
||||||
# Prepare the event data
|
# Prepare the event data
|
||||||
properties = {
|
properties = {
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
from httpx import HTTPError
|
from httpx import HTTPError
|
||||||
|
|
||||||
|
|
||||||
def get_python_version(venv_path, os_name):
|
def get_python_version(venv_path: Path, os_name):
|
||||||
"""Get the python version of python in a virtual env.
|
"""Get the python version of python in a virtual env.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -18,13 +19,13 @@ def get_python_version(venv_path, os_name):
|
|||||||
The python version.
|
The python version.
|
||||||
"""
|
"""
|
||||||
python_executable = (
|
python_executable = (
|
||||||
os.path.join(venv_path, "bin", "python")
|
venv_path / "bin" / "python"
|
||||||
if "windows" not in os_name
|
if "windows" not in os_name
|
||||||
else os.path.join(venv_path, "Scripts", "python.exe")
|
else venv_path / "Scripts" / "python.exe"
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
output = subprocess.check_output(
|
output = subprocess.check_output(
|
||||||
[python_executable, "--version"], stderr=subprocess.STDOUT
|
[str(python_executable), "--version"], stderr=subprocess.STDOUT
|
||||||
)
|
)
|
||||||
python_version = output.decode("utf-8").strip().split()[1]
|
python_version = output.decode("utf-8").strip().split()[1]
|
||||||
return ".".join(python_version.split(".")[:-1])
|
return ".".join(python_version.split(".")[:-1])
|
||||||
@ -32,7 +33,7 @@ def get_python_version(venv_path, os_name):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def get_directory_size(directory):
|
def get_directory_size(directory: Path):
|
||||||
"""Get the size of a directory in bytes.
|
"""Get the size of a directory in bytes.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -44,8 +45,8 @@ def get_directory_size(directory):
|
|||||||
total_size = 0
|
total_size = 0
|
||||||
for dirpath, _, filenames in os.walk(directory):
|
for dirpath, _, filenames in os.walk(directory):
|
||||||
for f in filenames:
|
for f in filenames:
|
||||||
fp = os.path.join(dirpath, f)
|
fp = Path(dirpath) / f
|
||||||
total_size += os.path.getsize(fp)
|
total_size += fp.stat().st_size
|
||||||
return total_size
|
return total_size
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
### **✨ Performante, anpassbare Web-Apps in purem Python. Bereitstellung in Sekunden. ✨**
|
### **✨ Performante, anpassbare Web-Apps in purem Python. Bereitstellung in Sekunden. ✨**
|
||||||
[](https://badge.fury.io/py/reflex)
|
[](https://badge.fury.io/py/reflex)
|
||||||

|
|
||||||

|

|
||||||
[](https://reflex.dev/docs/getting-started/introduction)
|
[](https://reflex.dev/docs/getting-started/introduction)
|
||||||
[](https://discord.gg/T5WSbC2YtQ)
|
[](https://discord.gg/T5WSbC2YtQ)
|
||||||
@ -35,7 +34,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
|
||||||
|
@ -11,7 +11,6 @@ Pynecone की तलाश हैं? आप सही रेपो में
|
|||||||
### **✨ प्रदर्शनकारी, अनुकूलित वेब ऐप्स, शुद्ध Python में। सेकंडों में तैनात करें। ✨**
|
### **✨ प्रदर्शनकारी, अनुकूलित वेब ऐप्स, शुद्ध Python में। सेकंडों में तैनात करें। ✨**
|
||||||
|
|
||||||
[](https://badge.fury.io/py/reflex)
|
[](https://badge.fury.io/py/reflex)
|
||||||

|
|
||||||

|

|
||||||
[](https://reflex.dev/docs/getting-started/introduction)
|
[](https://reflex.dev/docs/getting-started/introduction)
|
||||||
[](https://discord.gg/T5WSbC2YtQ)
|
[](https://discord.gg/T5WSbC2YtQ)
|
||||||
@ -36,7 +35,7 @@ Reflex के अंदर के कामकाज को जानने क
|
|||||||
|
|
||||||
## ⚙️ इंस्टॉलेशन (Installation)
|
## ⚙️ इंस्टॉलेशन (Installation)
|
||||||
|
|
||||||
एक टर्मिनल खोलें और चलाएं (Python 3.8+ की आवश्यकता है):
|
एक टर्मिनल खोलें और चलाएं (Python 3.9+ की आवश्यकता है):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
### **✨ App web performanti e personalizzabili in puro Python. Distribuisci in pochi secondi. ✨**
|
### **✨ App web performanti e personalizzabili in puro Python. Distribuisci in pochi secondi. ✨**
|
||||||
[](https://badge.fury.io/py/reflex)
|
[](https://badge.fury.io/py/reflex)
|
||||||

|
|
||||||

|

|
||||||
[](https://reflex.dev/docs/getting-started/introduction)
|
[](https://reflex.dev/docs/getting-started/introduction)
|
||||||
[](https://discord.gg/T5WSbC2YtQ)
|
[](https://discord.gg/T5WSbC2YtQ)
|
||||||
@ -23,7 +22,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
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
### **✨ 即時デプロイが可能な、Pure Python で作ったパフォーマンスと汎用性が高い Web アプリケーション ✨**
|
### **✨ 即時デプロイが可能な、Pure Python で作ったパフォーマンスと汎用性が高い Web アプリケーション ✨**
|
||||||
|
|
||||||
[](https://badge.fury.io/py/reflex)
|
[](https://badge.fury.io/py/reflex)
|
||||||

|
|
||||||

|

|
||||||
[](https://reflex.dev/docs/getting-started/introduction)
|
[](https://reflex.dev/docs/getting-started/introduction)
|
||||||
[](https://discord.gg/T5WSbC2YtQ)
|
[](https://discord.gg/T5WSbC2YtQ)
|
||||||
@ -38,7 +37,7 @@ Reflex がどのように動作しているかを知るには、[アーキテク
|
|||||||
|
|
||||||
## ⚙️ インストール
|
## ⚙️ インストール
|
||||||
|
|
||||||
ターミナルを開いて以下のコマンドを実行してください。(Python 3.8 以上が必要です。):
|
ターミナルを開いて以下のコマンドを実行してください。(Python 3.9 以上が必要です。):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
### **✨ 순수 Python으로 고성능 사용자 정의 웹앱을 만들어 보세요. 몇 초만에 배포 가능합니다. ✨**
|
### **✨ 순수 Python으로 고성능 사용자 정의 웹앱을 만들어 보세요. 몇 초만에 배포 가능합니다. ✨**
|
||||||
[](https://badge.fury.io/py/reflex)
|
[](https://badge.fury.io/py/reflex)
|
||||||

|
|
||||||

|

|
||||||
[](https://reflex.dev/docs/getting-started/introduction)
|
[](https://reflex.dev/docs/getting-started/introduction)
|
||||||
[](https://discord.gg/T5WSbC2YtQ)
|
[](https://discord.gg/T5WSbC2YtQ)
|
||||||
@ -21,7 +20,7 @@
|
|||||||
---
|
---
|
||||||
## ⚙️ 설치
|
## ⚙️ 설치
|
||||||
|
|
||||||
터미널을 열고 실행하세요. (Python 3.8+ 필요):
|
터미널을 열고 실행하세요. (Python 3.9+ 필요):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
### **✨ برنامه های تحت وب قابل تنظیم، کارآمد تماما پایتونی که در چند ثانیه مستقر(دپلوی) میشود. ✨**
|
### **✨ برنامه های تحت وب قابل تنظیم، کارآمد تماما پایتونی که در چند ثانیه مستقر(دپلوی) میشود. ✨**
|
||||||
[](https://badge.fury.io/py/reflex)
|
[](https://badge.fury.io/py/reflex)
|
||||||

|
|
||||||

|

|
||||||
[](https://reflex.dev/docs/getting-started/introduction)
|
[](https://reflex.dev/docs/getting-started/introduction)
|
||||||
[](https://discord.gg/T5WSbC2YtQ)
|
[](https://discord.gg/T5WSbC2YtQ)
|
||||||
@ -35,7 +34,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
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
### **✨ Saf Python'da performanslı, özelleştirilebilir web uygulamaları. Saniyeler içinde dağıtın. ✨**
|
### **✨ Saf Python'da performanslı, özelleştirilebilir web uygulamaları. Saniyeler içinde dağıtın. ✨**
|
||||||
|
|
||||||
[](https://badge.fury.io/py/reflex)
|
[](https://badge.fury.io/py/reflex)
|
||||||

|
|
||||||

|

|
||||||
[](https://reflex.dev/docs/getting-started/introduction)
|
[](https://reflex.dev/docs/getting-started/introduction)
|
||||||
[](https://discord.gg/T5WSbC2YtQ)
|
[](https://discord.gg/T5WSbC2YtQ)
|
||||||
@ -25,7 +24,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
|
||||||
|
267
docs/vi/README.md
Normal file
267
docs/vi/README.md
Normal file
@ -0,0 +1,267 @@
|
|||||||
|
```diff
|
||||||
|
+ Bạn đang tìm kiếm Pynecone? Bạn đã tìm đúng. Pynecone đã được đổi tên thành Reflex. +
|
||||||
|
```
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/reflex-dev/reflex/main/docs/images/reflex_dark.svg#gh-light-mode-only" alt="Reflex Logo" width="300px">
|
||||||
|
<img src="https://raw.githubusercontent.com/reflex-dev/reflex/main/docs/images/reflex_light.svg#gh-dark-mode-only" alt="Reflex Logo" width="300px">
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
### **✨ Ứng dụng web hiệu suất cao, tùy chỉnh bằng Python thuần. Deploy trong vài giây. ✨**
|
||||||
|
[](https://badge.fury.io/py/reflex)
|
||||||
|

|
||||||
|
[](https://reflex.dev/docs/getting-started/introduction)
|
||||||
|
[](https://discord.gg/T5WSbC2YtQ)
|
||||||
|
</div>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md) | [Türkçe](https://github.com/reflex-dev/reflex/blob/main/docs/tr/README.md) | [हिंदी](https://github.com/reflex-dev/reflex/blob/main/docs/in/README.md) | [Português (Brasil)](https://github.com/reflex-dev/reflex/blob/main/docs/pt/pt_br/README.md) | [Italiano](https://github.com/reflex-dev/reflex/blob/main/docs/it/README.md) | [Español](https://github.com/reflex-dev/reflex/blob/main/docs/es/README.md) | [한국어](https://github.com/reflex-dev/reflex/blob/main/docs/kr/README.md) | [日本語](https://github.com/reflex-dev/reflex/blob/main/docs/ja/README.md) | [Deutsch](https://github.com/reflex-dev/reflex/blob/main/docs/de/README.md) | [Persian (پارسی)](https://github.com/reflex-dev/reflex/blob/main/docs/pe/README.md) | [Tiếng Việt](https://github.com/reflex-dev/reflex/blob/main/docs/vi/README.md)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# Reflex
|
||||||
|
|
||||||
|
Reflex là một thư viện để xây dựng ứng dụng web toàn bộ bằng Python thuần.
|
||||||
|
|
||||||
|
Các tính năng chính:
|
||||||
|
* **Python thuần tuý** - Viết toàn bộ ứng dụng cả backend và frontend hoàn toàn bằng Python, không cần học JavaScript.
|
||||||
|
* **Full Flexibility** - Reflex dễ dàng để bắt đầu, nhưng cũng có thể mở rộng lên các ứng dụng phức tạp.
|
||||||
|
* **Deploy Instantly** - Sau khi xây dựng ứng dụng, bạn có thể triển khai bằng [một dòng lệnh](https://reflex.dev/docs/hosting/deploy-quick-start/) hoặc triển khai trên server của riêng bạn.
|
||||||
|
|
||||||
|
Đọc [bài viết về kiến trúc hệ thống](https://reflex.dev/blog/2024-03-21-reflex-architecture/#the-reflex-architecture) để hiểu rõ các hoạt động của Reflex.
|
||||||
|
|
||||||
|
## ⚙️ Cài đặt
|
||||||
|
|
||||||
|
Mở cửa sổ lệnh và chạy (Yêu cầu Python phiên bản 3.9+):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install reflex
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🥳 Tạo ứng dụng đầu tiên
|
||||||
|
|
||||||
|
Cài đặt `reflex` cũng như cài đặt công cụ dòng lệnh `reflex`.
|
||||||
|
|
||||||
|
Kiểm tra việc cài đặt đã thành công hay chưa bằng cách tạo mới một ứng dụng. (Thay `my_app_name` bằng tên ứng dụng của bạn):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir my_app_name
|
||||||
|
cd my_app_name
|
||||||
|
reflex init
|
||||||
|
```
|
||||||
|
|
||||||
|
Lệnh này tạo ra một ứng dụng mẫu trong một thư mục mới.
|
||||||
|
|
||||||
|
Bạn có thể chạy ứng dụng ở chế độ phát triển.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
reflex run
|
||||||
|
```
|
||||||
|
|
||||||
|
Bạn có thể xem ứng dụng của bạn ở địa chỉ http://localhost:3000.
|
||||||
|
|
||||||
|
Bạn có thể thay đổi mã nguồn ở `my_app_name/my_app_name.py`. Reflex nhanh chóng làm mới và bạn có thể thấy thay đổi trên ứng dụng của bạn ngay lập tức khi bạn lưu file.
|
||||||
|
|
||||||
|
|
||||||
|
## 🫧 Ứng dụng ví dụ
|
||||||
|
|
||||||
|
Bắt đầu với ví dụ: tạo một ứng dụng tạo ảnh bằng [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node). Để cho đơn giản, chúng ta sẽ sử dụng [OpenAI API](https://platform.openai.com/docs/api-reference/authentication), nhưng bạn có thể sử dụng model của chính bạn được triển khai trên local.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/reflex-dev/reflex/main/docs/images/dalle.gif" alt="A frontend wrapper for DALL·E, shown in the process of generating an image." width="550" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Đây là toàn bộ đoạn mã để xây dựng ứng dụng trên. Nó được viết hoàn toàn trong một file Python!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```python
|
||||||
|
import reflex as rx
|
||||||
|
import openai
|
||||||
|
|
||||||
|
openai_client = openai.OpenAI()
|
||||||
|
|
||||||
|
|
||||||
|
class State(rx.State):
|
||||||
|
"""The app state."""
|
||||||
|
|
||||||
|
prompt = ""
|
||||||
|
image_url = ""
|
||||||
|
processing = False
|
||||||
|
complete = False
|
||||||
|
|
||||||
|
def get_image(self):
|
||||||
|
"""Get the image from the prompt."""
|
||||||
|
if self.prompt == "":
|
||||||
|
return rx.window_alert("Prompt Empty")
|
||||||
|
|
||||||
|
self.processing, self.complete = True, False
|
||||||
|
yield
|
||||||
|
response = openai_client.images.generate(
|
||||||
|
prompt=self.prompt, n=1, size="1024x1024"
|
||||||
|
)
|
||||||
|
self.image_url = response.data[0].url
|
||||||
|
self.processing, self.complete = False, True
|
||||||
|
|
||||||
|
|
||||||
|
def index():
|
||||||
|
return rx.center(
|
||||||
|
rx.vstack(
|
||||||
|
rx.heading("DALL-E", font_size="1.5em"),
|
||||||
|
rx.input(
|
||||||
|
placeholder="Enter a prompt..",
|
||||||
|
on_blur=State.set_prompt,
|
||||||
|
width="25em",
|
||||||
|
),
|
||||||
|
rx.button(
|
||||||
|
"Generate Image",
|
||||||
|
on_click=State.get_image,
|
||||||
|
width="25em",
|
||||||
|
loading=State.processing
|
||||||
|
),
|
||||||
|
rx.cond(
|
||||||
|
State.complete,
|
||||||
|
rx.image(src=State.image_url, width="20em"),
|
||||||
|
),
|
||||||
|
align="center",
|
||||||
|
),
|
||||||
|
width="100%",
|
||||||
|
height="100vh",
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add state and page to the app.
|
||||||
|
app = rx.App()
|
||||||
|
app.add_page(index, title="Reflex:DALL-E")
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Hãy phân tích chi tiết.
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<img src="../images/dalle_colored_code_example.png" alt="Explaining the differences between backend and frontend parts of the DALL-E app." width="900" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
### **Reflex UI**
|
||||||
|
|
||||||
|
Bắt đầu với giao diện chính.
|
||||||
|
|
||||||
|
```python
|
||||||
|
def index():
|
||||||
|
return rx.center(
|
||||||
|
...
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
Hàm `index` định nghĩa phần giao diện chính của ứng dụng.
|
||||||
|
|
||||||
|
Chúng tôi sử dụng các component (thành phần) khác nhau như `center`, `vstack`, `input` và `button` để xây dựng giao diện phía trước.
|
||||||
|
Các component có thể được lồng vào nhau để tạo ra các bố cục phức tạp. Và bạn cũng có thể sử dụng từ khoá `args` để tận dụng đầy đủ sức mạnh của CSS.
|
||||||
|
|
||||||
|
Reflex có đến hơn [60 component được xây dựng sẵn](https://reflex.dev/docs/library) để giúp bạn bắt đầu. Chúng ta có thể tạo ra một component mới khá dễ dàng, thao khảo: [xây dựng component của riêng bạn](https://reflex.dev/docs/wrapping-react/overview/).
|
||||||
|
|
||||||
|
### **State**
|
||||||
|
|
||||||
|
Reflex biểu diễn giao diện bằng các hàm của state (trạng thái).
|
||||||
|
|
||||||
|
```python
|
||||||
|
class State(rx.State):
|
||||||
|
"""The app state."""
|
||||||
|
prompt = ""
|
||||||
|
image_url = ""
|
||||||
|
processing = False
|
||||||
|
complete = False
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Một state định nghĩa các biến (được gọi là vars) có thể thay đổi trong một ứng dụng và cho phép các hàm có thể thay đổi chúng.
|
||||||
|
|
||||||
|
Tại đây state được cấu thành từ một `prompt` và `image_url`.
|
||||||
|
Có cũng những biến boolean `processing` và `complete`
|
||||||
|
để chỉ ra khi nào tắt nút (trong quá trình tạo hình ảnh)
|
||||||
|
và khi nào hiển thị hình ảnh kết quả.
|
||||||
|
|
||||||
|
### **Event Handlers**
|
||||||
|
|
||||||
|
```python
|
||||||
|
def get_image(self):
|
||||||
|
"""Get the image from the prompt."""
|
||||||
|
if self.prompt == "":
|
||||||
|
return rx.window_alert("Prompt Empty")
|
||||||
|
|
||||||
|
self.processing, self.complete = True, False
|
||||||
|
yield
|
||||||
|
response = openai_client.images.generate(
|
||||||
|
prompt=self.prompt, n=1, size="1024x1024"
|
||||||
|
)
|
||||||
|
self.image_url = response.data[0].url
|
||||||
|
self.processing, self.complete = False, True
|
||||||
|
```
|
||||||
|
|
||||||
|
Với các state, chúng ta định nghĩa các hàm có thể thay đổi state vars được gọi là event handlers. Event handler là cách chúng ta có thể thay đổi state trong Reflex. Chúng có thể là phản hồi khi người dùng thao tác, chằng hạn khi nhấn vào nút hoặc khi đang nhập trong text box. Các hành động này được gọi là event.
|
||||||
|
|
||||||
|
Ứng dụng DALL·E. của chúng ta có một event handler, `get_image` để lấy hình ảnh từ OpenAI API. Sử dụng từ khoá `yield` in ở giữa event handler để cập nhật giao diện. Hoặc giao diện có thể cập nhật ở cuối event handler.
|
||||||
|
|
||||||
|
### **Routing**
|
||||||
|
|
||||||
|
Cuối cùng, chúng ta định nghĩa một ứng dụng.
|
||||||
|
|
||||||
|
```python
|
||||||
|
app = rx.App()
|
||||||
|
```
|
||||||
|
|
||||||
|
Chúng ta thêm một trang ở đầu ứng dụng bằng index component. Chúng ta cũng thêm tiêu đề của ứng dụng để hiển thị lên trình duyệt.
|
||||||
|
|
||||||
|
|
||||||
|
```python
|
||||||
|
app.add_page(index, title="DALL-E")
|
||||||
|
```
|
||||||
|
|
||||||
|
Bạn có thể tạo một ứng dụng nhiều trang bằng cách thêm trang.
|
||||||
|
|
||||||
|
## 📑 Tài liệu
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
📑 [Docs](https://reflex.dev/docs/getting-started/introduction) | 🗞️ [Blog](https://reflex.dev/blog) | 📱 [Component Library](https://reflex.dev/docs/library) | 🖼️ [Gallery](https://reflex.dev/docs/gallery) | 🛸 [Deployment](https://reflex.dev/docs/hosting/deploy-quick-start)
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
## ✅ Status
|
||||||
|
|
||||||
|
Reflex phát hành vào tháng 12/2022 với tên là Pynecone.
|
||||||
|
|
||||||
|
Đến tháng 02/2024, chúng tôi tạo ra dịch vụ dưới phiên bản alpha! Trong thời gian này mọi người có thể triển khai ứng dụng hoàn toàn miễn phí. Xem [roadmap](https://github.com/reflex-dev/reflex/issues/2727) để biết thêm chi tiết.
|
||||||
|
|
||||||
|
Reflex ra phiên bản mới với các tính năng mới hàng tuần! Hãy :star: star và :eyes: watch repo này để thấy các cập nhật mới nhất.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Chúng tôi chào đón mọi đóng góp dù lớn hay nhỏ. Dưới đây là các cách để bắt đầu với cộng đồng Reflex.
|
||||||
|
|
||||||
|
- **Discord**: [Discord](https://discord.gg/T5WSbC2YtQ) của chúng tôi là nơi tốt nhất để nhờ sự giúp đỡ và thảo luận các bạn có thể đóng góp.
|
||||||
|
- **GitHub Discussions**: Là cách tốt nhất để thảo luận về các tính năng mà bạn có thể đóng góp hoặc những điều bạn chưa rõ.
|
||||||
|
- **GitHub Issues**: [Issues](https://github.com/reflex-dev/reflex/issues) là nơi tốt nhất để thông báo. Ngoài ra bạn có thể sửa chữa các vấn đề bằng cách tạo PR.
|
||||||
|
|
||||||
|
Chúng tôi luôn sẵn sàng tìm kiếm các contributor, bất kể kinh nghiệm. Để tham gia đóng góp, xin mời xem
|
||||||
|
[CONTIBUTING.md](https://github.com/reflex-dev/reflex/blob/main/CONTRIBUTING.md)
|
||||||
|
|
||||||
|
|
||||||
|
## Xin cảm ơn các Contributors:
|
||||||
|
<a href="https://github.com/reflex-dev/reflex/graphs/contributors">
|
||||||
|
<img src="https://contrib.rocks/image?repo=reflex-dev/reflex" />
|
||||||
|
</a>
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Reflex là mã nguồn mở và sử dụng giấy phép [Apache License 2.0](LICENSE).
|
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
### **✨ 使用 Python 创建高效且可自定义的网页应用程序,几秒钟内即可部署.✨**
|
### **✨ 使用 Python 创建高效且可自定义的网页应用程序,几秒钟内即可部署.✨**
|
||||||
[](https://badge.fury.io/py/reflex)
|
[](https://badge.fury.io/py/reflex)
|
||||||

|
|
||||||

|

|
||||||
[](https://reflex.dev/docs/getting-started/introduction)
|
[](https://reflex.dev/docs/getting-started/introduction)
|
||||||
[](https://discord.gg/T5WSbC2YtQ)
|
[](https://discord.gg/T5WSbC2YtQ)
|
||||||
@ -35,7 +34,7 @@ Reflex 是一个使用纯Python构建全栈web应用的库。
|
|||||||
|
|
||||||
## ⚙️ 安装
|
## ⚙️ 安装
|
||||||
|
|
||||||
打开一个终端并且运行(要求Python3.8+):
|
打开一个终端并且运行(要求Python3.9+):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
**✨ 使用 Python 建立高效且可自訂的網頁應用程式,幾秒鐘內即可部署。✨**
|
**✨ 使用 Python 建立高效且可自訂的網頁應用程式,幾秒鐘內即可部署。✨**
|
||||||
|
|
||||||
[](https://badge.fury.io/py/reflex)
|
[](https://badge.fury.io/py/reflex)
|
||||||

|
|
||||||

|

|
||||||
[](https://reflex.dev/docs/getting-started/introduction)
|
[](https://reflex.dev/docs/getting-started/introduction)
|
||||||
[](https://discord.gg/T5WSbC2YtQ)
|
[](https://discord.gg/T5WSbC2YtQ)
|
||||||
@ -37,7 +36,7 @@ Reflex 是一個可以用純 Python 構建全端網頁應用程式的函式庫
|
|||||||
|
|
||||||
## ⚙️ 安裝
|
## ⚙️ 安裝
|
||||||
|
|
||||||
開啟一個終端機並且執行 (需要 Python 3.8+):
|
開啟一個終端機並且執行 (需要 Python 3.9+):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install reflex
|
pip install reflex
|
||||||
|
@ -1,107 +0,0 @@
|
|||||||
"""Test that per-component state scaffold works and operates independently."""
|
|
||||||
|
|
||||||
from typing import Generator
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
from selenium.webdriver.common.by import By
|
|
||||||
|
|
||||||
from reflex.testing import AppHarness
|
|
||||||
|
|
||||||
from . import utils
|
|
||||||
|
|
||||||
|
|
||||||
def ComponentStateApp():
|
|
||||||
"""App using per component state."""
|
|
||||||
import reflex as rx
|
|
||||||
|
|
||||||
class MultiCounter(rx.ComponentState):
|
|
||||||
count: int = 0
|
|
||||||
|
|
||||||
def increment(self):
|
|
||||||
self.count += 1
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def get_component(cls, *children, **props):
|
|
||||||
return rx.vstack(
|
|
||||||
*children,
|
|
||||||
rx.heading(cls.count, id=f"count-{props.get('id', 'default')}"),
|
|
||||||
rx.button(
|
|
||||||
"Increment",
|
|
||||||
on_click=cls.increment,
|
|
||||||
id=f"button-{props.get('id', 'default')}",
|
|
||||||
),
|
|
||||||
**props,
|
|
||||||
)
|
|
||||||
|
|
||||||
app = rx.App(state=rx.State) # noqa
|
|
||||||
|
|
||||||
@rx.page()
|
|
||||||
def index():
|
|
||||||
mc_a = MultiCounter.create(id="a")
|
|
||||||
mc_b = MultiCounter.create(id="b")
|
|
||||||
assert mc_a.State != mc_b.State
|
|
||||||
return rx.vstack(
|
|
||||||
mc_a,
|
|
||||||
mc_b,
|
|
||||||
rx.button(
|
|
||||||
"Inc A",
|
|
||||||
on_click=mc_a.State.increment, # type: ignore
|
|
||||||
id="inc-a",
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
|
||||||
def component_state_app(tmp_path) -> Generator[AppHarness, None, None]:
|
|
||||||
"""Start ComponentStateApp app at tmp_path via AppHarness.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
tmp_path: pytest tmp_path fixture
|
|
||||||
|
|
||||||
Yields:
|
|
||||||
running AppHarness instance
|
|
||||||
"""
|
|
||||||
with AppHarness.create(
|
|
||||||
root=tmp_path,
|
|
||||||
app_source=ComponentStateApp, # type: ignore
|
|
||||||
) as harness:
|
|
||||||
yield harness
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_component_state_app(component_state_app: AppHarness):
|
|
||||||
"""Increment counters independently.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
component_state_app: harness for ComponentStateApp app
|
|
||||||
"""
|
|
||||||
assert component_state_app.app_instance is not None, "app is not running"
|
|
||||||
driver = component_state_app.frontend()
|
|
||||||
|
|
||||||
ss = utils.SessionStorage(driver)
|
|
||||||
assert AppHarness._poll_for(lambda: ss.get("token") is not None), "token not found"
|
|
||||||
|
|
||||||
count_a = driver.find_element(By.ID, "count-a")
|
|
||||||
count_b = driver.find_element(By.ID, "count-b")
|
|
||||||
button_a = driver.find_element(By.ID, "button-a")
|
|
||||||
button_b = driver.find_element(By.ID, "button-b")
|
|
||||||
button_inc_a = driver.find_element(By.ID, "inc-a")
|
|
||||||
|
|
||||||
assert count_a.text == "0"
|
|
||||||
|
|
||||||
button_a.click()
|
|
||||||
assert component_state_app.poll_for_content(count_a, exp_not_equal="0") == "1"
|
|
||||||
|
|
||||||
button_a.click()
|
|
||||||
assert component_state_app.poll_for_content(count_a, exp_not_equal="1") == "2"
|
|
||||||
|
|
||||||
button_inc_a.click()
|
|
||||||
assert component_state_app.poll_for_content(count_a, exp_not_equal="2") == "3"
|
|
||||||
|
|
||||||
assert count_b.text == "0"
|
|
||||||
|
|
||||||
button_b.click()
|
|
||||||
assert component_state_app.poll_for_content(count_b, exp_not_equal="0") == "1"
|
|
||||||
|
|
||||||
button_b.click()
|
|
||||||
assert component_state_app.poll_for_content(count_b, exp_not_equal="1") == "2"
|
|
@ -1,68 +0,0 @@
|
|||||||
"""Integration tests for all urls in Reflex."""
|
|
||||||
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
import requests
|
|
||||||
|
|
||||||
|
|
||||||
def check_urls(repo_dir):
|
|
||||||
"""Check that all URLs in the repo are valid and secure.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
repo_dir: The directory of the repo.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
A list of errors.
|
|
||||||
"""
|
|
||||||
url_pattern = re.compile(r'http[s]?://reflex\.dev[^\s")]*')
|
|
||||||
errors = []
|
|
||||||
|
|
||||||
for root, _dirs, files in os.walk(repo_dir):
|
|
||||||
if "__pycache__" in root:
|
|
||||||
continue
|
|
||||||
|
|
||||||
for file_name in files:
|
|
||||||
if not file_name.endswith(".py") and not file_name.endswith(".md"):
|
|
||||||
continue
|
|
||||||
|
|
||||||
file_path = os.path.join(root, file_name)
|
|
||||||
try:
|
|
||||||
with open(file_path, "r", encoding="utf-8", errors="ignore") as file:
|
|
||||||
for line in file:
|
|
||||||
urls = url_pattern.findall(line)
|
|
||||||
for url in set(urls):
|
|
||||||
if url.startswith("http://"):
|
|
||||||
errors.append(
|
|
||||||
f"Found insecure HTTP URL: {url} in {file_path}"
|
|
||||||
)
|
|
||||||
url = url.strip('"\n')
|
|
||||||
try:
|
|
||||||
response = requests.head(
|
|
||||||
url, allow_redirects=True, timeout=5
|
|
||||||
)
|
|
||||||
response.raise_for_status()
|
|
||||||
except requests.RequestException as e:
|
|
||||||
errors.append(
|
|
||||||
f"Error accessing URL: {url} in {file_path} | Error: {e}, , Check your path ends with a /"
|
|
||||||
)
|
|
||||||
except Exception as e:
|
|
||||||
errors.append(f"Error reading file: {file_path} | Error: {e}")
|
|
||||||
|
|
||||||
return errors
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
"repo_dir",
|
|
||||||
[Path(__file__).resolve().parent.parent / "reflex"],
|
|
||||||
)
|
|
||||||
def test_find_and_check_urls(repo_dir):
|
|
||||||
"""Test that all URLs in the repo are valid and secure.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
repo_dir: The directory of the repo.
|
|
||||||
"""
|
|
||||||
errors = check_urls(repo_dir)
|
|
||||||
assert not errors, "\n".join(errors)
|
|
2062
poetry.lock
generated
2062
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.4dev1"
|
||||||
description = "Web apps in pure Python."
|
description = "Web apps in pure Python."
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
authors = [
|
authors = [
|
||||||
@ -26,8 +26,7 @@ packages = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.8"
|
python = "^3.9"
|
||||||
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"
|
||||||
jinja2 = ">=3.1.2,<4.0"
|
jinja2 = ">=3.1.2,<4.0"
|
||||||
@ -54,34 +53,31 @@ reflex-hosting-cli = ">=0.1.2,<2.0"
|
|||||||
charset-normalizer = ">=3.3.2,<4.0"
|
charset-normalizer = ">=3.3.2,<4.0"
|
||||||
wheel = ">=0.42.0,<1.0"
|
wheel = ">=0.42.0,<1.0"
|
||||||
build = ">=1.0.3,<2.0"
|
build = ">=1.0.3,<2.0"
|
||||||
setuptools = ">=69.1.1,<70.2"
|
setuptools = ">=75.0"
|
||||||
httpx = ">=0.25.1,<1.0"
|
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.0a6"
|
reflex-chakra = ">=0.6.0"
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
pytest = ">=7.1.2,<8.0"
|
pytest = ">=7.1.2,<9.0"
|
||||||
pytest-mock = ">=3.10.0,<4.0"
|
pytest-mock = ">=3.10.0,<4.0"
|
||||||
pyright = ">=1.1.229,<1.1.335"
|
pyright = ">=1.1.229,<1.1.335"
|
||||||
darglint = ">=1.8.1,<2.0"
|
darglint = ">=1.8.1,<2.0"
|
||||||
toml = ">=0.10.2,<1.0"
|
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.24.0"
|
||||||
pytest-cov = ">=4.0.0,<5.0"
|
pytest-cov = ">=4.0.0,<6.0"
|
||||||
ruff = "^0.4.9"
|
ruff = "^0.6.9"
|
||||||
pandas = [
|
pandas = ">=2.1.1,<3.0"
|
||||||
{version = ">=2.1.1,<3.0", python = ">=3.9,<3.13"},
|
pillow = ">=10.0.0,<12.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"
|
||||||
|
playwright = ">=1.46.0"
|
||||||
|
pytest-playwright = ">=0.5.1"
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
reflex = "reflex.reflex:cli"
|
reflex = "reflex.reflex:cli"
|
||||||
@ -93,7 +89,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"
|
||||||
@ -104,3 +100,7 @@ lint.pydocstyle.convention = "google"
|
|||||||
"reflex/.templates/*.py" = ["D100", "D103", "D104"]
|
"reflex/.templates/*.py" = ["D100", "D103", "D104"]
|
||||||
"*.pyi" = ["D301", "D415", "D417", "D418", "E742"]
|
"*.pyi" = ["D301", "D415", "D417", "D418", "E742"]
|
||||||
"*/blank.py" = ["I001"]
|
"*/blank.py" = ["I001"]
|
||||||
|
|
||||||
|
[tool.pytest.ini_options]
|
||||||
|
asyncio_default_fixture_loop_scope = "function"
|
||||||
|
asyncio_mode = "auto"
|
@ -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"]
|
||||||
|
|
||||||
|
@ -7,6 +7,9 @@ import '/styles/styles.css'
|
|||||||
{% block declaration %}
|
{% block declaration %}
|
||||||
import { EventLoopProvider, StateProvider, defaultColorMode } from "/utils/context.js";
|
import { EventLoopProvider, StateProvider, defaultColorMode } from "/utils/context.js";
|
||||||
import { ThemeProvider } from 'next-themes'
|
import { ThemeProvider } from 'next-themes'
|
||||||
|
{% for library_alias, library_path in window_libraries %}
|
||||||
|
import * as {{library_alias}} from "{{library_path}}";
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
{% for custom_code in custom_codes %}
|
{% for custom_code in custom_codes %}
|
||||||
{{custom_code}}
|
{{custom_code}}
|
||||||
@ -26,6 +29,15 @@ function AppWrap({children}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function MyApp({ Component, pageProps }) {
|
export default function MyApp({ Component, pageProps }) {
|
||||||
|
React.useEffect(() => {
|
||||||
|
// Make contexts and state objects available globally for dynamic eval'd components
|
||||||
|
let windowImports = {
|
||||||
|
{% for library_alias, library_path in window_libraries %}
|
||||||
|
"{{library_path}}": {{library_alias}},
|
||||||
|
{% endfor %}
|
||||||
|
};
|
||||||
|
window["__reflex"] = windowImports;
|
||||||
|
}, []);
|
||||||
return (
|
return (
|
||||||
<ThemeProvider defaultTheme={ defaultColorMode } attribute="class">
|
<ThemeProvider defaultTheme={ defaultColorMode } attribute="class">
|
||||||
<AppWrap>
|
<AppWrap>
|
||||||
|
@ -15,6 +15,7 @@ import {
|
|||||||
} from "utils/context.js";
|
} from "utils/context.js";
|
||||||
import debounce from "/utils/helpers/debounce";
|
import debounce from "/utils/helpers/debounce";
|
||||||
import throttle from "/utils/helpers/throttle";
|
import throttle from "/utils/helpers/throttle";
|
||||||
|
import * as Babel from "@babel/standalone";
|
||||||
|
|
||||||
// Endpoint URLs.
|
// Endpoint URLs.
|
||||||
const EVENTURL = env.EVENT;
|
const EVENTURL = env.EVENT;
|
||||||
@ -117,8 +118,8 @@ export const isStateful = () => {
|
|||||||
if (event_queue.length === 0) {
|
if (event_queue.length === 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return event_queue.some(event => event.name.startsWith("reflex___state"));
|
return event_queue.some((event) => event.name.startsWith("reflex___state"));
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply a delta to the state.
|
* Apply a delta to the state.
|
||||||
@ -129,6 +130,22 @@ export const applyDelta = (state, delta) => {
|
|||||||
return { ...state, ...delta };
|
return { ...state, ...delta };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Evaluate a dynamic component.
|
||||||
|
* @param component The component to evaluate.
|
||||||
|
* @returns The evaluated component.
|
||||||
|
*/
|
||||||
|
export const evalReactComponent = async (component) => {
|
||||||
|
if (!window.React && window.__reflex) {
|
||||||
|
window.React = window.__reflex.react;
|
||||||
|
}
|
||||||
|
const output = Babel.transform(component, { presets: ["react"] }).code;
|
||||||
|
const encodedJs = encodeURIComponent(output);
|
||||||
|
const dataUri = "data:text/javascript;charset=utf-8," + encodedJs;
|
||||||
|
const module = await eval(`import(dataUri)`);
|
||||||
|
return module.default;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Only Queue and process events when websocket connection exists.
|
* Only Queue and process events when websocket connection exists.
|
||||||
* @param event The event to queue.
|
* @param event The event to queue.
|
||||||
@ -141,7 +158,7 @@ export const queueEventIfSocketExists = async (events, socket) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await queueEvents(events, socket);
|
await queueEvents(events, socket);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle frontend event or send the event to the backend via Websocket.
|
* Handle frontend event or send the event to the backend via Websocket.
|
||||||
@ -208,7 +225,10 @@ export const applyEvent = async (event, socket) => {
|
|||||||
const a = document.createElement("a");
|
const a = document.createElement("a");
|
||||||
a.hidden = true;
|
a.hidden = true;
|
||||||
// Special case when linking to uploaded files
|
// Special case when linking to uploaded files
|
||||||
a.href = event.payload.url.replace("${getBackendURL(env.UPLOAD)}", getBackendURL(env.UPLOAD))
|
a.href = event.payload.url.replace(
|
||||||
|
"${getBackendURL(env.UPLOAD)}",
|
||||||
|
getBackendURL(env.UPLOAD)
|
||||||
|
);
|
||||||
a.download = event.payload.filename;
|
a.download = event.payload.filename;
|
||||||
a.click();
|
a.click();
|
||||||
a.remove();
|
a.remove();
|
||||||
@ -249,7 +269,7 @@ export const applyEvent = async (event, socket) => {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("_call_script", e);
|
console.log("_call_script", e);
|
||||||
if (window && window?.onerror) {
|
if (window && window?.onerror) {
|
||||||
window.onerror(e.message, null, null, null, e)
|
window.onerror(e.message, null, null, null, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -290,10 +310,9 @@ export const applyEvent = async (event, socket) => {
|
|||||||
export const applyRestEvent = async (event, socket) => {
|
export const applyRestEvent = async (event, socket) => {
|
||||||
let eventSent = false;
|
let eventSent = false;
|
||||||
if (event.handler === "uploadFiles") {
|
if (event.handler === "uploadFiles") {
|
||||||
|
|
||||||
if (event.payload.files === undefined || event.payload.files.length === 0) {
|
if (event.payload.files === undefined || event.payload.files.length === 0) {
|
||||||
// Submit the event over the websocket to trigger the event handler.
|
// Submit the event over the websocket to trigger the event handler.
|
||||||
return await applyEvent(Event(event.name), socket)
|
return await applyEvent(Event(event.name), socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start upload, but do not wait for it, which would block other events.
|
// Start upload, but do not wait for it, which would block other events.
|
||||||
@ -397,7 +416,7 @@ export const connect = async (
|
|||||||
console.log("Disconnect backend before bfcache on navigation");
|
console.log("Disconnect backend before bfcache on navigation");
|
||||||
socket.current.disconnect();
|
socket.current.disconnect();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// Once the socket is open, hydrate the page.
|
// Once the socket is open, hydrate the page.
|
||||||
socket.current.on("connect", () => {
|
socket.current.on("connect", () => {
|
||||||
@ -416,7 +435,7 @@ export const connect = async (
|
|||||||
});
|
});
|
||||||
|
|
||||||
// On each received message, queue the updates and events.
|
// On each received message, queue the updates and events.
|
||||||
socket.current.on("event", (message) => {
|
socket.current.on("event", async (message) => {
|
||||||
const update = JSON5.parse(message);
|
const update = JSON5.parse(message);
|
||||||
for (const substate in update.delta) {
|
for (const substate in update.delta) {
|
||||||
dispatch[substate](update.delta[substate]);
|
dispatch[substate](update.delta[substate]);
|
||||||
@ -525,13 +544,19 @@ export const uploadFiles = async (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an event object.
|
* Create an event object.
|
||||||
* @param name The name of the event.
|
* @param {string} name The name of the event.
|
||||||
* @param payload The payload of the event.
|
* @param {Object.<string, Any>} payload The payload of the event.
|
||||||
* @param handler The client handler to process event.
|
* @param {Object.<string, (number|boolean)>} event_actions The actions to take on the event.
|
||||||
|
* @param {string} handler The client handler to process event.
|
||||||
* @returns The event object.
|
* @returns The event object.
|
||||||
*/
|
*/
|
||||||
export const Event = (name, payload = {}, handler = null) => {
|
export const Event = (
|
||||||
return { name, payload, handler };
|
name,
|
||||||
|
payload = {},
|
||||||
|
event_actions = {},
|
||||||
|
handler = null
|
||||||
|
) => {
|
||||||
|
return { name, payload, handler, event_actions };
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -574,7 +599,11 @@ export const hydrateClientStorage = (client_storage) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (client_storage.cookies || client_storage.local_storage || client_storage.session_storage) {
|
if (
|
||||||
|
client_storage.cookies ||
|
||||||
|
client_storage.local_storage ||
|
||||||
|
client_storage.session_storage
|
||||||
|
) {
|
||||||
return client_storage_values;
|
return client_storage_values;
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
@ -614,15 +643,17 @@ const applyClientStorageDelta = (client_storage, delta) => {
|
|||||||
) {
|
) {
|
||||||
const options = client_storage.local_storage[state_key];
|
const options = client_storage.local_storage[state_key];
|
||||||
localStorage.setItem(options.name || state_key, delta[substate][key]);
|
localStorage.setItem(options.name || state_key, delta[substate][key]);
|
||||||
} else if(
|
} else if (
|
||||||
client_storage.session_storage &&
|
client_storage.session_storage &&
|
||||||
state_key in client_storage.session_storage &&
|
state_key in client_storage.session_storage &&
|
||||||
typeof window !== "undefined"
|
typeof window !== "undefined"
|
||||||
) {
|
) {
|
||||||
const session_options = client_storage.session_storage[state_key];
|
const session_options = client_storage.session_storage[state_key];
|
||||||
sessionStorage.setItem(session_options.name || state_key, delta[substate][key]);
|
sessionStorage.setItem(
|
||||||
|
session_options.name || state_key,
|
||||||
|
delta[substate][key]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -651,7 +682,13 @@ export const useEventLoop = (
|
|||||||
if (!(args instanceof Array)) {
|
if (!(args instanceof Array)) {
|
||||||
args = [args];
|
args = [args];
|
||||||
}
|
}
|
||||||
const _e = args.filter((o) => o?.preventDefault !== undefined)[0]
|
|
||||||
|
event_actions = events.reduce(
|
||||||
|
(acc, e) => ({ ...acc, ...e.event_actions }),
|
||||||
|
event_actions ?? {}
|
||||||
|
);
|
||||||
|
|
||||||
|
const _e = args.filter((o) => o?.preventDefault !== undefined)[0];
|
||||||
|
|
||||||
if (event_actions?.preventDefault && _e?.preventDefault) {
|
if (event_actions?.preventDefault && _e?.preventDefault) {
|
||||||
_e.preventDefault();
|
_e.preventDefault();
|
||||||
@ -671,7 +708,7 @@ export const useEventLoop = (
|
|||||||
debounce(
|
debounce(
|
||||||
combined_name,
|
combined_name,
|
||||||
() => queueEvents(events, socket),
|
() => queueEvents(events, socket),
|
||||||
event_actions.debounce,
|
event_actions.debounce
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
queueEvents(events, socket);
|
queueEvents(events, socket);
|
||||||
@ -696,30 +733,34 @@ export const useEventLoop = (
|
|||||||
}
|
}
|
||||||
}, [router.isReady]);
|
}, [router.isReady]);
|
||||||
|
|
||||||
// Handle frontend errors and send them to the backend via websocket.
|
// Handle frontend errors and send them to the backend via websocket.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (typeof window === "undefined") {
|
||||||
if (typeof window === 'undefined') {
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
window.onerror = function (msg, url, lineNo, columnNo, error) {
|
|
||||||
addEvents([Event(`${exception_state_name}.handle_frontend_exception`, {
|
|
||||||
stack: error.stack,
|
|
||||||
})])
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//NOTE: Only works in Chrome v49+
|
window.onerror = function (msg, url, lineNo, columnNo, error) {
|
||||||
//https://github.com/mknichel/javascript-errors?tab=readme-ov-file#promise-rejection-events
|
addEvents([
|
||||||
window.onunhandledrejection = function (event) {
|
Event(`${exception_state_name}.handle_frontend_exception`, {
|
||||||
addEvents([Event(`${exception_state_name}.handle_frontend_exception`, {
|
stack: error.stack,
|
||||||
stack: event.reason.stack,
|
component_stack: "",
|
||||||
})])
|
}),
|
||||||
return false;
|
]);
|
||||||
}
|
return false;
|
||||||
|
};
|
||||||
},[])
|
|
||||||
|
//NOTE: Only works in Chrome v49+
|
||||||
|
//https://github.com/mknichel/javascript-errors?tab=readme-ov-file#promise-rejection-events
|
||||||
|
window.onunhandledrejection = function (event) {
|
||||||
|
addEvents([
|
||||||
|
Event(`${exception_state_name}.handle_frontend_exception`, {
|
||||||
|
stack: event.reason.stack,
|
||||||
|
component_stack: "",
|
||||||
|
}),
|
||||||
|
]);
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
// Main event loop.
|
// Main event loop.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -782,11 +823,11 @@ export const useEventLoop = (
|
|||||||
// Route after the initial page hydration.
|
// Route after the initial page hydration.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const change_start = () => {
|
const change_start = () => {
|
||||||
const main_state_dispatch = dispatch["reflex___state____state"]
|
const main_state_dispatch = dispatch["reflex___state____state"];
|
||||||
if (main_state_dispatch !== undefined) {
|
if (main_state_dispatch !== undefined) {
|
||||||
main_state_dispatch({ is_hydrated: false })
|
main_state_dispatch({ is_hydrated: false });
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
const change_complete = () => addEvents(onLoadInternalEvent());
|
const change_complete = () => addEvents(onLoadInternalEvent());
|
||||||
router.events.on("routeChangeStart", change_start);
|
router.events.on("routeChangeStart", change_start);
|
||||||
router.events.on("routeChangeComplete", change_complete);
|
router.events.on("routeChangeComplete", change_complete);
|
||||||
@ -805,7 +846,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);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -89,6 +89,8 @@ from reflex.utils import (
|
|||||||
lazy_loader,
|
lazy_loader,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from .event import event as event
|
||||||
|
|
||||||
# import this here explicitly to avoid returning the page module since page attr has the
|
# import this here explicitly to avoid returning the page module since page attr has the
|
||||||
# same name as page module(page.py)
|
# same name as page module(page.py)
|
||||||
from .page import page as page
|
from .page import page as page
|
||||||
@ -332,12 +334,11 @@ _MAPPING: dict = {
|
|||||||
"style": ["Style", "toggle_color_mode"],
|
"style": ["Style", "toggle_color_mode"],
|
||||||
"utils.imports": ["ImportVar"],
|
"utils.imports": ["ImportVar"],
|
||||||
"utils.serializers": ["serializer"],
|
"utils.serializers": ["serializer"],
|
||||||
"vars": ["Var"],
|
"vars": ["Var", "field", "Field"],
|
||||||
}
|
}
|
||||||
|
|
||||||
_SUBMODULES: set[str] = {
|
_SUBMODULES: set[str] = {
|
||||||
"components",
|
"components",
|
||||||
"event",
|
|
||||||
"app",
|
"app",
|
||||||
"style",
|
"style",
|
||||||
"admin",
|
"admin",
|
||||||
|
@ -11,7 +11,6 @@ from . import base as base
|
|||||||
from . import compiler as compiler
|
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 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
|
||||||
@ -161,6 +160,7 @@ from .event import clear_local_storage as clear_local_storage
|
|||||||
from .event import clear_session_storage as clear_session_storage
|
from .event import clear_session_storage as clear_session_storage
|
||||||
from .event import console_log as console_log
|
from .event import console_log as console_log
|
||||||
from .event import download as download
|
from .event import download as download
|
||||||
|
from .event import event as event
|
||||||
from .event import prevent_default as prevent_default
|
from .event import prevent_default as prevent_default
|
||||||
from .event import redirect as redirect
|
from .event import redirect as redirect
|
||||||
from .event import remove_cookie as remove_cookie
|
from .event import remove_cookie as remove_cookie
|
||||||
@ -190,7 +190,9 @@ from .style import Style as Style
|
|||||||
from .style import toggle_color_mode as toggle_color_mode
|
from .style import toggle_color_mode as toggle_color_mode
|
||||||
from .utils.imports import ImportVar as ImportVar
|
from .utils.imports import ImportVar as ImportVar
|
||||||
from .utils.serializers import serializer as serializer
|
from .utils.serializers import serializer as serializer
|
||||||
|
from .vars import Field as Field
|
||||||
from .vars import Var as Var
|
from .vars import Var as Var
|
||||||
|
from .vars import field as field
|
||||||
|
|
||||||
del compat
|
del compat
|
||||||
RADIX_THEMES_MAPPING: dict
|
RADIX_THEMES_MAPPING: dict
|
||||||
|
@ -64,7 +64,7 @@ from reflex.components.core.client_side_routing import (
|
|||||||
)
|
)
|
||||||
from reflex.components.core.upload import Upload, get_upload_dir
|
from reflex.components.core.upload import Upload, get_upload_dir
|
||||||
from reflex.components.radix import themes
|
from reflex.components.radix import themes
|
||||||
from reflex.config import get_config
|
from reflex.config import environment, get_config
|
||||||
from reflex.event import Event, EventHandler, EventSpec, window_alert
|
from reflex.event import Event, EventHandler, EventSpec, window_alert
|
||||||
from reflex.model import Model, get_db_status
|
from reflex.model import Model, get_db_status
|
||||||
from reflex.page import (
|
from reflex.page import (
|
||||||
@ -431,25 +431,12 @@ class App(MiddlewareMixin, LifespanMixin, Base):
|
|||||||
The generated component.
|
The generated component.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
VarOperationTypeError: When an invalid component var related function is passed.
|
|
||||||
TypeError: When an invalid component function is passed.
|
|
||||||
exceptions.MatchTypeError: If the return types of match cases in rx.match are different.
|
exceptions.MatchTypeError: If the return types of match cases in rx.match are different.
|
||||||
"""
|
"""
|
||||||
from reflex.utils.exceptions import VarOperationTypeError
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return component if isinstance(component, Component) else component()
|
return component if isinstance(component, Component) else component()
|
||||||
except exceptions.MatchTypeError:
|
except exceptions.MatchTypeError:
|
||||||
raise
|
raise
|
||||||
except TypeError as e:
|
|
||||||
message = str(e)
|
|
||||||
if "Var" in message:
|
|
||||||
raise VarOperationTypeError(
|
|
||||||
"You may be trying to use an invalid Python function on a state var. "
|
|
||||||
"When referencing a var inside your render code, only limited var operations are supported. "
|
|
||||||
"See the var operation docs here: https://reflex.dev/docs/vars/var-operations/"
|
|
||||||
) from e
|
|
||||||
raise e
|
|
||||||
|
|
||||||
def add_page(
|
def add_page(
|
||||||
self,
|
self,
|
||||||
@ -482,9 +469,8 @@ class App(MiddlewareMixin, LifespanMixin, Base):
|
|||||||
"""
|
"""
|
||||||
# If the route is not set, get it from the callable.
|
# If the route is not set, get it from the callable.
|
||||||
if route is None:
|
if route is None:
|
||||||
assert isinstance(
|
if not isinstance(component, Callable):
|
||||||
component, Callable
|
raise ValueError("Route must be set if component is not a callable.")
|
||||||
), "Route must be set if component is not a callable."
|
|
||||||
# Format the route.
|
# Format the route.
|
||||||
route = format.format_route(component.__name__)
|
route = format.format_route(component.__name__)
|
||||||
else:
|
else:
|
||||||
@ -971,15 +957,16 @@ class App(MiddlewareMixin, LifespanMixin, Base):
|
|||||||
executor = None
|
executor = None
|
||||||
if (
|
if (
|
||||||
platform.system() in ("Linux", "Darwin")
|
platform.system() in ("Linux", "Darwin")
|
||||||
and os.environ.get("REFLEX_COMPILE_PROCESSES") is not None
|
and (number_of_processes := environment.REFLEX_COMPILE_PROCESSES)
|
||||||
|
is not None
|
||||||
):
|
):
|
||||||
executor = concurrent.futures.ProcessPoolExecutor(
|
executor = concurrent.futures.ProcessPoolExecutor(
|
||||||
max_workers=int(os.environ.get("REFLEX_COMPILE_PROCESSES", 0)) or None,
|
max_workers=number_of_processes,
|
||||||
mp_context=multiprocessing.get_context("fork"),
|
mp_context=multiprocessing.get_context("fork"),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
executor = concurrent.futures.ThreadPoolExecutor(
|
executor = concurrent.futures.ThreadPoolExecutor(
|
||||||
max_workers=int(os.environ.get("REFLEX_COMPILE_THREADS", 0)) or None,
|
max_workers=environment.REFLEX_COMPILE_THREADS
|
||||||
)
|
)
|
||||||
|
|
||||||
with executor:
|
with executor:
|
||||||
@ -1528,21 +1515,28 @@ class EventNamespace(AsyncNamespace):
|
|||||||
async def on_event(self, sid, data):
|
async def on_event(self, sid, data):
|
||||||
"""Event for receiving front-end websocket events.
|
"""Event for receiving front-end websocket events.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
RuntimeError: If the Socket.IO is badly initialized.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
sid: The Socket.IO session id.
|
sid: The Socket.IO session id.
|
||||||
data: The event data.
|
data: The event data.
|
||||||
"""
|
"""
|
||||||
fields = json.loads(data)
|
fields = json.loads(data)
|
||||||
# Get the event.
|
# Get the event.
|
||||||
event = Event(**{k: v for k, v in fields.items() if k != "handler"})
|
event = Event(
|
||||||
|
**{k: v for k, v in fields.items() if k not in ("handler", "event_actions")}
|
||||||
|
)
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
# Get the event environment.
|
# Get the event environment.
|
||||||
assert self.app.sio is not None
|
if self.app.sio is None:
|
||||||
|
raise RuntimeError("Socket.IO is not initialized.")
|
||||||
environ = self.app.sio.get_environ(sid, self.namespace)
|
environ = self.app.sio.get_environ(sid, self.namespace)
|
||||||
assert environ is not None
|
if environ is None:
|
||||||
|
raise RuntimeError("Socket.IO environ is not initialized.")
|
||||||
|
|
||||||
# Get the client headers.
|
# Get the client headers.
|
||||||
headers = {
|
headers = {
|
||||||
|
@ -6,11 +6,13 @@ import asyncio
|
|||||||
import contextlib
|
import contextlib
|
||||||
import functools
|
import functools
|
||||||
import inspect
|
import inspect
|
||||||
import sys
|
|
||||||
from typing import Callable, Coroutine, Set, Union
|
from typing import Callable, Coroutine, Set, Union
|
||||||
|
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
|
|
||||||
|
from reflex.utils import console
|
||||||
|
from reflex.utils.exceptions import InvalidLifespanTaskType
|
||||||
|
|
||||||
from .mixin import AppMixin
|
from .mixin import AppMixin
|
||||||
|
|
||||||
|
|
||||||
@ -26,6 +28,7 @@ class LifespanMixin(AppMixin):
|
|||||||
try:
|
try:
|
||||||
async with contextlib.AsyncExitStack() as stack:
|
async with contextlib.AsyncExitStack() as stack:
|
||||||
for task in self.lifespan_tasks:
|
for task in self.lifespan_tasks:
|
||||||
|
run_msg = f"Started lifespan task: {task.__name__} as {{type}}" # type: ignore
|
||||||
if isinstance(task, asyncio.Task):
|
if isinstance(task, asyncio.Task):
|
||||||
running_tasks.append(task)
|
running_tasks.append(task)
|
||||||
else:
|
else:
|
||||||
@ -35,15 +38,19 @@ class LifespanMixin(AppMixin):
|
|||||||
_t = task()
|
_t = task()
|
||||||
if isinstance(_t, contextlib._AsyncGeneratorContextManager):
|
if isinstance(_t, contextlib._AsyncGeneratorContextManager):
|
||||||
await stack.enter_async_context(_t)
|
await stack.enter_async_context(_t)
|
||||||
|
console.debug(run_msg.format(type="asynccontextmanager"))
|
||||||
elif isinstance(_t, Coroutine):
|
elif isinstance(_t, Coroutine):
|
||||||
running_tasks.append(asyncio.create_task(_t))
|
task_ = asyncio.create_task(_t)
|
||||||
|
task_.add_done_callback(lambda t: t.result())
|
||||||
|
running_tasks.append(task_)
|
||||||
|
console.debug(run_msg.format(type="coroutine"))
|
||||||
|
else:
|
||||||
|
console.debug(run_msg.format(type="function"))
|
||||||
yield
|
yield
|
||||||
finally:
|
finally:
|
||||||
cancel_kwargs = (
|
|
||||||
{"msg": "lifespan_cleanup"} if sys.version_info >= (3, 9) else {}
|
|
||||||
)
|
|
||||||
for task in running_tasks:
|
for task in running_tasks:
|
||||||
task.cancel(**cancel_kwargs)
|
console.debug(f"Canceling lifespan task: {task}")
|
||||||
|
task.cancel(msg="lifespan_cleanup")
|
||||||
|
|
||||||
def register_lifespan_task(self, task: Callable | asyncio.Task, **task_kwargs):
|
def register_lifespan_task(self, task: Callable | asyncio.Task, **task_kwargs):
|
||||||
"""Register a task to run during the lifespan of the app.
|
"""Register a task to run during the lifespan of the app.
|
||||||
@ -51,7 +58,18 @@ class LifespanMixin(AppMixin):
|
|||||||
Args:
|
Args:
|
||||||
task: The task to register.
|
task: The task to register.
|
||||||
task_kwargs: The kwargs of the task.
|
task_kwargs: The kwargs of the task.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
InvalidLifespanTaskType: If the task is a generator function.
|
||||||
"""
|
"""
|
||||||
|
if inspect.isgeneratorfunction(task) or inspect.isasyncgenfunction(task):
|
||||||
|
raise InvalidLifespanTaskType(
|
||||||
|
f"Task {task.__name__} of type generator must be decorated with contextlib.asynccontextmanager."
|
||||||
|
)
|
||||||
|
|
||||||
if task_kwargs:
|
if task_kwargs:
|
||||||
|
original_task = task
|
||||||
task = functools.partial(task, **task_kwargs) # type: ignore
|
task = functools.partial(task, **task_kwargs) # type: ignore
|
||||||
|
functools.update_wrapper(task, original_task) # type: ignore
|
||||||
self.lifespan_tasks.add(task) # type: ignore
|
self.lifespan_tasks.add(task) # type: ignore
|
||||||
|
console.debug(f"Registered lifespan task: {task.__name__}") # type: ignore
|
||||||
|
@ -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)
|
||||||
|
@ -47,6 +47,9 @@ def validate_field_name(bases: List[Type["BaseModel"]], field_name: str) -> None
|
|||||||
# shadowed state vars when reloading app via utils.prerequisites.get_app(reload=True)
|
# shadowed state vars when reloading app via utils.prerequisites.get_app(reload=True)
|
||||||
pydantic_main.validate_field_name = validate_field_name # type: ignore
|
pydantic_main.validate_field_name = validate_field_name # type: ignore
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from reflex.vars import Var
|
||||||
|
|
||||||
|
|
||||||
class Base(BaseModel): # pyright: ignore [reportUnboundVariable]
|
class Base(BaseModel): # pyright: ignore [reportUnboundVariable]
|
||||||
"""The base class subclassed by all Reflex classes.
|
"""The base class subclassed by all Reflex classes.
|
||||||
@ -92,7 +95,7 @@ class Base(BaseModel): # pyright: ignore [reportUnboundVariable]
|
|||||||
return self
|
return self
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_fields(cls) -> dict[str, Any]:
|
def get_fields(cls) -> dict[str, ModelField]:
|
||||||
"""Get the fields of the object.
|
"""Get the fields of the object.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@ -101,7 +104,7 @@ class Base(BaseModel): # pyright: ignore [reportUnboundVariable]
|
|||||||
return cls.__fields__
|
return cls.__fields__
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def add_field(cls, var: Any, default_value: Any):
|
def add_field(cls, var: Var, default_value: Any):
|
||||||
"""Add a pydantic field after class definition.
|
"""Add a pydantic field after class definition.
|
||||||
|
|
||||||
Used by State.add_var() to correctly handle the new variable.
|
Used by State.add_var() to correctly handle the new variable.
|
||||||
@ -110,7 +113,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._js_expr.split(".")[-1]
|
var_name = var._var_field_name
|
||||||
new_field = ModelField.infer(
|
new_field = ModelField.infer(
|
||||||
name=var_name,
|
name=var_name,
|
||||||
value=default_value,
|
value=default_value,
|
||||||
@ -133,13 +136,4 @@ class Base(BaseModel): # pyright: ignore [reportUnboundVariable]
|
|||||||
# Seems like this function signature was wrong all along?
|
# Seems like this function signature was wrong all along?
|
||||||
# If the user wants a field that we know of, get it and pass it off to _get_value
|
# If the user wants a field that we know of, get it and pass it off to _get_value
|
||||||
key = getattr(self, key)
|
key = getattr(self, key)
|
||||||
return self._get_value(
|
return key
|
||||||
key,
|
|
||||||
to_dict=True,
|
|
||||||
by_alias=False,
|
|
||||||
include=None,
|
|
||||||
exclude=None,
|
|
||||||
exclude_unset=False,
|
|
||||||
exclude_defaults=False,
|
|
||||||
exclude_none=False,
|
|
||||||
)
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Dict, Iterable, Optional, Type, Union
|
from typing import Dict, Iterable, Optional, Type, Union
|
||||||
@ -16,7 +15,7 @@ from reflex.components.component import (
|
|||||||
CustomComponent,
|
CustomComponent,
|
||||||
StatefulComponent,
|
StatefulComponent,
|
||||||
)
|
)
|
||||||
from reflex.config import get_config
|
from reflex.config import environment, get_config
|
||||||
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
|
||||||
@ -40,6 +39,20 @@ def _compile_document_root(root: Component) -> str:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _normalize_library_name(lib: str) -> str:
|
||||||
|
"""Normalize the library name.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
lib: The library name to normalize.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The normalized library name.
|
||||||
|
"""
|
||||||
|
if lib == "react":
|
||||||
|
return "React"
|
||||||
|
return lib.replace("@", "").replace("/", "_").replace("-", "_")
|
||||||
|
|
||||||
|
|
||||||
def _compile_app(app_root: Component) -> str:
|
def _compile_app(app_root: Component) -> str:
|
||||||
"""Compile the app template component.
|
"""Compile the app template component.
|
||||||
|
|
||||||
@ -49,10 +62,20 @@ def _compile_app(app_root: Component) -> str:
|
|||||||
Returns:
|
Returns:
|
||||||
The compiled app.
|
The compiled app.
|
||||||
"""
|
"""
|
||||||
|
from reflex.components.dynamic import bundled_libraries
|
||||||
|
|
||||||
|
window_libraries = [
|
||||||
|
(_normalize_library_name(name), name) for name in bundled_libraries
|
||||||
|
] + [
|
||||||
|
("utils_context", f"/{constants.Dirs.UTILS}/context"),
|
||||||
|
("utils_state", f"/{constants.Dirs.UTILS}/state"),
|
||||||
|
]
|
||||||
|
|
||||||
return templates.APP_ROOT.render(
|
return templates.APP_ROOT.render(
|
||||||
imports=utils.compile_imports(app_root._get_all_imports()),
|
imports=utils.compile_imports(app_root._get_all_imports()),
|
||||||
custom_codes=app_root._get_all_custom_code(),
|
custom_codes=app_root._get_all_custom_code(),
|
||||||
hooks={**app_root._get_all_hooks_internal(), **app_root._get_all_hooks()},
|
hooks={**app_root._get_all_hooks_internal(), **app_root._get_all_hooks()},
|
||||||
|
window_libraries=window_libraries,
|
||||||
render=app_root.render(),
|
render=app_root.render(),
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -171,7 +194,7 @@ def _compile_root_stylesheet(stylesheets: list[str]) -> str:
|
|||||||
stylesheet_full_path = (
|
stylesheet_full_path = (
|
||||||
Path.cwd() / constants.Dirs.APP_ASSETS / stylesheet.strip("/")
|
Path.cwd() / constants.Dirs.APP_ASSETS / stylesheet.strip("/")
|
||||||
)
|
)
|
||||||
if not os.path.exists(stylesheet_full_path):
|
if not stylesheet_full_path.exists():
|
||||||
raise FileNotFoundError(
|
raise FileNotFoundError(
|
||||||
f"The stylesheet file {stylesheet_full_path} does not exist."
|
f"The stylesheet file {stylesheet_full_path} does not exist."
|
||||||
)
|
)
|
||||||
@ -503,7 +526,7 @@ def remove_tailwind_from_postcss() -> tuple[str, str]:
|
|||||||
|
|
||||||
def purge_web_pages_dir():
|
def purge_web_pages_dir():
|
||||||
"""Empty out .web/pages directory."""
|
"""Empty out .web/pages directory."""
|
||||||
if not is_prod_mode() and os.environ.get("REFLEX_PERSIST_WEB_DIR"):
|
if not is_prod_mode() and environment.REFLEX_PERSIST_WEB_DIR:
|
||||||
# Skip purging the web directory in dev mode if REFLEX_PERSIST_WEB_DIR is set.
|
# Skip purging the web directory in dev mode if REFLEX_PERSIST_WEB_DIR is set.
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
|
||||||
from pathlib import Path
|
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
|
||||||
@ -44,6 +43,9 @@ def compile_import_statement(fields: list[ImportVar]) -> tuple[str, list[str]]:
|
|||||||
Args:
|
Args:
|
||||||
fields: The set of fields to import from the library.
|
fields: The set of fields to import from the library.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
ValueError: If there is more than one default import.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The libraries for default and rest.
|
The libraries for default and rest.
|
||||||
default: default library. When install "import def from library".
|
default: default library. When install "import def from library".
|
||||||
@ -54,7 +56,8 @@ def compile_import_statement(fields: list[ImportVar]) -> tuple[str, list[str]]:
|
|||||||
|
|
||||||
# Check for default imports.
|
# Check for default imports.
|
||||||
defaults = {field for field in fields_set if field.is_default}
|
defaults = {field for field in fields_set if field.is_default}
|
||||||
assert len(defaults) < 2
|
if len(defaults) >= 2:
|
||||||
|
raise ValueError("Only one default import is allowed.")
|
||||||
|
|
||||||
# Get the default import, and the specific imports.
|
# Get the default import, and the specific imports.
|
||||||
default = next(iter({field.name for field in defaults}), "")
|
default = next(iter({field.name for field in defaults}), "")
|
||||||
@ -92,6 +95,9 @@ def compile_imports(import_dict: ParsedImportDict) -> list[dict]:
|
|||||||
Args:
|
Args:
|
||||||
import_dict: The import dict to compile.
|
import_dict: The import dict to compile.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
ValueError: If an import in the dict is invalid.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The list of import dict.
|
The list of import dict.
|
||||||
"""
|
"""
|
||||||
@ -106,8 +112,10 @@ def compile_imports(import_dict: ParsedImportDict) -> list[dict]:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if not lib:
|
if not lib:
|
||||||
assert not default, "No default field allowed for empty library."
|
if default:
|
||||||
assert rest is not None and len(rest) > 0, "No fields to import."
|
raise ValueError("No default field allowed for empty library.")
|
||||||
|
if rest is None or len(rest) == 0:
|
||||||
|
raise ValueError("No fields to import.")
|
||||||
for module in sorted(rest):
|
for module in sorted(rest):
|
||||||
import_dicts.append(get_import_dict(module))
|
import_dicts.append(get_import_dict(module))
|
||||||
continue
|
continue
|
||||||
@ -155,7 +163,7 @@ def compile_state(state: Type[BaseState]) -> dict:
|
|||||||
initial_state = state(_reflex_internal_init=True).dict(
|
initial_state = state(_reflex_internal_init=True).dict(
|
||||||
initial=True, include_computed=False
|
initial=True, include_computed=False
|
||||||
)
|
)
|
||||||
return format.format_state(initial_state)
|
return initial_state
|
||||||
|
|
||||||
|
|
||||||
def _compile_client_storage_field(
|
def _compile_client_storage_field(
|
||||||
@ -429,11 +437,11 @@ def add_meta(
|
|||||||
Returns:
|
Returns:
|
||||||
The component with the metadata added.
|
The component with the metadata added.
|
||||||
"""
|
"""
|
||||||
meta_tags = [Meta.create(**item) for item in meta]
|
meta_tags = [
|
||||||
|
item if isinstance(item, Component) else Meta.create(**item) for item in meta
|
||||||
children: list[Any] = [
|
|
||||||
Title.create(title),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
children: list[Any] = [Title.create(title)]
|
||||||
if description:
|
if description:
|
||||||
children.append(Description.create(content=description))
|
children.append(Description.create(content=description))
|
||||||
children.append(Image.create(content=image))
|
children.append(Image.create(content=image))
|
||||||
@ -448,16 +456,16 @@ def add_meta(
|
|||||||
return page
|
return page
|
||||||
|
|
||||||
|
|
||||||
def write_page(path: str, code: str):
|
def write_page(path: str | Path, code: str):
|
||||||
"""Write the given code to the given path.
|
"""Write the given code to the given path.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
path: The path to write the code to.
|
path: The path to write the code to.
|
||||||
code: The code to write.
|
code: The code to write.
|
||||||
"""
|
"""
|
||||||
path_ops.mkdir(os.path.dirname(path))
|
path = Path(path)
|
||||||
with open(path, "w", encoding="utf-8") as f:
|
path_ops.mkdir(path.parent)
|
||||||
f.write(code)
|
path.write_text(code, encoding="utf-8")
|
||||||
|
|
||||||
|
|
||||||
def empty_dir(path: str | Path, keep_files: list[str] | None = None):
|
def empty_dir(path: str | Path, keep_files: list[str] | None = None):
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -22,41 +22,21 @@ class AppWrap(Fragment):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "AppWrap":
|
) -> "AppWrap":
|
||||||
"""Create a new AppWrap component.
|
"""Create a new AppWrap component.
|
||||||
|
@ -7,7 +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.vars.base import Var
|
from reflex.vars import ArrayVar, BooleanVar, ObjectVar, Var
|
||||||
|
|
||||||
|
|
||||||
class Bare(Component):
|
class Bare(Component):
|
||||||
@ -33,6 +33,8 @@ class Bare(Component):
|
|||||||
|
|
||||||
def _render(self) -> Tag:
|
def _render(self) -> Tag:
|
||||||
if isinstance(self.contents, Var):
|
if isinstance(self.contents, Var):
|
||||||
|
if isinstance(self.contents, (BooleanVar, ObjectVar, ArrayVar)):
|
||||||
|
return Tagless(contents=f"{{{str(self.contents.to_string())}}}")
|
||||||
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))
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -22,41 +22,21 @@ class Body(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Body":
|
) -> "Body":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -22,41 +22,21 @@ class NextDocumentLib(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "NextDocumentLib":
|
) -> "NextDocumentLib":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -89,41 +69,21 @@ class Html(NextDocumentLib):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Html":
|
) -> "Html":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -155,41 +115,21 @@ class DocumentHead(NextDocumentLib):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "DocumentHead":
|
) -> "DocumentHead":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -221,41 +161,21 @@ class Main(NextDocumentLib):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Main":
|
) -> "Main":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -287,41 +207,21 @@ class NextScript(NextDocumentLib):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "NextScript":
|
) -> "NextScript":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
@ -2,16 +2,32 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import List
|
from typing import Dict, List, Tuple
|
||||||
|
|
||||||
from reflex.compiler.compiler import _compile_component
|
from reflex.compiler.compiler import _compile_component
|
||||||
from reflex.components.component import Component
|
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.event import EventHandler
|
||||||
from reflex.event import EventChain, EventHandler
|
from reflex.state import FrontendEventExceptionState
|
||||||
from reflex.utils.imports import ImportVar
|
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
from reflex.vars.function import FunctionVar
|
|
||||||
|
|
||||||
|
def on_error_spec(
|
||||||
|
error: Var[Dict[str, str]], info: Var[Dict[str, str]]
|
||||||
|
) -> Tuple[Var[str], Var[str]]:
|
||||||
|
"""The spec for the on_error event handler.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
error: The error message.
|
||||||
|
info: Additional information about the error.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The arguments for the event handler.
|
||||||
|
"""
|
||||||
|
return (
|
||||||
|
error.stack,
|
||||||
|
info.componentStack,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class ErrorBoundary(Component):
|
class ErrorBoundary(Component):
|
||||||
@ -21,31 +37,13 @@ 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]] = Var( # type: ignore
|
on_error: EventHandler[on_error_spec]
|
||||||
"logFrontendError"
|
|
||||||
).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] = Var(_js_expr="Fallback")._replace(
|
Fallback_component: Var[Component] = Var(_js_expr="Fallback")._replace(
|
||||||
_var_type=Component
|
_var_type=Component
|
||||||
)
|
)
|
||||||
|
|
||||||
def add_imports(self) -> dict[str, list[ImportVar]]:
|
|
||||||
"""Add imports for the component.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
The imports to add.
|
|
||||||
"""
|
|
||||||
return Imports.EVENTS
|
|
||||||
|
|
||||||
def add_hooks(self) -> List[str | Var]:
|
|
||||||
"""Add hooks for the component.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
The hooks to add.
|
|
||||||
"""
|
|
||||||
return [Hooks.EVENTS, Hooks.FRONTEND_ERRORS]
|
|
||||||
|
|
||||||
def add_custom_code(self) -> List[str]:
|
def add_custom_code(self) -> List[str]:
|
||||||
"""Add custom Javascript code into the page that contains this component.
|
"""Add custom Javascript code into the page that contains this component.
|
||||||
|
|
||||||
@ -75,5 +73,20 @@ class ErrorBoundary(Component):
|
|||||||
"""
|
"""
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def create(cls, *children, **props):
|
||||||
|
"""Create an ErrorBoundary component.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
*children: The children of the component.
|
||||||
|
**props: The props of the component.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The ErrorBoundary component.
|
||||||
|
"""
|
||||||
|
if "on_error" not in props:
|
||||||
|
props["on_error"] = FrontendEventExceptionState.handle_frontend_exception
|
||||||
|
return super().create(*children, **props)
|
||||||
|
|
||||||
|
|
||||||
error_boundary = ErrorBoundary.create
|
error_boundary = ErrorBoundary.create
|
||||||
|
@ -3,17 +3,18 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, List, Optional, Union, overload
|
from typing import Any, Dict, List, Optional, Tuple, Union, overload
|
||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.utils.imports import ImportVar
|
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
|
def on_error_spec(
|
||||||
|
error: Var[Dict[str, str]], info: Var[Dict[str, str]]
|
||||||
|
) -> Tuple[Var[str], Var[str]]: ...
|
||||||
|
|
||||||
class ErrorBoundary(Component):
|
class ErrorBoundary(Component):
|
||||||
def add_imports(self) -> dict[str, list[ImportVar]]: ...
|
|
||||||
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
|
||||||
@ -27,45 +28,25 @@ class ErrorBoundary(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_error: Optional[EventType[str, str]] = None,
|
||||||
on_double_click: Optional[
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "ErrorBoundary":
|
) -> "ErrorBoundary":
|
||||||
"""Create the component.
|
"""Create an ErrorBoundary component.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
@ -79,7 +60,7 @@ class ErrorBoundary(Component):
|
|||||||
**props: The props of the component.
|
**props: The props of the component.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The component.
|
The ErrorBoundary component.
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -22,41 +22,21 @@ class Fragment(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Fragment":
|
) -> "Fragment":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -22,41 +22,21 @@ class NextHeadLib(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "NextHeadLib":
|
) -> "NextHeadLib":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -88,41 +68,21 @@ class Head(NextHeadLib, MemoizationLeaf):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Head":
|
) -> "Head":
|
||||||
"""Create a new memoization leaf component.
|
"""Create a new memoization leaf component.
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -24,41 +24,21 @@ class RawLink(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "RawLink":
|
) -> "RawLink":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -99,41 +79,21 @@ class ScriptTag(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "ScriptTag":
|
) -> "ScriptTag":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
@ -16,13 +16,15 @@ class Title(Component):
|
|||||||
def render(self) -> dict:
|
def render(self) -> dict:
|
||||||
"""Render the title component.
|
"""Render the title component.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
ValueError: If the title is not a single string.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The rendered title component.
|
The rendered title component.
|
||||||
"""
|
"""
|
||||||
# Make sure the title is a single string.
|
# Make sure the title is a single string.
|
||||||
assert len(self.children) == 1 and isinstance(
|
if len(self.children) != 1 or not isinstance(self.children[0], Bare):
|
||||||
self.children[0], Bare
|
raise ValueError("Title must be a single string.")
|
||||||
), "Title must be a single string."
|
|
||||||
return super().render()
|
return super().render()
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -23,41 +23,21 @@ class Title(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Title":
|
) -> "Title":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -94,41 +74,21 @@ class Meta(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Meta":
|
) -> "Meta":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -170,41 +130,21 @@ class Description(Meta):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Description":
|
) -> "Description":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -246,41 +186,21 @@ class Image(Meta):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Image":
|
) -> "Image":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
@ -8,7 +8,7 @@ from __future__ import annotations
|
|||||||
from typing import Literal
|
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, empty_event
|
||||||
from reflex.vars.base import LiteralVar, Var
|
from reflex.vars.base import LiteralVar, Var
|
||||||
|
|
||||||
|
|
||||||
@ -35,13 +35,13 @@ class Script(Component):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Triggered when the script is loading
|
# Triggered when the script is loading
|
||||||
on_load: EventHandler[lambda: []]
|
on_load: EventHandler[empty_event]
|
||||||
|
|
||||||
# Triggered when the script has loaded
|
# Triggered when the script has loaded
|
||||||
on_ready: EventHandler[lambda: []]
|
on_ready: EventHandler[empty_event]
|
||||||
|
|
||||||
# Triggered when the script has errored
|
# Triggered when the script has errored
|
||||||
on_error: EventHandler[lambda: []]
|
on_error: EventHandler[empty_event]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(cls, *children, **props) -> Component:
|
def create(cls, *children, **props) -> Component:
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -29,44 +29,24 @@ class Script(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_error: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_load: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_ready: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Script":
|
) -> "Script":
|
||||||
"""Create an inline or user-defined script.
|
"""Create an inline or user-defined script.
|
||||||
|
@ -25,6 +25,7 @@ import reflex.state
|
|||||||
from reflex.base import Base
|
from reflex.base import Base
|
||||||
from reflex.compiler.templates import STATEFUL_COMPONENT
|
from reflex.compiler.templates import STATEFUL_COMPONENT
|
||||||
from reflex.components.core.breakpoints import Breakpoints
|
from reflex.components.core.breakpoints import Breakpoints
|
||||||
|
from reflex.components.dynamic import load_dynamic_serializer
|
||||||
from reflex.components.tags import Tag
|
from reflex.components.tags import Tag
|
||||||
from reflex.constants import (
|
from reflex.constants import (
|
||||||
Dirs,
|
Dirs,
|
||||||
@ -35,12 +36,16 @@ from reflex.constants import (
|
|||||||
MemoizationMode,
|
MemoizationMode,
|
||||||
PageNames,
|
PageNames,
|
||||||
)
|
)
|
||||||
|
from reflex.constants.compiler import SpecialAttributes
|
||||||
from reflex.event import (
|
from reflex.event import (
|
||||||
EventChain,
|
EventChain,
|
||||||
|
EventChainVar,
|
||||||
EventHandler,
|
EventHandler,
|
||||||
EventSpec,
|
EventSpec,
|
||||||
|
EventVar,
|
||||||
call_event_fn,
|
call_event_fn,
|
||||||
call_event_handler,
|
call_event_handler,
|
||||||
|
empty_event,
|
||||||
get_handler_args,
|
get_handler_args,
|
||||||
)
|
)
|
||||||
from reflex.style import Style, format_as_emotion
|
from reflex.style import Style, format_as_emotion
|
||||||
@ -52,9 +57,9 @@ from reflex.utils.imports import (
|
|||||||
ParsedImportDict,
|
ParsedImportDict,
|
||||||
parse_imports,
|
parse_imports,
|
||||||
)
|
)
|
||||||
from reflex.utils.serializers import serializer
|
|
||||||
from reflex.vars import VarData
|
from reflex.vars import VarData
|
||||||
from reflex.vars.base import LiteralVar, Var
|
from reflex.vars.base import LiteralVar, Var
|
||||||
|
from reflex.vars.sequence import LiteralArrayVar
|
||||||
|
|
||||||
|
|
||||||
class BaseComponent(Base, ABC):
|
class BaseComponent(Base, ABC):
|
||||||
@ -448,8 +453,16 @@ class Component(BaseComponent, ABC):
|
|||||||
and not types._issubclass(passed_type, expected_type, value)
|
and not types._issubclass(passed_type, expected_type, value)
|
||||||
):
|
):
|
||||||
value_name = value._js_expr if isinstance(value, Var) else value
|
value_name = value._js_expr if isinstance(value, Var) 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_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:
|
||||||
@ -463,13 +476,24 @@ class Component(BaseComponent, ABC):
|
|||||||
for key in kwargs["event_triggers"]:
|
for key in kwargs["event_triggers"]:
|
||||||
del kwargs[key]
|
del kwargs[key]
|
||||||
|
|
||||||
|
# Place data_ and aria_ attributes into custom_attrs
|
||||||
|
special_attributes = tuple(
|
||||||
|
key
|
||||||
|
for key in kwargs
|
||||||
|
if key not in fields and SpecialAttributes.is_special(key)
|
||||||
|
)
|
||||||
|
if special_attributes:
|
||||||
|
custom_attrs = kwargs.setdefault("custom_attrs", {})
|
||||||
|
for key in special_attributes:
|
||||||
|
custom_attrs[format.to_kebab_case(key)] = kwargs.pop(key)
|
||||||
|
|
||||||
# Add style props to the component.
|
# Add style props to the component.
|
||||||
style = kwargs.get("style", {})
|
style = kwargs.get("style", {})
|
||||||
if isinstance(style, List):
|
if isinstance(style, List):
|
||||||
# Merge styles, the later ones overriding keys in the earlier ones.
|
# Merge styles, the later ones overriding keys in the earlier ones.
|
||||||
style = {k: v for style_dict in style for k, v in style_dict.items()}
|
style = {k: v for style_dict in style for k, v in style_dict.items()}
|
||||||
|
|
||||||
if isinstance(style, Breakpoints):
|
if isinstance(style, (Breakpoints, Var)):
|
||||||
style = {
|
style = {
|
||||||
# Assign the Breakpoints to the self-referential selector to avoid squashing down to a regular dict.
|
# Assign the Breakpoints to the self-referential selector to avoid squashing down to a regular dict.
|
||||||
"&": style,
|
"&": style,
|
||||||
@ -482,13 +506,16 @@ class Component(BaseComponent, ABC):
|
|||||||
**{attr: value for attr, value in kwargs.items() if attr not in fields},
|
**{attr: value for attr, value in kwargs.items() if attr not in fields},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if "custom_attrs" not in kwargs:
|
|
||||||
kwargs["custom_attrs"] = {}
|
|
||||||
|
|
||||||
# Convert class_name to str if it's list
|
# Convert class_name to str if it's list
|
||||||
class_name = kwargs.get("class_name", "")
|
class_name = kwargs.get("class_name", "")
|
||||||
if isinstance(class_name, (List, tuple)):
|
if isinstance(class_name, (List, tuple)):
|
||||||
kwargs["class_name"] = " ".join(class_name)
|
if any(isinstance(c, Var) for c in class_name):
|
||||||
|
kwargs["class_name"] = LiteralArrayVar.create(
|
||||||
|
class_name, _var_type=List[str]
|
||||||
|
).join(" ")
|
||||||
|
else:
|
||||||
|
kwargs["class_name"] = " ".join(class_name)
|
||||||
|
|
||||||
# Construct the component.
|
# Construct the component.
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
@ -500,7 +527,7 @@ class Component(BaseComponent, ABC):
|
|||||||
Var,
|
Var,
|
||||||
EventHandler,
|
EventHandler,
|
||||||
EventSpec,
|
EventSpec,
|
||||||
List[Union[EventHandler, EventSpec]],
|
List[Union[EventHandler, EventSpec, EventVar]],
|
||||||
Callable,
|
Callable,
|
||||||
],
|
],
|
||||||
) -> Union[EventChain, Var]:
|
) -> Union[EventChain, Var]:
|
||||||
@ -518,11 +545,16 @@ class Component(BaseComponent, ABC):
|
|||||||
"""
|
"""
|
||||||
# If it's an event chain var, return it.
|
# If it's an event chain var, return it.
|
||||||
if isinstance(value, Var):
|
if isinstance(value, Var):
|
||||||
if value._var_type is not EventChain:
|
if isinstance(value, EventChainVar):
|
||||||
|
return value
|
||||||
|
elif isinstance(value, EventVar):
|
||||||
|
value = [value]
|
||||||
|
elif issubclass(value._var_type, (EventChain, EventSpec)):
|
||||||
|
return self._create_event_chain(args_spec, value.guess_type())
|
||||||
|
else:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Invalid event chain: {repr(value)} of type {type(value)}"
|
f"Invalid event chain: {str(value)} of type {value._var_type}"
|
||||||
)
|
)
|
||||||
return value
|
|
||||||
elif isinstance(value, EventChain):
|
elif isinstance(value, EventChain):
|
||||||
# Trust that the caller knows what they're doing passing an EventChain directly
|
# Trust that the caller knows what they're doing passing an EventChain directly
|
||||||
return value
|
return value
|
||||||
@ -533,7 +565,7 @@ class Component(BaseComponent, ABC):
|
|||||||
|
|
||||||
# If the input is a list of event handlers, create an event chain.
|
# If the input is a list of event handlers, create an event chain.
|
||||||
if isinstance(value, List):
|
if isinstance(value, List):
|
||||||
events: list[EventSpec] = []
|
events: List[Union[EventSpec, EventVar]] = []
|
||||||
for v in value:
|
for v in value:
|
||||||
if isinstance(v, (EventHandler, EventSpec)):
|
if isinstance(v, (EventHandler, EventSpec)):
|
||||||
# Call the event handler to get the event.
|
# Call the event handler to get the event.
|
||||||
@ -547,6 +579,8 @@ class Component(BaseComponent, ABC):
|
|||||||
"lambda inside an EventChain list."
|
"lambda inside an EventChain list."
|
||||||
)
|
)
|
||||||
events.extend(result)
|
events.extend(result)
|
||||||
|
elif isinstance(v, EventVar):
|
||||||
|
events.append(v)
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Invalid event: {v}")
|
raise ValueError(f"Invalid event: {v}")
|
||||||
|
|
||||||
@ -556,32 +590,30 @@ class Component(BaseComponent, ABC):
|
|||||||
if isinstance(result, Var):
|
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]
|
||||||
|
|
||||||
# Otherwise, raise an error.
|
# Otherwise, raise an error.
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Invalid event chain: {value}")
|
raise ValueError(f"Invalid event chain: {value}")
|
||||||
|
|
||||||
# Add args to the event specs if necessary.
|
# Add args to the event specs if necessary.
|
||||||
events = [e.with_args(get_handler_args(e)) for e in events]
|
events = [
|
||||||
|
(e.with_args(get_handler_args(e)) if isinstance(e, EventSpec) else e)
|
||||||
# Collect event_actions from each spec
|
for e in events
|
||||||
event_actions = {}
|
]
|
||||||
for e in events:
|
|
||||||
event_actions.update(e.event_actions)
|
|
||||||
|
|
||||||
# Return the event chain.
|
# Return the event chain.
|
||||||
if isinstance(args_spec, Var):
|
if isinstance(args_spec, Var):
|
||||||
return EventChain(
|
return EventChain(
|
||||||
events=events,
|
events=events,
|
||||||
args_spec=None,
|
args_spec=None,
|
||||||
event_actions=event_actions,
|
event_actions={},
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
return EventChain(
|
return EventChain(
|
||||||
events=events,
|
events=events,
|
||||||
args_spec=args_spec,
|
args_spec=args_spec,
|
||||||
event_actions=event_actions,
|
event_actions={},
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_event_triggers(self) -> Dict[str, Any]:
|
def get_event_triggers(self) -> Dict[str, Any]:
|
||||||
@ -592,21 +624,21 @@ class Component(BaseComponent, ABC):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
default_triggers = {
|
default_triggers = {
|
||||||
EventTriggers.ON_FOCUS: lambda: [],
|
EventTriggers.ON_FOCUS: empty_event,
|
||||||
EventTriggers.ON_BLUR: lambda: [],
|
EventTriggers.ON_BLUR: empty_event,
|
||||||
EventTriggers.ON_CLICK: lambda: [],
|
EventTriggers.ON_CLICK: empty_event,
|
||||||
EventTriggers.ON_CONTEXT_MENU: lambda: [],
|
EventTriggers.ON_CONTEXT_MENU: empty_event,
|
||||||
EventTriggers.ON_DOUBLE_CLICK: lambda: [],
|
EventTriggers.ON_DOUBLE_CLICK: empty_event,
|
||||||
EventTriggers.ON_MOUSE_DOWN: lambda: [],
|
EventTriggers.ON_MOUSE_DOWN: empty_event,
|
||||||
EventTriggers.ON_MOUSE_ENTER: lambda: [],
|
EventTriggers.ON_MOUSE_ENTER: empty_event,
|
||||||
EventTriggers.ON_MOUSE_LEAVE: lambda: [],
|
EventTriggers.ON_MOUSE_LEAVE: empty_event,
|
||||||
EventTriggers.ON_MOUSE_MOVE: lambda: [],
|
EventTriggers.ON_MOUSE_MOVE: empty_event,
|
||||||
EventTriggers.ON_MOUSE_OUT: lambda: [],
|
EventTriggers.ON_MOUSE_OUT: empty_event,
|
||||||
EventTriggers.ON_MOUSE_OVER: lambda: [],
|
EventTriggers.ON_MOUSE_OVER: empty_event,
|
||||||
EventTriggers.ON_MOUSE_UP: lambda: [],
|
EventTriggers.ON_MOUSE_UP: empty_event,
|
||||||
EventTriggers.ON_SCROLL: lambda: [],
|
EventTriggers.ON_SCROLL: empty_event,
|
||||||
EventTriggers.ON_MOUNT: lambda: [],
|
EventTriggers.ON_MOUNT: empty_event,
|
||||||
EventTriggers.ON_UNMOUNT: lambda: [],
|
EventTriggers.ON_UNMOUNT: empty_event,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Look for component specific triggers,
|
# Look for component specific triggers,
|
||||||
@ -615,9 +647,9 @@ class Component(BaseComponent, ABC):
|
|||||||
if types._issubclass(field.type_, EventHandler):
|
if types._issubclass(field.type_, EventHandler):
|
||||||
args_spec = None
|
args_spec = None
|
||||||
annotation = field.annotation
|
annotation = field.annotation
|
||||||
if hasattr(annotation, "__metadata__"):
|
if (metadata := getattr(annotation, "__metadata__", None)) is not None:
|
||||||
args_spec = annotation.__metadata__[0]
|
args_spec = metadata[0]
|
||||||
default_triggers[field.name] = args_spec or (lambda: [])
|
default_triggers[field.name] = args_spec or (empty_event) # type: ignore
|
||||||
return default_triggers
|
return default_triggers
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
@ -1016,8 +1048,11 @@ class Component(BaseComponent, ABC):
|
|||||||
elif isinstance(event, EventChain):
|
elif isinstance(event, EventChain):
|
||||||
event_args = []
|
event_args = []
|
||||||
for spec in event.events:
|
for spec in event.events:
|
||||||
for args in spec.args:
|
if isinstance(spec, EventSpec):
|
||||||
event_args.extend(args)
|
for args in spec.args:
|
||||||
|
event_args.extend(args)
|
||||||
|
else:
|
||||||
|
event_args.append(spec)
|
||||||
yield event_trigger, event_args
|
yield event_trigger, event_args
|
||||||
|
|
||||||
def _get_vars(self, include_children: bool = False) -> list[Var]:
|
def _get_vars(self, include_children: bool = False) -> list[Var]:
|
||||||
@ -1091,8 +1126,12 @@ class Component(BaseComponent, ABC):
|
|||||||
for trigger in self.event_triggers.values():
|
for trigger in self.event_triggers.values():
|
||||||
if isinstance(trigger, EventChain):
|
if isinstance(trigger, EventChain):
|
||||||
for event in trigger.events:
|
for event in trigger.events:
|
||||||
if event.handler.state_full_name:
|
if isinstance(event, EventSpec):
|
||||||
return True
|
if event.handler.state_full_name:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
if event._var_state:
|
||||||
|
return True
|
||||||
elif isinstance(trigger, Var) and trigger._var_state:
|
elif isinstance(trigger, Var) and trigger._var_state:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
@ -1667,7 +1706,7 @@ class CustomComponent(Component):
|
|||||||
value = self._create_event_chain(
|
value = self._create_event_chain(
|
||||||
value=value,
|
value=value,
|
||||||
args_spec=event_triggers_in_component_declaration.get(
|
args_spec=event_triggers_in_component_declaration.get(
|
||||||
key, lambda: []
|
key, empty_event
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
self.props[format.to_camel_case(key)] = value
|
self.props[format.to_camel_case(key)] = value
|
||||||
@ -1730,10 +1769,14 @@ class CustomComponent(Component):
|
|||||||
Args:
|
Args:
|
||||||
seen: The tags of the components that have already been seen.
|
seen: The tags of the components that have already been seen.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
ValueError: If the tag is not set.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The set of custom components.
|
The set of custom components.
|
||||||
"""
|
"""
|
||||||
assert self.tag is not None, "The tag must be set."
|
if self.tag is None:
|
||||||
|
raise ValueError("The tag must be set.")
|
||||||
|
|
||||||
# Store the seen components in a set to avoid infinite recursion.
|
# Store the seen components in a set to avoid infinite recursion.
|
||||||
if seen is None:
|
if seen is None:
|
||||||
@ -1882,19 +1925,6 @@ class NoSSRComponent(Component):
|
|||||||
return "".join((library_import, mod_import, opts_fragment))
|
return "".join((library_import, mod_import, opts_fragment))
|
||||||
|
|
||||||
|
|
||||||
@serializer
|
|
||||||
def serialize_component(comp: Component):
|
|
||||||
"""Serialize a component.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
comp: The component to serialize.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
The serialized component.
|
|
||||||
"""
|
|
||||||
return str(comp)
|
|
||||||
|
|
||||||
|
|
||||||
class StatefulComponent(BaseComponent):
|
class StatefulComponent(BaseComponent):
|
||||||
"""A component that depends on state and is rendered outside of the page component.
|
"""A component that depends on state and is rendered outside of the page component.
|
||||||
|
|
||||||
@ -2307,3 +2337,6 @@ class MemoizationLeaf(Component):
|
|||||||
update={"disposition": MemoizationDisposition.ALWAYS}
|
update={"disposition": MemoizationDisposition.ALWAYS}
|
||||||
)
|
)
|
||||||
return comp
|
return comp
|
||||||
|
|
||||||
|
|
||||||
|
load_dynamic_serializer()
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
||||||
|
|
||||||
from reflex.components.component import Component
|
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.constants.compiler import CompileVars
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventType
|
||||||
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 VarData
|
from reflex.vars import VarData
|
||||||
@ -89,41 +89,21 @@ class ConnectionToaster(Toaster):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "ConnectionToaster":
|
) -> "ConnectionToaster":
|
||||||
"""Create a connection toaster component.
|
"""Create a connection toaster component.
|
||||||
@ -169,41 +149,21 @@ class ConnectionBanner(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "ConnectionBanner":
|
) -> "ConnectionBanner":
|
||||||
"""Create a connection banner component.
|
"""Create a connection banner component.
|
||||||
@ -228,41 +188,21 @@ class ConnectionModal(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "ConnectionModal":
|
) -> "ConnectionModal":
|
||||||
"""Create a connection banner component.
|
"""Create a connection banner component.
|
||||||
@ -288,41 +228,21 @@ class WifiOffPulse(Icon):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "WifiOffPulse":
|
) -> "WifiOffPulse":
|
||||||
"""Create a wifi_off icon with an animated opacity pulse.
|
"""Create a wifi_off icon with an animated opacity pulse.
|
||||||
@ -381,41 +301,21 @@ class ConnectionPulser(Div):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "ConnectionPulser":
|
) -> "ConnectionPulser":
|
||||||
"""Create a connection pulser component.
|
"""Create a connection pulser component.
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -26,41 +26,21 @@ class ClientSideRouting(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "ClientSideRouting":
|
) -> "ClientSideRouting":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -95,41 +75,21 @@ class Default404Page(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Default404Page":
|
) -> "Default404Page":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Dict, List, Union
|
from typing import Dict, List, Tuple, Union
|
||||||
|
|
||||||
from reflex.components.base.fragment import Fragment
|
from reflex.components.base.fragment import Fragment
|
||||||
from reflex.components.tags.tag import Tag
|
from reflex.components.tags.tag import Tag
|
||||||
from reflex.event import EventChain, EventHandler
|
from reflex.event import EventChain, EventHandler, identity_event
|
||||||
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 get_unique_variable_name
|
from reflex.vars import get_unique_variable_name
|
||||||
@ -20,7 +20,7 @@ class Clipboard(Fragment):
|
|||||||
targets: Var[List[str]]
|
targets: Var[List[str]]
|
||||||
|
|
||||||
# Called when the user pastes data into the document. Data is a list of tuples of (mime_type, data). Binary types will be base64 encoded as a data uri.
|
# Called when the user pastes data into the document. Data is a list of tuples of (mime_type, data). Binary types will be base64 encoded as a data uri.
|
||||||
on_paste: EventHandler[lambda data: [data]]
|
on_paste: EventHandler[identity_event(List[Tuple[str, str]])]
|
||||||
|
|
||||||
# Save the original event actions for the on_paste event.
|
# Save the original event actions for the on_paste event.
|
||||||
on_paste_event_actions: Var[Dict[str, Union[bool, int]]]
|
on_paste_event_actions: Var[Dict[str, Union[bool, int]]]
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, List, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
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.base import Var
|
from reflex.vars.base import Var
|
||||||
@ -27,42 +27,22 @@ class Clipboard(Fragment):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_paste: Optional[EventType[list[tuple[str, str]]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_paste: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Clipboard":
|
) -> "Clipboard":
|
||||||
"""Create a Clipboard component.
|
"""Create a Clipboard component.
|
||||||
|
@ -138,13 +138,13 @@ def cond(condition: Any, c1: Any, c2: Any = None) -> Component | Var:
|
|||||||
"""
|
"""
|
||||||
# Convert the condition to a Var.
|
# Convert the condition to a Var.
|
||||||
cond_var = LiteralVar.create(condition)
|
cond_var = LiteralVar.create(condition)
|
||||||
assert cond_var is not None, "The condition must be set."
|
if cond_var is None:
|
||||||
|
raise ValueError("The condition must be set.")
|
||||||
|
|
||||||
# If the first component is a component, create a Cond component.
|
# If the first component is a component, create a Cond component.
|
||||||
if isinstance(c1, BaseComponent):
|
if isinstance(c1, BaseComponent):
|
||||||
assert c2 is None or isinstance(
|
if c2 is not None and not isinstance(c2, BaseComponent):
|
||||||
c2, BaseComponent
|
raise ValueError("Both arguments must be components.")
|
||||||
), "Both arguments must be components."
|
|
||||||
return Cond.create(cond_var, c1, c2)
|
return Cond.create(cond_var, c1, c2)
|
||||||
|
|
||||||
# Otherwise, create a conditional Var.
|
# Otherwise, create a conditional Var.
|
||||||
|
@ -6,7 +6,7 @@ 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, empty_event
|
||||||
from reflex.vars import VarData
|
from reflex.vars import VarData
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ class DebounceInput(Component):
|
|||||||
element: Var[Type[Component]]
|
element: Var[Type[Component]]
|
||||||
|
|
||||||
# Fired when the input value changes
|
# Fired when the input value changes
|
||||||
on_change: EventHandler[lambda e0: [e0.value]]
|
on_change: EventHandler[empty_event]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(cls, *children: Component, **props: Any) -> Component:
|
def create(cls, *children: Component, **props: Any) -> Component:
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Type, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -31,42 +31,22 @@ class DebounceInput(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_change: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "DebounceInput":
|
) -> "DebounceInput":
|
||||||
"""Create a DebounceInput component.
|
"""Create a DebounceInput component.
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -49,41 +49,21 @@ class Html(Div):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Html":
|
) -> "Html":
|
||||||
"""Create a html component.
|
"""Create a html component.
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Callable, ClassVar, Dict, List, Optional
|
from typing import Any, Callable, ClassVar, Dict, List, Optional, Tuple
|
||||||
|
|
||||||
from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf
|
from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf
|
||||||
from reflex.components.el.elements.forms import Input
|
from reflex.components.el.elements.forms import Input
|
||||||
from reflex.components.radix.themes.layout.box import Box
|
from reflex.components.radix.themes.layout.box import Box
|
||||||
|
from reflex.config import environment
|
||||||
from reflex.constants import Dirs
|
from reflex.constants import Dirs
|
||||||
from reflex.event import (
|
from reflex.event import (
|
||||||
CallableEventSpec,
|
CallableEventSpec,
|
||||||
@ -125,9 +125,7 @@ def get_upload_dir() -> Path:
|
|||||||
"""
|
"""
|
||||||
Upload.is_used = True
|
Upload.is_used = True
|
||||||
|
|
||||||
uploaded_files_dir = Path(
|
uploaded_files_dir = environment.REFLEX_UPLOADED_FILES_DIR
|
||||||
os.environ.get("REFLEX_UPLOADED_FILES_DIR", "./uploaded_files")
|
|
||||||
)
|
|
||||||
uploaded_files_dir.mkdir(parents=True, exist_ok=True)
|
uploaded_files_dir.mkdir(parents=True, exist_ok=True)
|
||||||
return uploaded_files_dir
|
return uploaded_files_dir
|
||||||
|
|
||||||
@ -157,7 +155,7 @@ def get_upload_url(file_path: str) -> Var[str]:
|
|||||||
return uploaded_files_url_prefix + "/" + file_path
|
return uploaded_files_url_prefix + "/" + file_path
|
||||||
|
|
||||||
|
|
||||||
def _on_drop_spec(files: Var):
|
def _on_drop_spec(files: Var) -> Tuple[Var[Any]]:
|
||||||
"""Args spec for the on_drop event trigger.
|
"""Args spec for the on_drop event trigger.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -166,7 +164,7 @@ def _on_drop_spec(files: Var):
|
|||||||
Returns:
|
Returns:
|
||||||
Signature for on_drop handler including the files to upload.
|
Signature for on_drop handler including the files to upload.
|
||||||
"""
|
"""
|
||||||
return [files]
|
return (files,)
|
||||||
|
|
||||||
|
|
||||||
class UploadFilesProvider(Component):
|
class UploadFilesProvider(Component):
|
||||||
@ -179,7 +177,7 @@ class UploadFilesProvider(Component):
|
|||||||
class Upload(MemoizationLeaf):
|
class Upload(MemoizationLeaf):
|
||||||
"""A file upload component."""
|
"""A file upload component."""
|
||||||
|
|
||||||
library = "react-dropzone@14.2.3"
|
library = "react-dropzone@14.2.10"
|
||||||
|
|
||||||
tag = "ReactDropzone"
|
tag = "ReactDropzone"
|
||||||
|
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Callable, ClassVar, Dict, List, Optional, Union, overload
|
from typing import Any, ClassVar, Dict, List, Optional, Union, overload
|
||||||
|
|
||||||
from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf
|
from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf
|
||||||
from reflex.constants import Dirs
|
from reflex.constants import Dirs
|
||||||
from reflex.event import (
|
from reflex.event import (
|
||||||
CallableEventSpec,
|
CallableEventSpec,
|
||||||
EventHandler,
|
|
||||||
EventSpec,
|
EventSpec,
|
||||||
|
EventType,
|
||||||
)
|
)
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.utils.imports import ImportVar
|
from reflex.utils.imports import ImportVar
|
||||||
@ -54,41 +54,21 @@ class UploadFilesProvider(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "UploadFilesProvider":
|
) -> "UploadFilesProvider":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -131,42 +111,22 @@ class Upload(MemoizationLeaf):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_drop: Optional[EventType[Any]] = None,
|
||||||
on_double_click: Optional[
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
on_drop: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Upload":
|
) -> "Upload":
|
||||||
"""Create an upload component.
|
"""Create an upload component.
|
||||||
@ -216,42 +176,22 @@ class StyledUpload(Upload):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_drop: Optional[EventType[Any]] = None,
|
||||||
on_double_click: Optional[
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
on_drop: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "StyledUpload":
|
) -> "StyledUpload":
|
||||||
"""Create the styled upload component.
|
"""Create the styled upload component.
|
||||||
@ -301,42 +241,22 @@ class UploadNamespace(ComponentNamespace):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_drop: Optional[EventType[Any]] = None,
|
||||||
on_double_click: Optional[
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
on_drop: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "StyledUpload":
|
) -> "StyledUpload":
|
||||||
"""Create the styled upload component.
|
"""Create the styled upload component.
|
||||||
|
@ -8,7 +8,6 @@ _SUBMOD_ATTRS: dict[str, list[str]] = {
|
|||||||
"code": [
|
"code": [
|
||||||
"CodeBlock",
|
"CodeBlock",
|
||||||
"code_block",
|
"code_block",
|
||||||
"LiteralCodeBlockTheme",
|
|
||||||
"LiteralCodeLanguage",
|
"LiteralCodeLanguage",
|
||||||
],
|
],
|
||||||
"dataeditor": ["data_editor", "data_editor_theme", "DataEditorTheme"],
|
"dataeditor": ["data_editor", "data_editor_theme", "DataEditorTheme"],
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
|
|
||||||
from .code import CodeBlock as CodeBlock
|
from .code import CodeBlock as CodeBlock
|
||||||
from .code import LiteralCodeBlockTheme as LiteralCodeBlockTheme
|
|
||||||
from .code import LiteralCodeLanguage as LiteralCodeLanguage
|
from .code import LiteralCodeLanguage as LiteralCodeLanguage
|
||||||
from .code import code_block as code_block
|
from .code import code_block as code_block
|
||||||
from .dataeditor import DataEditorTheme as DataEditorTheme
|
from .dataeditor import DataEditorTheme as DataEditorTheme
|
||||||
|
@ -2,11 +2,10 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Dict, Literal, Optional, Union
|
import dataclasses
|
||||||
|
from typing import ClassVar, Dict, Literal, Optional, Union
|
||||||
|
|
||||||
from typing_extensions import get_args
|
from reflex.components.component import Component, ComponentNamespace
|
||||||
|
|
||||||
from reflex.components.component import Component
|
|
||||||
from reflex.components.core.cond import color_mode_cond
|
from reflex.components.core.cond import color_mode_cond
|
||||||
from reflex.components.lucide.icon import Icon
|
from reflex.components.lucide.icon import Icon
|
||||||
from reflex.components.radix.themes.components.button import Button
|
from reflex.components.radix.themes.components.button import Button
|
||||||
@ -14,58 +13,9 @@ 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.style import Style
|
from reflex.style import Style
|
||||||
from reflex.utils import format
|
from reflex.utils import console, format
|
||||||
from reflex.utils.imports import ImportDict, ImportVar
|
from reflex.utils.imports import ImportDict, ImportVar
|
||||||
from reflex.vars.base import LiteralVar, Var
|
from reflex.vars.base import LiteralVar, Var, VarData
|
||||||
|
|
||||||
LiteralCodeBlockTheme = 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", # not present in react-syntax-highlighter styles
|
|
||||||
"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",
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
LiteralCodeLanguage = Literal[
|
LiteralCodeLanguage = Literal[
|
||||||
"abap",
|
"abap",
|
||||||
@ -350,31 +300,95 @@ LiteralCodeLanguage = Literal[
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def replace_quotes_with_camel_case(value: str) -> str:
|
def construct_theme_var(theme: str) -> Var[Theme]:
|
||||||
"""Replaces quotes in the given string with camel case format.
|
"""Construct a theme var.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
value (str): The string to be processed.
|
theme: The theme to construct.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
str: The processed string with quotes replaced by camel case.
|
The constructed theme var.
|
||||||
"""
|
"""
|
||||||
for theme in get_args(LiteralCodeBlockTheme):
|
return Var(
|
||||||
value = value.replace(f'"{theme}"', format.to_camel_case(theme))
|
theme,
|
||||||
return value
|
_var_data=VarData(
|
||||||
|
imports={
|
||||||
|
f"react-syntax-highlighter/dist/cjs/styles/prism/{format.to_kebab_case(theme)}": [
|
||||||
|
ImportVar(tag=theme, is_default=True, install=False)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@dataclasses.dataclass(init=False)
|
||||||
|
class Theme:
|
||||||
|
"""Themes for the CodeBlock component."""
|
||||||
|
|
||||||
|
a11y_dark: ClassVar[Var[Theme]] = construct_theme_var("a11yDark")
|
||||||
|
atom_dark: ClassVar[Var[Theme]] = construct_theme_var("atomDark")
|
||||||
|
cb: ClassVar[Var[Theme]] = construct_theme_var("cb")
|
||||||
|
coldark_cold: ClassVar[Var[Theme]] = construct_theme_var("coldarkCold")
|
||||||
|
coldark_dark: ClassVar[Var[Theme]] = construct_theme_var("coldarkDark")
|
||||||
|
coy: ClassVar[Var[Theme]] = construct_theme_var("coy")
|
||||||
|
coy_without_shadows: ClassVar[Var[Theme]] = construct_theme_var("coyWithoutShadows")
|
||||||
|
darcula: ClassVar[Var[Theme]] = construct_theme_var("darcula")
|
||||||
|
dark: ClassVar[Var[Theme]] = construct_theme_var("oneDark")
|
||||||
|
dracula: ClassVar[Var[Theme]] = construct_theme_var("dracula")
|
||||||
|
duotone_dark: ClassVar[Var[Theme]] = construct_theme_var("duotoneDark")
|
||||||
|
duotone_earth: ClassVar[Var[Theme]] = construct_theme_var("duotoneEarth")
|
||||||
|
duotone_forest: ClassVar[Var[Theme]] = construct_theme_var("duotoneForest")
|
||||||
|
duotone_light: ClassVar[Var[Theme]] = construct_theme_var("duotoneLight")
|
||||||
|
duotone_sea: ClassVar[Var[Theme]] = construct_theme_var("duotoneSea")
|
||||||
|
duotone_space: ClassVar[Var[Theme]] = construct_theme_var("duotoneSpace")
|
||||||
|
funky: ClassVar[Var[Theme]] = construct_theme_var("funky")
|
||||||
|
ghcolors: ClassVar[Var[Theme]] = construct_theme_var("ghcolors")
|
||||||
|
gruvbox_dark: ClassVar[Var[Theme]] = construct_theme_var("gruvboxDark")
|
||||||
|
gruvbox_light: ClassVar[Var[Theme]] = construct_theme_var("gruvboxLight")
|
||||||
|
holi_theme: ClassVar[Var[Theme]] = construct_theme_var("holiTheme")
|
||||||
|
hopscotch: ClassVar[Var[Theme]] = construct_theme_var("hopscotch")
|
||||||
|
light: ClassVar[Var[Theme]] = construct_theme_var("oneLight")
|
||||||
|
lucario: ClassVar[Var[Theme]] = construct_theme_var("lucario")
|
||||||
|
material_dark: ClassVar[Var[Theme]] = construct_theme_var("materialDark")
|
||||||
|
material_light: ClassVar[Var[Theme]] = construct_theme_var("materialLight")
|
||||||
|
material_oceanic: ClassVar[Var[Theme]] = construct_theme_var("materialOceanic")
|
||||||
|
night_owl: ClassVar[Var[Theme]] = construct_theme_var("nightOwl")
|
||||||
|
nord: ClassVar[Var[Theme]] = construct_theme_var("nord")
|
||||||
|
okaidia: ClassVar[Var[Theme]] = construct_theme_var("okaidia")
|
||||||
|
one_dark: ClassVar[Var[Theme]] = construct_theme_var("oneDark")
|
||||||
|
one_light: ClassVar[Var[Theme]] = construct_theme_var("oneLight")
|
||||||
|
pojoaque: ClassVar[Var[Theme]] = construct_theme_var("pojoaque")
|
||||||
|
prism: ClassVar[Var[Theme]] = construct_theme_var("prism")
|
||||||
|
shades_of_purple: ClassVar[Var[Theme]] = construct_theme_var("shadesOfPurple")
|
||||||
|
solarized_dark_atom: ClassVar[Var[Theme]] = construct_theme_var("solarizedDarkAtom")
|
||||||
|
solarizedlight: ClassVar[Var[Theme]] = construct_theme_var("solarizedlight")
|
||||||
|
synthwave84: ClassVar[Var[Theme]] = construct_theme_var("synthwave84")
|
||||||
|
tomorrow: ClassVar[Var[Theme]] = construct_theme_var("tomorrow")
|
||||||
|
twilight: ClassVar[Var[Theme]] = construct_theme_var("twilight")
|
||||||
|
vs: ClassVar[Var[Theme]] = construct_theme_var("vs")
|
||||||
|
vs_dark: ClassVar[Var[Theme]] = construct_theme_var("vsDark")
|
||||||
|
vsc_dark_plus: ClassVar[Var[Theme]] = construct_theme_var("vscDarkPlus")
|
||||||
|
xonokai: ClassVar[Var[Theme]] = construct_theme_var("xonokai")
|
||||||
|
z_touch: ClassVar[Var[Theme]] = construct_theme_var("zTouch")
|
||||||
|
|
||||||
|
|
||||||
|
for theme_name in dir(Theme):
|
||||||
|
if theme_name.startswith("_"):
|
||||||
|
continue
|
||||||
|
setattr(Theme, theme_name, getattr(Theme, theme_name)._replace(_var_type=Theme))
|
||||||
|
|
||||||
|
|
||||||
class CodeBlock(Component):
|
class CodeBlock(Component):
|
||||||
"""A code block."""
|
"""A code block."""
|
||||||
|
|
||||||
library = "react-syntax-highlighter@15.5.0"
|
library = "react-syntax-highlighter@15.6.1"
|
||||||
|
|
||||||
tag = "PrismAsyncLight"
|
tag = "PrismAsyncLight"
|
||||||
|
|
||||||
alias = "SyntaxHighlighter"
|
alias = "SyntaxHighlighter"
|
||||||
|
|
||||||
# The theme to use ("light" or "dark").
|
# The theme to use ("light" or "dark").
|
||||||
theme: Var[Any] = "one-light" # type: ignore
|
theme: Var[Union[Theme, str]] = Theme.one_light
|
||||||
|
|
||||||
# The language to use.
|
# The language to use.
|
||||||
language: Var[LiteralCodeLanguage] = "python" # type: ignore
|
language: Var[LiteralCodeLanguage] = "python" # type: ignore
|
||||||
@ -405,31 +419,6 @@ class CodeBlock(Component):
|
|||||||
"""
|
"""
|
||||||
imports_: ImportDict = {}
|
imports_: ImportDict = {}
|
||||||
|
|
||||||
themeString = str(self.theme)
|
|
||||||
|
|
||||||
selected_themes = []
|
|
||||||
|
|
||||||
for possibleTheme in get_args(LiteralCodeBlockTheme):
|
|
||||||
if format.to_camel_case(possibleTheme) in themeString:
|
|
||||||
selected_themes.append(possibleTheme)
|
|
||||||
if possibleTheme in themeString:
|
|
||||||
selected_themes.append(possibleTheme)
|
|
||||||
|
|
||||||
selected_themes = sorted(set(map(self.convert_theme_name, selected_themes)))
|
|
||||||
|
|
||||||
imports_.update(
|
|
||||||
{
|
|
||||||
f"react-syntax-highlighter/dist/cjs/styles/prism/{theme}": [
|
|
||||||
ImportVar(
|
|
||||||
tag=format.to_camel_case(theme),
|
|
||||||
is_default=True,
|
|
||||||
install=False,
|
|
||||||
)
|
|
||||||
]
|
|
||||||
for theme in selected_themes
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
self.language is not None
|
self.language is not None
|
||||||
and (language_without_quotes := str(self.language).replace('"', ""))
|
and (language_without_quotes := str(self.language).replace('"', ""))
|
||||||
@ -480,14 +469,20 @@ 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=Var(_js_expr="oneLight"),
|
light=Theme.one_light,
|
||||||
dark=Var(_js_expr="oneDark"),
|
dark=Theme.one_dark,
|
||||||
)
|
)
|
||||||
|
|
||||||
# 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"], Var):
|
if "theme" in props and not isinstance(props["theme"], Var):
|
||||||
props["theme"] = cls.convert_theme_name(props["theme"])
|
props["theme"] = getattr(Theme, format.to_snake_case(props["theme"])) # type: ignore
|
||||||
|
console.deprecate(
|
||||||
|
feature_name="theme prop as string",
|
||||||
|
reason="Use code_block.themes instead.",
|
||||||
|
deprecation_version="0.6.0",
|
||||||
|
removal_version="0.7.0",
|
||||||
|
)
|
||||||
|
|
||||||
if can_copy:
|
if can_copy:
|
||||||
code = children[0]
|
code = children[0]
|
||||||
@ -533,9 +528,7 @@ class CodeBlock(Component):
|
|||||||
def _render(self):
|
def _render(self):
|
||||||
out = super()._render()
|
out = super()._render()
|
||||||
|
|
||||||
theme = self.theme._replace(
|
theme = 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(
|
||||||
children=self.code
|
children=self.code
|
||||||
@ -543,19 +536,13 @@ class CodeBlock(Component):
|
|||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def convert_theme_name(theme) -> str:
|
|
||||||
"""Convert theme names to appropriate names.
|
|
||||||
|
|
||||||
Args:
|
class CodeblockNamespace(ComponentNamespace):
|
||||||
theme: The theme name.
|
"""Namespace for the CodeBlock component."""
|
||||||
|
|
||||||
Returns:
|
themes = Theme
|
||||||
The right theme name.
|
|
||||||
"""
|
__call__ = CodeBlock.create
|
||||||
if theme in ["light", "dark"]:
|
|
||||||
return f"one-{theme}"
|
|
||||||
return theme
|
|
||||||
|
|
||||||
|
|
||||||
code_block = CodeBlock.create
|
code_block = CodeblockNamespace()
|
||||||
|
@ -3,62 +3,16 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
|
import dataclasses
|
||||||
|
from typing import Any, ClassVar, Dict, Literal, Optional, Union, overload
|
||||||
|
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component, ComponentNamespace
|
||||||
from reflex.constants.colors import Color
|
from reflex.constants.colors import Color
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventType
|
||||||
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.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
LiteralCodeBlockTheme = 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",
|
|
||||||
]
|
|
||||||
LiteralCodeLanguage = Literal[
|
LiteralCodeLanguage = Literal[
|
||||||
"abap",
|
"abap",
|
||||||
"abnf",
|
"abnf",
|
||||||
@ -341,7 +295,59 @@ LiteralCodeLanguage = Literal[
|
|||||||
"zig",
|
"zig",
|
||||||
]
|
]
|
||||||
|
|
||||||
def replace_quotes_with_camel_case(value: str) -> str: ...
|
def construct_theme_var(theme: str) -> Var[Theme]: ...
|
||||||
|
@dataclasses.dataclass(init=False)
|
||||||
|
class Theme:
|
||||||
|
a11y_dark: ClassVar[Var[Theme]] = construct_theme_var("a11yDark")
|
||||||
|
atom_dark: ClassVar[Var[Theme]] = construct_theme_var("atomDark")
|
||||||
|
cb: ClassVar[Var[Theme]] = construct_theme_var("cb")
|
||||||
|
coldark_cold: ClassVar[Var[Theme]] = construct_theme_var("coldarkCold")
|
||||||
|
coldark_dark: ClassVar[Var[Theme]] = construct_theme_var("coldarkDark")
|
||||||
|
coy: ClassVar[Var[Theme]] = construct_theme_var("coy")
|
||||||
|
coy_without_shadows: ClassVar[Var[Theme]] = construct_theme_var("coyWithoutShadows")
|
||||||
|
darcula: ClassVar[Var[Theme]] = construct_theme_var("darcula")
|
||||||
|
dark: ClassVar[Var[Theme]] = construct_theme_var("oneDark")
|
||||||
|
dracula: ClassVar[Var[Theme]] = construct_theme_var("dracula")
|
||||||
|
duotone_dark: ClassVar[Var[Theme]] = construct_theme_var("duotoneDark")
|
||||||
|
duotone_earth: ClassVar[Var[Theme]] = construct_theme_var("duotoneEarth")
|
||||||
|
duotone_forest: ClassVar[Var[Theme]] = construct_theme_var("duotoneForest")
|
||||||
|
duotone_light: ClassVar[Var[Theme]] = construct_theme_var("duotoneLight")
|
||||||
|
duotone_sea: ClassVar[Var[Theme]] = construct_theme_var("duotoneSea")
|
||||||
|
duotone_space: ClassVar[Var[Theme]] = construct_theme_var("duotoneSpace")
|
||||||
|
funky: ClassVar[Var[Theme]] = construct_theme_var("funky")
|
||||||
|
ghcolors: ClassVar[Var[Theme]] = construct_theme_var("ghcolors")
|
||||||
|
gruvbox_dark: ClassVar[Var[Theme]] = construct_theme_var("gruvboxDark")
|
||||||
|
gruvbox_light: ClassVar[Var[Theme]] = construct_theme_var("gruvboxLight")
|
||||||
|
holi_theme: ClassVar[Var[Theme]] = construct_theme_var("holiTheme")
|
||||||
|
hopscotch: ClassVar[Var[Theme]] = construct_theme_var("hopscotch")
|
||||||
|
light: ClassVar[Var[Theme]] = construct_theme_var("oneLight")
|
||||||
|
lucario: ClassVar[Var[Theme]] = construct_theme_var("lucario")
|
||||||
|
material_dark: ClassVar[Var[Theme]] = construct_theme_var("materialDark")
|
||||||
|
material_light: ClassVar[Var[Theme]] = construct_theme_var("materialLight")
|
||||||
|
material_oceanic: ClassVar[Var[Theme]] = construct_theme_var("materialOceanic")
|
||||||
|
night_owl: ClassVar[Var[Theme]] = construct_theme_var("nightOwl")
|
||||||
|
nord: ClassVar[Var[Theme]] = construct_theme_var("nord")
|
||||||
|
okaidia: ClassVar[Var[Theme]] = construct_theme_var("okaidia")
|
||||||
|
one_dark: ClassVar[Var[Theme]] = construct_theme_var("oneDark")
|
||||||
|
one_light: ClassVar[Var[Theme]] = construct_theme_var("oneLight")
|
||||||
|
pojoaque: ClassVar[Var[Theme]] = construct_theme_var("pojoaque")
|
||||||
|
prism: ClassVar[Var[Theme]] = construct_theme_var("prism")
|
||||||
|
shades_of_purple: ClassVar[Var[Theme]] = construct_theme_var("shadesOfPurple")
|
||||||
|
solarized_dark_atom: ClassVar[Var[Theme]] = construct_theme_var("solarizedDarkAtom")
|
||||||
|
solarizedlight: ClassVar[Var[Theme]] = construct_theme_var("solarizedlight")
|
||||||
|
synthwave84: ClassVar[Var[Theme]] = construct_theme_var("synthwave84")
|
||||||
|
tomorrow: ClassVar[Var[Theme]] = construct_theme_var("tomorrow")
|
||||||
|
twilight: ClassVar[Var[Theme]] = construct_theme_var("twilight")
|
||||||
|
vs: ClassVar[Var[Theme]] = construct_theme_var("vs")
|
||||||
|
vs_dark: ClassVar[Var[Theme]] = construct_theme_var("vsDark")
|
||||||
|
vsc_dark_plus: ClassVar[Var[Theme]] = construct_theme_var("vscDarkPlus")
|
||||||
|
xonokai: ClassVar[Var[Theme]] = construct_theme_var("xonokai")
|
||||||
|
z_touch: ClassVar[Var[Theme]] = construct_theme_var("zTouch")
|
||||||
|
|
||||||
|
for theme_name in dir(Theme):
|
||||||
|
if theme_name.startswith("_"):
|
||||||
|
continue
|
||||||
|
setattr(Theme, theme_name, getattr(Theme, theme_name)._replace(_var_type=Theme))
|
||||||
|
|
||||||
class CodeBlock(Component):
|
class CodeBlock(Component):
|
||||||
def add_imports(self) -> ImportDict: ...
|
def add_imports(self) -> ImportDict: ...
|
||||||
@ -352,7 +358,7 @@ 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[Union[Any, Var[Any]]] = None,
|
theme: Optional[Union[Theme, Var[Union[Theme, str]], str]] = None,
|
||||||
language: Optional[
|
language: Optional[
|
||||||
Union[
|
Union[
|
||||||
Literal[
|
Literal[
|
||||||
@ -933,41 +939,21 @@ class CodeBlock(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "CodeBlock":
|
) -> "CodeBlock":
|
||||||
"""Create a text component.
|
"""Create a text component.
|
||||||
@ -998,7 +984,638 @@ class CodeBlock(Component):
|
|||||||
...
|
...
|
||||||
|
|
||||||
def add_style(self): ...
|
def add_style(self): ...
|
||||||
@staticmethod
|
|
||||||
def convert_theme_name(theme) -> str: ...
|
|
||||||
|
|
||||||
code_block = CodeBlock.create
|
class CodeblockNamespace(ComponentNamespace):
|
||||||
|
themes = Theme
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def __call__(
|
||||||
|
*children,
|
||||||
|
can_copy: Optional[bool] = False,
|
||||||
|
copy_button: Optional[Union[Component, bool]] = None,
|
||||||
|
theme: Optional[Union[Theme, Var[Union[Theme, str]], str]] = None,
|
||||||
|
language: Optional[
|
||||||
|
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[
|
||||||
|
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,
|
||||||
|
code: Optional[Union[Var[str], str]] = None,
|
||||||
|
show_line_numbers: Optional[Union[Var[bool], bool]] = None,
|
||||||
|
starting_line_number: Optional[Union[Var[int], int]] = None,
|
||||||
|
wrap_long_lines: Optional[Union[Var[bool], bool]] = None,
|
||||||
|
custom_style: Optional[Dict[str, Union[str, Var, Color]]] = None,
|
||||||
|
code_tag_props: Optional[Union[Dict[str, str], Var[Dict[str, str]]]] = None,
|
||||||
|
style: Optional[Style] = None,
|
||||||
|
key: Optional[Any] = None,
|
||||||
|
id: Optional[Any] = None,
|
||||||
|
class_name: Optional[Any] = None,
|
||||||
|
autofocus: Optional[bool] = None,
|
||||||
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
|
on_click: Optional[EventType[[]]] = None,
|
||||||
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
|
**props,
|
||||||
|
) -> "CodeBlock":
|
||||||
|
"""Create a text component.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
*children: The children of the component.
|
||||||
|
can_copy: Whether a copy button should appears.
|
||||||
|
copy_button: A custom copy button to override the default one.
|
||||||
|
theme: The theme to use ("light" or "dark").
|
||||||
|
language: The language to use.
|
||||||
|
code: The code to display.
|
||||||
|
show_line_numbers: If this is enabled line numbers will be shown next to the code block.
|
||||||
|
starting_line_number: The starting line number to use.
|
||||||
|
wrap_long_lines: Whether to wrap long lines.
|
||||||
|
custom_style: A custom style for the code block.
|
||||||
|
code_tag_props: Props passed down to the code tag.
|
||||||
|
style: The style of the component.
|
||||||
|
key: A unique key for the component.
|
||||||
|
id: The id for the component.
|
||||||
|
class_name: The class name for the component.
|
||||||
|
autofocus: Whether the component should take the focus once the page is loaded
|
||||||
|
custom_attrs: custom attribute
|
||||||
|
**props: The props to pass to the component.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The text component.
|
||||||
|
"""
|
||||||
|
...
|
||||||
|
|
||||||
|
code_block = CodeblockNamespace()
|
||||||
|
@ -3,12 +3,14 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Any, Dict, List, Literal, Optional, Union
|
from typing import Any, Dict, List, Literal, Optional, Tuple, Union
|
||||||
|
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
from reflex.base import Base
|
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, empty_event, identity_event
|
||||||
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
|
||||||
@ -120,15 +122,87 @@ def on_edit_spec(pos, data: dict[str, Any]):
|
|||||||
return [pos, data]
|
return [pos, data]
|
||||||
|
|
||||||
|
|
||||||
|
class Bounds(TypedDict):
|
||||||
|
"""The bounds of the group header."""
|
||||||
|
|
||||||
|
x: int
|
||||||
|
y: int
|
||||||
|
width: int
|
||||||
|
height: int
|
||||||
|
|
||||||
|
|
||||||
|
class CompatSelection(TypedDict):
|
||||||
|
"""The selection."""
|
||||||
|
|
||||||
|
items: list
|
||||||
|
|
||||||
|
|
||||||
|
class Rectangle(TypedDict):
|
||||||
|
"""The bounds of the group header."""
|
||||||
|
|
||||||
|
x: int
|
||||||
|
y: int
|
||||||
|
width: int
|
||||||
|
height: int
|
||||||
|
|
||||||
|
|
||||||
|
class GridSelectionCurrent(TypedDict):
|
||||||
|
"""The current selection."""
|
||||||
|
|
||||||
|
cell: list[int]
|
||||||
|
range: Rectangle
|
||||||
|
rangeStack: list[Rectangle]
|
||||||
|
|
||||||
|
|
||||||
|
class GridSelection(TypedDict):
|
||||||
|
"""The grid selection."""
|
||||||
|
|
||||||
|
current: Optional[GridSelectionCurrent]
|
||||||
|
columns: CompatSelection
|
||||||
|
rows: CompatSelection
|
||||||
|
|
||||||
|
|
||||||
|
class GroupHeaderClickedEventArgs(TypedDict):
|
||||||
|
"""The arguments for the group header clicked event."""
|
||||||
|
|
||||||
|
kind: str
|
||||||
|
group: str
|
||||||
|
location: list[int]
|
||||||
|
bounds: Bounds
|
||||||
|
isEdge: bool
|
||||||
|
shiftKey: bool
|
||||||
|
ctrlKey: bool
|
||||||
|
metaKey: bool
|
||||||
|
isTouch: bool
|
||||||
|
localEventX: int
|
||||||
|
localEventY: int
|
||||||
|
button: int
|
||||||
|
buttons: int
|
||||||
|
scrollEdge: list[int]
|
||||||
|
|
||||||
|
|
||||||
|
class GridCell(TypedDict):
|
||||||
|
"""The grid cell."""
|
||||||
|
|
||||||
|
span: Optional[List[int]]
|
||||||
|
|
||||||
|
|
||||||
|
class GridColumn(TypedDict):
|
||||||
|
"""The grid column."""
|
||||||
|
|
||||||
|
title: str
|
||||||
|
group: Optional[str]
|
||||||
|
|
||||||
|
|
||||||
class DataEditor(NoSSRComponent):
|
class DataEditor(NoSSRComponent):
|
||||||
"""The DataEditor Component."""
|
"""The DataEditor Component."""
|
||||||
|
|
||||||
tag = "DataEditor"
|
tag = "DataEditor"
|
||||||
is_default = True
|
is_default = True
|
||||||
library: str = "@glideapps/glide-data-grid@^5.3.0"
|
library: str = "@glideapps/glide-data-grid@^6.0.3"
|
||||||
lib_dependencies: List[str] = [
|
lib_dependencies: List[str] = [
|
||||||
"lodash@^4.17.21",
|
"lodash@^4.17.21",
|
||||||
"marked@^4.0.10",
|
"marked@^14.1.2",
|
||||||
"react-responsive-carousel@^3.2.7",
|
"react-responsive-carousel@^3.2.7",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -223,13 +297,13 @@ class DataEditor(NoSSRComponent):
|
|||||||
theme: Var[Union[DataEditorTheme, Dict]]
|
theme: Var[Union[DataEditorTheme, Dict]]
|
||||||
|
|
||||||
# Fired when a cell is activated.
|
# Fired when a cell is activated.
|
||||||
on_cell_activated: EventHandler[lambda pos: [pos]]
|
on_cell_activated: EventHandler[identity_event(Tuple[int, int])]
|
||||||
|
|
||||||
# Fired when a cell is clicked.
|
# Fired when a cell is clicked.
|
||||||
on_cell_clicked: EventHandler[lambda pos: [pos]]
|
on_cell_clicked: EventHandler[identity_event(Tuple[int, int])]
|
||||||
|
|
||||||
# Fired when a cell is right-clicked.
|
# Fired when a cell is right-clicked.
|
||||||
on_cell_context_menu: EventHandler[lambda pos: [pos]]
|
on_cell_context_menu: EventHandler[identity_event(Tuple[int, int])]
|
||||||
|
|
||||||
# Fired when a cell is edited.
|
# Fired when a cell is edited.
|
||||||
on_cell_edited: EventHandler[on_edit_spec]
|
on_cell_edited: EventHandler[on_edit_spec]
|
||||||
@ -238,37 +312,39 @@ class DataEditor(NoSSRComponent):
|
|||||||
on_group_header_clicked: EventHandler[on_edit_spec]
|
on_group_header_clicked: EventHandler[on_edit_spec]
|
||||||
|
|
||||||
# Fired when a group header is right-clicked.
|
# Fired when a group header is right-clicked.
|
||||||
on_group_header_context_menu: EventHandler[lambda grp_idx, data: [grp_idx, data]]
|
on_group_header_context_menu: EventHandler[
|
||||||
|
identity_event(int, GroupHeaderClickedEventArgs)
|
||||||
|
]
|
||||||
|
|
||||||
# Fired when a group header is renamed.
|
# Fired when a group header is renamed.
|
||||||
on_group_header_renamed: EventHandler[lambda idx, val: [idx, val]]
|
on_group_header_renamed: EventHandler[identity_event(str, str)]
|
||||||
|
|
||||||
# Fired when a header is clicked.
|
# Fired when a header is clicked.
|
||||||
on_header_clicked: EventHandler[lambda pos: [pos]]
|
on_header_clicked: EventHandler[identity_event(Tuple[int, int])]
|
||||||
|
|
||||||
# Fired when a header is right-clicked.
|
# Fired when a header is right-clicked.
|
||||||
on_header_context_menu: EventHandler[lambda pos: [pos]]
|
on_header_context_menu: EventHandler[identity_event(Tuple[int, int])]
|
||||||
|
|
||||||
# Fired when a header menu item is clicked.
|
# Fired when a header menu item is clicked.
|
||||||
on_header_menu_click: EventHandler[lambda col, pos: [col, pos]]
|
on_header_menu_click: EventHandler[identity_event(int, Rectangle)]
|
||||||
|
|
||||||
# Fired when an item is hovered.
|
# Fired when an item is hovered.
|
||||||
on_item_hovered: EventHandler[lambda pos: [pos]]
|
on_item_hovered: EventHandler[identity_event(Tuple[int, int])]
|
||||||
|
|
||||||
# Fired when a selection is deleted.
|
# Fired when a selection is deleted.
|
||||||
on_delete: EventHandler[lambda selection: [selection]]
|
on_delete: EventHandler[identity_event(GridSelection)]
|
||||||
|
|
||||||
# Fired when editing is finished.
|
# Fired when editing is finished.
|
||||||
on_finished_editing: EventHandler[lambda new_value, movement: [new_value, movement]]
|
on_finished_editing: EventHandler[identity_event(Union[GridCell, None], list[int])]
|
||||||
|
|
||||||
# Fired when a row is appended.
|
# Fired when a row is appended.
|
||||||
on_row_appended: EventHandler[lambda: []]
|
on_row_appended: EventHandler[empty_event]
|
||||||
|
|
||||||
# Fired when the selection is cleared.
|
# Fired when the selection is cleared.
|
||||||
on_selection_cleared: EventHandler[lambda: []]
|
on_selection_cleared: EventHandler[empty_event]
|
||||||
|
|
||||||
# Fired when a column is resized.
|
# Fired when a column is resized.
|
||||||
on_column_resize: EventHandler[lambda col, width: [col, width]]
|
on_column_resize: EventHandler[identity_event(GridColumn, int)]
|
||||||
|
|
||||||
def add_imports(self) -> ImportDict:
|
def add_imports(self) -> ImportDict:
|
||||||
"""Add imports for the component.
|
"""Add imports for the component.
|
||||||
@ -329,7 +405,7 @@ class DataEditor(NoSSRComponent):
|
|||||||
|
|
||||||
columns = props.get("columns", [])
|
columns = props.get("columns", [])
|
||||||
data = props.get("data", [])
|
data = props.get("data", [])
|
||||||
rows = props.get("rows", None)
|
rows = props.get("rows")
|
||||||
|
|
||||||
# If rows is not provided, determine from data.
|
# If rows is not provided, determine from data.
|
||||||
if rows is None:
|
if rows is None:
|
||||||
|
@ -4,11 +4,13 @@
|
|||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload
|
from typing import Any, Dict, List, Literal, Optional, Union, overload
|
||||||
|
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
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 EventType
|
||||||
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
|
||||||
@ -78,6 +80,54 @@ class DataEditorTheme(Base):
|
|||||||
|
|
||||||
def on_edit_spec(pos, data: dict[str, Any]): ...
|
def on_edit_spec(pos, data: dict[str, Any]): ...
|
||||||
|
|
||||||
|
class Bounds(TypedDict):
|
||||||
|
x: int
|
||||||
|
y: int
|
||||||
|
width: int
|
||||||
|
height: int
|
||||||
|
|
||||||
|
class CompatSelection(TypedDict):
|
||||||
|
items: list
|
||||||
|
|
||||||
|
class Rectangle(TypedDict):
|
||||||
|
x: int
|
||||||
|
y: int
|
||||||
|
width: int
|
||||||
|
height: int
|
||||||
|
|
||||||
|
class GridSelectionCurrent(TypedDict):
|
||||||
|
cell: list[int]
|
||||||
|
range: Rectangle
|
||||||
|
rangeStack: list[Rectangle]
|
||||||
|
|
||||||
|
class GridSelection(TypedDict):
|
||||||
|
current: Optional[GridSelectionCurrent]
|
||||||
|
columns: CompatSelection
|
||||||
|
rows: CompatSelection
|
||||||
|
|
||||||
|
class GroupHeaderClickedEventArgs(TypedDict):
|
||||||
|
kind: str
|
||||||
|
group: str
|
||||||
|
location: list[int]
|
||||||
|
bounds: Bounds
|
||||||
|
isEdge: bool
|
||||||
|
shiftKey: bool
|
||||||
|
ctrlKey: bool
|
||||||
|
metaKey: bool
|
||||||
|
isTouch: bool
|
||||||
|
localEventX: int
|
||||||
|
localEventY: int
|
||||||
|
button: int
|
||||||
|
buttons: int
|
||||||
|
scrollEdge: list[int]
|
||||||
|
|
||||||
|
class GridCell(TypedDict):
|
||||||
|
span: Optional[List[int]]
|
||||||
|
|
||||||
|
class GridColumn(TypedDict):
|
||||||
|
title: str
|
||||||
|
group: Optional[str]
|
||||||
|
|
||||||
class DataEditor(NoSSRComponent):
|
class DataEditor(NoSSRComponent):
|
||||||
def add_imports(self) -> ImportDict: ...
|
def add_imports(self) -> ImportDict: ...
|
||||||
def add_hooks(self) -> list[str]: ...
|
def add_hooks(self) -> list[str]: ...
|
||||||
@ -135,87 +185,41 @@ class DataEditor(NoSSRComponent):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_cell_activated: Optional[
|
on_cell_activated: Optional[EventType[tuple[int, int]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_cell_clicked: Optional[EventType[tuple[int, int]]] = None,
|
||||||
] = None,
|
on_cell_context_menu: Optional[EventType[tuple[int, int]]] = None,
|
||||||
on_cell_clicked: Optional[
|
on_cell_edited: Optional[EventType] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_column_resize: Optional[EventType[GridColumn, int]] = None,
|
||||||
on_cell_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_delete: Optional[EventType[GridSelection]] = None,
|
||||||
] = None,
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
on_cell_edited: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_column_resize: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_context_menu: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_delete: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_double_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_finished_editing: Optional[
|
on_finished_editing: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
EventType[Union[GridCell, None], list[int]]
|
||||||
] = None,
|
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_group_header_clicked: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
|
on_group_header_clicked: Optional[EventType] = None,
|
||||||
on_group_header_context_menu: Optional[
|
on_group_header_context_menu: Optional[
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
EventType[int, GroupHeaderClickedEventArgs]
|
||||||
] = None,
|
|
||||||
on_group_header_renamed: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_header_clicked: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_header_context_menu: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_header_menu_click: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_item_hovered: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_mouse_down: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_enter: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_row_appended: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_selection_cleared: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
] = None,
|
||||||
|
on_group_header_renamed: Optional[EventType[str, str]] = None,
|
||||||
|
on_header_clicked: Optional[EventType[tuple[int, int]]] = None,
|
||||||
|
on_header_context_menu: Optional[EventType[tuple[int, int]]] = None,
|
||||||
|
on_header_menu_click: Optional[EventType[int, Rectangle]] = None,
|
||||||
|
on_item_hovered: Optional[EventType[tuple[int, int]]] = None,
|
||||||
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
|
on_row_appended: Optional[EventType[[]]] = None,
|
||||||
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
|
on_selection_cleared: Optional[EventType[[]]] = None,
|
||||||
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "DataEditor":
|
) -> "DataEditor":
|
||||||
"""Create the DataEditor component.
|
"""Create the DataEditor component.
|
||||||
|
@ -12,31 +12,33 @@ def logo(**props):
|
|||||||
Returns:
|
Returns:
|
||||||
The logo component.
|
The logo component.
|
||||||
"""
|
"""
|
||||||
light_mode_logo = """<svg width="56" height="12" viewBox="0 0 56 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M0 11.6V0.400024H8.96V4.88002H6.72V2.64002H2.24V4.88002H6.72V7.12002H2.24V11.6H0ZM6.72 11.6V7.12002H8.96V11.6H6.72Z" fill="#110F1F"/>
|
|
||||||
<path d="M11.2 11.6V0.400024H17.92V2.64002H13.44V4.88002H17.92V7.12002H13.44V9.36002H17.92V11.6H11.2Z" fill="#110F1F"/>
|
|
||||||
<path d="M20.16 11.6V0.400024H26.88V2.64002H22.4V4.88002H26.88V7.12002H22.4V11.6H20.16Z" fill="#110F1F"/>
|
|
||||||
<path d="M29.12 11.6V0.400024H31.36V9.36002H35.84V11.6H29.12Z" fill="#110F1F"/>
|
|
||||||
<path d="M38.08 11.6V0.400024H44.8V2.64002H40.32V4.88002H44.8V7.12002H40.32V9.36002H44.8V11.6H38.08Z" fill="#110F1F"/>
|
|
||||||
<path d="M47.04 4.88002V0.400024H49.28V4.88002H47.04ZM53.76 4.88002V0.400024H56V4.88002H53.76ZM49.28 7.12002V4.88002H53.76V7.12002H49.28ZM47.04 11.6V7.12002H49.28V11.6H47.04ZM53.76 11.6V7.12002H56V11.6H53.76Z" fill="#110F1F"/>
|
|
||||||
</svg>"""
|
|
||||||
|
|
||||||
dark_mode_logo = """<svg width="56" height="12" viewBox="0 0 56 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
def logo_path(d):
|
||||||
<path d="M0 11.5999V0.399902H8.96V4.8799H6.72V2.6399H2.24V4.8799H6.72V7.1199H2.24V11.5999H0ZM6.72 11.5999V7.1199H8.96V11.5999H6.72Z" fill="white"/>
|
return rx.el.svg.path(
|
||||||
<path d="M11.2 11.5999V0.399902H17.92V2.6399H13.44V4.8799H17.92V7.1199H13.44V9.3599H17.92V11.5999H11.2Z" fill="white"/>
|
d=d,
|
||||||
<path d="M20.16 11.5999V0.399902H26.88V2.6399H22.4V4.8799H26.88V7.1199H22.4V11.5999H20.16Z" fill="white"/>
|
fill=rx.color_mode_cond("#110F1F", "white"),
|
||||||
<path d="M29.12 11.5999V0.399902H31.36V9.3599H35.84V11.5999H29.12Z" fill="white"/>
|
)
|
||||||
<path d="M38.08 11.5999V0.399902H44.8V2.6399H40.32V4.8799H44.8V7.1199H40.32V9.3599H44.8V11.5999H38.08Z" fill="white"/>
|
|
||||||
<path d="M47.04 4.8799V0.399902H49.28V4.8799H47.04ZM53.76 4.8799V0.399902H56V4.8799H53.76ZM49.28 7.1199V4.8799H53.76V7.1199H49.28ZM47.04 11.5999V7.1199H49.28V11.5999H47.04ZM53.76 11.5999V7.1199H56V11.5999H53.76Z" fill="white"/>
|
paths = [
|
||||||
</svg>"""
|
"M0 11.5999V0.399902H8.96V4.8799H6.72V2.6399H2.24V4.8799H6.72V7.1199H2.24V11.5999H0ZM6.72 11.5999V7.1199H8.96V11.5999H6.72Z",
|
||||||
|
"M11.2 11.5999V0.399902H17.92V2.6399H13.44V4.8799H17.92V7.1199H13.44V9.3599H17.92V11.5999H11.2Z",
|
||||||
|
"M20.16 11.5999V0.399902H26.88V2.6399H22.4V4.8799H26.88V7.1199H22.4V11.5999H20.16Z",
|
||||||
|
"M29.12 11.5999V0.399902H31.36V9.3599H35.84V11.5999H29.12Z",
|
||||||
|
"M38.08 11.5999V0.399902H44.8V2.6399H40.32V4.8799H44.8V7.1199H40.32V9.3599H44.8V11.5999H38.08Z",
|
||||||
|
"M47.04 4.8799V0.399902H49.28V4.8799H47.04ZM53.76 4.8799V0.399902H56V4.8799H53.76ZM49.28 7.1199V4.8799H53.76V7.1199H49.28ZM47.04 11.5999V7.1199H49.28V11.5999H47.04ZM53.76 11.5999V7.1199H56V11.5999H53.76Z",
|
||||||
|
]
|
||||||
|
|
||||||
return rx.center(
|
return rx.center(
|
||||||
rx.link(
|
rx.link(
|
||||||
rx.hstack(
|
rx.hstack(
|
||||||
"Built with ",
|
"Built with ",
|
||||||
rx.color_mode_cond(
|
rx.el.svg(
|
||||||
rx.html(light_mode_logo),
|
*[logo_path(d) for d in paths],
|
||||||
rx.html(dark_mode_logo),
|
width="56",
|
||||||
|
height="12",
|
||||||
|
viewBox="0 0 56 12",
|
||||||
|
fill="none",
|
||||||
|
xmlns="http://www.w3.org/2000/svg",
|
||||||
),
|
),
|
||||||
text_align="center",
|
text_align="center",
|
||||||
align="center",
|
align="center",
|
||||||
|
186
reflex/components/dynamic.py
Normal file
186
reflex/components/dynamic.py
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
"""Components that are dynamically generated on the backend."""
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING, Union
|
||||||
|
|
||||||
|
from reflex import constants
|
||||||
|
from reflex.utils import imports
|
||||||
|
from reflex.utils.exceptions import DynamicComponentMissingLibrary
|
||||||
|
from reflex.utils.format import format_library_name
|
||||||
|
from reflex.utils.serializers import serializer
|
||||||
|
from reflex.vars import Var, get_unique_variable_name
|
||||||
|
from reflex.vars.base import VarData, transform
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from reflex.components.component import Component
|
||||||
|
|
||||||
|
|
||||||
|
def get_cdn_url(lib: str) -> str:
|
||||||
|
"""Get the CDN URL for a library.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
lib: The library to get the CDN URL for.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The CDN URL for the library.
|
||||||
|
"""
|
||||||
|
return f"https://cdn.jsdelivr.net/npm/{lib}" + "/+esm"
|
||||||
|
|
||||||
|
|
||||||
|
bundled_libraries = {"react", "@radix-ui/themes", "@emotion/react", "next/link"}
|
||||||
|
|
||||||
|
|
||||||
|
def bundle_library(component: Union["Component", str]):
|
||||||
|
"""Bundle a library with the component.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
component: The component to bundle the library with.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
DynamicComponentMissingLibrary: Raised when a dynamic component is missing a library.
|
||||||
|
"""
|
||||||
|
if isinstance(component, str):
|
||||||
|
bundled_libraries.add(component)
|
||||||
|
return
|
||||||
|
if component.library is None:
|
||||||
|
raise DynamicComponentMissingLibrary("Component must have a library to bundle.")
|
||||||
|
bundled_libraries.add(format_library_name(component.library))
|
||||||
|
|
||||||
|
|
||||||
|
def load_dynamic_serializer():
|
||||||
|
"""Load the serializer for dynamic components."""
|
||||||
|
# Causes a circular import, so we import here.
|
||||||
|
from reflex.components.component import Component
|
||||||
|
|
||||||
|
@serializer
|
||||||
|
def make_component(component: Component) -> str:
|
||||||
|
"""Generate the code for a dynamic component.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
component: The component to generate code for.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The generated code
|
||||||
|
"""
|
||||||
|
# Causes a circular import, so we import here.
|
||||||
|
from reflex.compiler import templates, utils
|
||||||
|
|
||||||
|
rendered_components = {}
|
||||||
|
# Include dynamic imports in the shared component.
|
||||||
|
if dynamic_imports := component._get_all_dynamic_imports():
|
||||||
|
rendered_components.update(
|
||||||
|
{dynamic_import: None for dynamic_import in dynamic_imports}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Include custom code in the shared component.
|
||||||
|
rendered_components.update(
|
||||||
|
{code: None for code in component._get_all_custom_code()},
|
||||||
|
)
|
||||||
|
|
||||||
|
rendered_components[
|
||||||
|
templates.STATEFUL_COMPONENT.render(
|
||||||
|
tag_name="MySSRComponent",
|
||||||
|
memo_trigger_hooks=[],
|
||||||
|
component=component,
|
||||||
|
)
|
||||||
|
] = None
|
||||||
|
|
||||||
|
libs_in_window = bundled_libraries
|
||||||
|
|
||||||
|
imports = {}
|
||||||
|
for lib, names in component._get_all_imports().items():
|
||||||
|
formatted_lib_name = format_library_name(lib)
|
||||||
|
if (
|
||||||
|
not lib.startswith((".", "/"))
|
||||||
|
and not lib.startswith("http")
|
||||||
|
and formatted_lib_name not in libs_in_window
|
||||||
|
):
|
||||||
|
imports[get_cdn_url(lib)] = names
|
||||||
|
else:
|
||||||
|
imports[lib] = names
|
||||||
|
|
||||||
|
module_code_lines = templates.STATEFUL_COMPONENTS.render(
|
||||||
|
imports=utils.compile_imports(imports),
|
||||||
|
memoized_code="\n".join(rendered_components),
|
||||||
|
).splitlines()[1:]
|
||||||
|
|
||||||
|
# Rewrite imports from `/` to destructure from window
|
||||||
|
for ix, line in enumerate(module_code_lines[:]):
|
||||||
|
if line.startswith("import "):
|
||||||
|
if 'from "/' in line:
|
||||||
|
module_code_lines[ix] = (
|
||||||
|
line.replace("import ", "const ", 1).replace(
|
||||||
|
" from ", " = window['__reflex'][", 1
|
||||||
|
)
|
||||||
|
+ "]"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
for lib in libs_in_window:
|
||||||
|
if f'from "{lib}"' in line:
|
||||||
|
module_code_lines[ix] = (
|
||||||
|
line.replace("import ", "const ", 1)
|
||||||
|
.replace(
|
||||||
|
f' from "{lib}"', f" = window.__reflex['{lib}']", 1
|
||||||
|
)
|
||||||
|
.replace(" as ", ": ")
|
||||||
|
)
|
||||||
|
if line.startswith("export function"):
|
||||||
|
module_code_lines[ix] = line.replace(
|
||||||
|
"export function", "export default function", 1
|
||||||
|
)
|
||||||
|
|
||||||
|
module_code_lines.insert(0, "const React = window.__reflex.react;")
|
||||||
|
|
||||||
|
return "\n".join(
|
||||||
|
[
|
||||||
|
"//__reflex_evaluate",
|
||||||
|
"/** @jsx jsx */",
|
||||||
|
"const { jsx } = window.__reflex['@emotion/react']",
|
||||||
|
*module_code_lines,
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
@transform
|
||||||
|
def evaluate_component(js_string: Var[str]) -> Var[Component]:
|
||||||
|
"""Evaluate a component.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
js_string: The JavaScript string to evaluate.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The evaluated JavaScript string.
|
||||||
|
"""
|
||||||
|
unique_var_name = get_unique_variable_name()
|
||||||
|
|
||||||
|
return js_string._replace(
|
||||||
|
_js_expr=unique_var_name,
|
||||||
|
_var_type=Component,
|
||||||
|
merge_var_data=VarData.merge(
|
||||||
|
VarData(
|
||||||
|
imports={
|
||||||
|
f"/{constants.Dirs.STATE_PATH}": [
|
||||||
|
imports.ImportVar(tag="evalReactComponent"),
|
||||||
|
],
|
||||||
|
"react": [
|
||||||
|
imports.ImportVar(tag="useState"),
|
||||||
|
imports.ImportVar(tag="useEffect"),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
hooks={
|
||||||
|
f"const [{unique_var_name}, set_{unique_var_name}] = useState(null);": None,
|
||||||
|
"useEffect(() => {"
|
||||||
|
"let isMounted = true;"
|
||||||
|
f"evalReactComponent({str(js_string)})"
|
||||||
|
".then((component) => {"
|
||||||
|
"if (isMounted) {"
|
||||||
|
f"set_{unique_var_name}(component);"
|
||||||
|
"}"
|
||||||
|
"});"
|
||||||
|
"return () => {"
|
||||||
|
"isMounted = false;"
|
||||||
|
"};"
|
||||||
|
"}"
|
||||||
|
f", [{str(js_string)}]);": None,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
@ -3,6 +3,7 @@
|
|||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
|
|
||||||
|
from . import elements as elements
|
||||||
from .elements.forms import Button as Button
|
from .elements.forms import Button as Button
|
||||||
from .elements.forms import Fieldset as Fieldset
|
from .elements.forms import Fieldset as Fieldset
|
||||||
from .elements.forms import Form as Form
|
from .elements.forms import Form as Form
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -22,41 +22,21 @@ class Element(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Element":
|
) -> "Element":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -46,41 +46,21 @@ class BaseHTML(Element):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "BaseHTML":
|
) -> "BaseHTML":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
@ -3,14 +3,20 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
from typing import Any, Dict, Iterator, Set, Union
|
from typing import Any, Dict, Iterator, Set, Tuple, Union
|
||||||
|
|
||||||
from jinja2 import Environment
|
from jinja2 import Environment
|
||||||
|
|
||||||
from reflex.components.el.element import Element
|
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,
|
||||||
|
input_event,
|
||||||
|
key_event,
|
||||||
|
prevent_default,
|
||||||
|
)
|
||||||
from reflex.utils.imports import ImportDict
|
from reflex.utils.imports import ImportDict
|
||||||
from reflex.vars import VarData
|
from reflex.vars import VarData
|
||||||
from reflex.vars.base import LiteralVar, Var
|
from reflex.vars.base import LiteralVar, Var
|
||||||
@ -96,6 +102,15 @@ class Fieldset(Element):
|
|||||||
name: Var[Union[str, int, bool]]
|
name: Var[Union[str, int, bool]]
|
||||||
|
|
||||||
|
|
||||||
|
def on_submit_event_spec() -> Tuple[Var[Dict[str, Any]]]:
|
||||||
|
"""Event handler spec for the on_submit event.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The event handler spec.
|
||||||
|
"""
|
||||||
|
return (FORM_DATA,)
|
||||||
|
|
||||||
|
|
||||||
class Form(BaseHTML):
|
class Form(BaseHTML):
|
||||||
"""Display the form element."""
|
"""Display the form element."""
|
||||||
|
|
||||||
@ -135,7 +150,7 @@ class Form(BaseHTML):
|
|||||||
handle_submit_unique_name: Var[str]
|
handle_submit_unique_name: Var[str]
|
||||||
|
|
||||||
# Fired when the form is submitted
|
# Fired when the form is submitted
|
||||||
on_submit: EventHandler[lambda e0: [FORM_DATA]]
|
on_submit: EventHandler[on_submit_event_spec]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(cls, *children, **props):
|
def create(cls, *children, **props):
|
||||||
@ -148,6 +163,9 @@ class Form(BaseHTML):
|
|||||||
Returns:
|
Returns:
|
||||||
The form component.
|
The form component.
|
||||||
"""
|
"""
|
||||||
|
if "on_submit" not in props:
|
||||||
|
props["on_submit"] = prevent_default
|
||||||
|
|
||||||
if "handle_submit_unique_name" in props:
|
if "handle_submit_unique_name" in props:
|
||||||
return super().create(*children, **props)
|
return super().create(*children, **props)
|
||||||
|
|
||||||
@ -342,19 +360,19 @@ class Input(BaseHTML):
|
|||||||
value: Var[Union[str, int, float]]
|
value: Var[Union[str, int, float]]
|
||||||
|
|
||||||
# Fired when the input value changes
|
# Fired when the input value changes
|
||||||
on_change: EventHandler[lambda e0: [e0.target.value]]
|
on_change: EventHandler[input_event]
|
||||||
|
|
||||||
# Fired when the input gains focus
|
# Fired when the input gains focus
|
||||||
on_focus: EventHandler[lambda e0: [e0.target.value]]
|
on_focus: EventHandler[input_event]
|
||||||
|
|
||||||
# Fired when the input loses focus
|
# Fired when the input loses focus
|
||||||
on_blur: EventHandler[lambda e0: [e0.target.value]]
|
on_blur: EventHandler[input_event]
|
||||||
|
|
||||||
# Fired when a key is pressed down
|
# Fired when a key is pressed down
|
||||||
on_key_down: EventHandler[lambda e0: [e0.key]]
|
on_key_down: EventHandler[key_event]
|
||||||
|
|
||||||
# Fired when a key is released
|
# Fired when a key is released
|
||||||
on_key_up: EventHandler[lambda e0: [e0.key]]
|
on_key_up: EventHandler[key_event]
|
||||||
|
|
||||||
|
|
||||||
class Label(BaseHTML):
|
class Label(BaseHTML):
|
||||||
@ -493,7 +511,7 @@ class Select(BaseHTML):
|
|||||||
size: Var[Union[str, int, bool]]
|
size: Var[Union[str, int, bool]]
|
||||||
|
|
||||||
# Fired when the select value changes
|
# Fired when the select value changes
|
||||||
on_change: EventHandler[lambda e0: [e0.target.value]]
|
on_change: EventHandler[input_event]
|
||||||
|
|
||||||
|
|
||||||
AUTO_HEIGHT_JS = """
|
AUTO_HEIGHT_JS = """
|
||||||
@ -583,19 +601,19 @@ class Textarea(BaseHTML):
|
|||||||
wrap: Var[Union[str, int, bool]]
|
wrap: Var[Union[str, int, bool]]
|
||||||
|
|
||||||
# Fired when the input value changes
|
# Fired when the input value changes
|
||||||
on_change: EventHandler[lambda e0: [e0.target.value]]
|
on_change: EventHandler[input_event]
|
||||||
|
|
||||||
# Fired when the input gains focus
|
# Fired when the input gains focus
|
||||||
on_focus: EventHandler[lambda e0: [e0.target.value]]
|
on_focus: EventHandler[input_event]
|
||||||
|
|
||||||
# Fired when the input loses focus
|
# Fired when the input loses focus
|
||||||
on_blur: EventHandler[lambda e0: [e0.target.value]]
|
on_blur: EventHandler[input_event]
|
||||||
|
|
||||||
# Fired when a key is pressed down
|
# Fired when a key is pressed down
|
||||||
on_key_down: EventHandler[lambda e0: [e0.key]]
|
on_key_down: EventHandler[key_event]
|
||||||
|
|
||||||
# Fired when a key is released
|
# Fired when a key is released
|
||||||
on_key_up: EventHandler[lambda e0: [e0.key]]
|
on_key_up: EventHandler[key_event]
|
||||||
|
|
||||||
def _exclude_props(self) -> list[str]:
|
def _exclude_props(self) -> list[str]:
|
||||||
return super()._exclude_props() + [
|
return super()._exclude_props() + [
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, Dict, Optional, Tuple, Union, overload
|
||||||
|
|
||||||
from jinja2 import Environment
|
from jinja2 import Environment
|
||||||
|
|
||||||
from reflex.components.el.element import Element
|
from reflex.components.el.element import Element
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventType
|
||||||
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.base import Var
|
from reflex.vars.base import Var
|
||||||
@ -71,41 +71,21 @@ class Button(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Button":
|
) -> "Button":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -188,41 +168,21 @@ class Datalist(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Datalist":
|
) -> "Datalist":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -273,41 +233,21 @@ class Fieldset(Element):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Fieldset":
|
) -> "Fieldset":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -330,6 +270,8 @@ class Fieldset(Element):
|
|||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
|
def on_submit_event_spec() -> Tuple[Var[Dict[str, Any]]]: ...
|
||||||
|
|
||||||
class Form(BaseHTML):
|
class Form(BaseHTML):
|
||||||
@overload
|
@overload
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -381,42 +323,22 @@ class Form(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_submit: Optional[EventType[Dict[str, Any]]] = None,
|
||||||
] = None,
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Form":
|
) -> "Form":
|
||||||
"""Create a form component.
|
"""Create a form component.
|
||||||
@ -541,46 +463,24 @@ class Input(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[str]] = None,
|
||||||
on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_change: Optional[EventType[str]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[str]] = None,
|
||||||
on_double_click: Optional[
|
on_key_down: Optional[EventType[str]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_key_up: Optional[EventType[str]] = None,
|
||||||
] = None,
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
on_key_down: Optional[
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Input":
|
) -> "Input":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -687,41 +587,21 @@ class Label(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Label":
|
) -> "Label":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -795,41 +675,21 @@ class Legend(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Legend":
|
) -> "Legend":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -908,41 +768,21 @@ class Meter(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Meter":
|
) -> "Meter":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1023,41 +863,21 @@ class Optgroup(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Optgroup":
|
) -> "Optgroup":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1135,41 +955,21 @@ class Option(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Option":
|
) -> "Option":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1248,41 +1048,21 @@ class Output(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Output":
|
) -> "Output":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1360,41 +1140,21 @@ class Progress(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Progress":
|
) -> "Progress":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1479,42 +1239,22 @@ class Select(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_change: Optional[EventType[str]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Select":
|
) -> "Select":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1616,46 +1356,24 @@ class Textarea(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[str]] = None,
|
||||||
on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_change: Optional[EventType[str]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[str]] = None,
|
||||||
on_double_click: Optional[
|
on_key_down: Optional[EventType[str]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_key_up: Optional[EventType[str]] = None,
|
||||||
] = None,
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
on_key_down: Optional[
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Textarea":
|
) -> "Textarea":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -317,6 +317,42 @@ class Svg(BaseHTML):
|
|||||||
xmlns: Var[str]
|
xmlns: Var[str]
|
||||||
|
|
||||||
|
|
||||||
|
class Text(BaseHTML):
|
||||||
|
"""The SVG text component."""
|
||||||
|
|
||||||
|
tag = "text"
|
||||||
|
# The x coordinate of the starting point of the text baseline.
|
||||||
|
x: Var[Union[str, int]]
|
||||||
|
# The y coordinate of the starting point of the text baseline.
|
||||||
|
y: Var[Union[str, int]]
|
||||||
|
# Shifts the text position horizontally from a previous text element.
|
||||||
|
dx: Var[Union[str, int]]
|
||||||
|
# Shifts the text position vertically from a previous text element.
|
||||||
|
dy: Var[Union[str, int]]
|
||||||
|
# Rotates orientation of each individual glyph.
|
||||||
|
rotate: Var[Union[str, int]]
|
||||||
|
# How the text is stretched or compressed to fit the width defined by the text_length attribute.
|
||||||
|
length_adjust: Var[str]
|
||||||
|
# A width that the text should be scaled to fit.
|
||||||
|
text_length: Var[Union[str, int]]
|
||||||
|
|
||||||
|
|
||||||
|
class Line(BaseHTML):
|
||||||
|
"""The SVG line component."""
|
||||||
|
|
||||||
|
tag = "line"
|
||||||
|
# The x-axis coordinate of the line starting point.
|
||||||
|
x1: Var[Union[str, int]]
|
||||||
|
# The x-axis coordinate of the the line ending point.
|
||||||
|
x2: Var[Union[str, int]]
|
||||||
|
# The y-axis coordinate of the line starting point.
|
||||||
|
y1: Var[Union[str, int]]
|
||||||
|
# The y-axis coordinate of the the line ending point.
|
||||||
|
y2: Var[Union[str, int]]
|
||||||
|
# The total path length, in user units.
|
||||||
|
path_length: Var[int]
|
||||||
|
|
||||||
|
|
||||||
class Circle(BaseHTML):
|
class Circle(BaseHTML):
|
||||||
"""The SVG circle component."""
|
"""The SVG circle component."""
|
||||||
|
|
||||||
@ -331,6 +367,22 @@ class Circle(BaseHTML):
|
|||||||
path_length: Var[int]
|
path_length: Var[int]
|
||||||
|
|
||||||
|
|
||||||
|
class Ellipse(BaseHTML):
|
||||||
|
"""The SVG ellipse component."""
|
||||||
|
|
||||||
|
tag = "ellipse"
|
||||||
|
# The x position of the center of the ellipse.
|
||||||
|
cx: Var[Union[str, int]]
|
||||||
|
# The y position of the center of the ellipse.
|
||||||
|
cy: Var[Union[str, int]]
|
||||||
|
# The radius of the ellipse on the x axis.
|
||||||
|
rx: Var[Union[str, int]]
|
||||||
|
# The radius of the ellipse on the y axis.
|
||||||
|
ry: Var[Union[str, int]]
|
||||||
|
# The total length for the ellipse's circumference, in user units.
|
||||||
|
path_length: Var[int]
|
||||||
|
|
||||||
|
|
||||||
class Rect(BaseHTML):
|
class Rect(BaseHTML):
|
||||||
"""The SVG rect component."""
|
"""The SVG rect component."""
|
||||||
|
|
||||||
@ -394,6 +446,39 @@ class LinearGradient(BaseHTML):
|
|||||||
y2: Var[Union[str, int, bool]]
|
y2: Var[Union[str, int, bool]]
|
||||||
|
|
||||||
|
|
||||||
|
class RadialGradient(BaseHTML):
|
||||||
|
"""Display the radialGradient element."""
|
||||||
|
|
||||||
|
tag = "radialGradient"
|
||||||
|
|
||||||
|
# The x coordinate of the end circle of the radial gradient.
|
||||||
|
cx: Var[Union[str, int, bool]]
|
||||||
|
|
||||||
|
# The y coordinate of the end circle of the radial gradient.
|
||||||
|
cy: Var[Union[str, int, bool]]
|
||||||
|
|
||||||
|
# The radius of the start circle of the radial gradient.
|
||||||
|
fr: Var[Union[str, int, bool]]
|
||||||
|
|
||||||
|
# The x coordinate of the start circle of the radial gradient.
|
||||||
|
fx: Var[Union[str, int, bool]]
|
||||||
|
|
||||||
|
# The y coordinate of the start circle of the radial gradient.
|
||||||
|
fy: Var[Union[str, int, bool]]
|
||||||
|
|
||||||
|
# Units for the gradient.
|
||||||
|
gradient_units: Var[Union[str, bool]]
|
||||||
|
|
||||||
|
# Transform applied to the gradient.
|
||||||
|
gradient_transform: Var[Union[str, bool]]
|
||||||
|
|
||||||
|
# The radius of the end circle of the radial gradient.
|
||||||
|
r: Var[Union[str, int, bool]]
|
||||||
|
|
||||||
|
# Method used to spread the gradient.
|
||||||
|
spread_method: Var[Union[str, bool]]
|
||||||
|
|
||||||
|
|
||||||
class Stop(BaseHTML):
|
class Stop(BaseHTML):
|
||||||
"""Display the stop element."""
|
"""Display the stop element."""
|
||||||
|
|
||||||
@ -421,12 +506,16 @@ class Path(BaseHTML):
|
|||||||
class SVG(ComponentNamespace):
|
class SVG(ComponentNamespace):
|
||||||
"""SVG component namespace."""
|
"""SVG component namespace."""
|
||||||
|
|
||||||
|
text = staticmethod(Text.create)
|
||||||
|
line = staticmethod(Line.create)
|
||||||
circle = staticmethod(Circle.create)
|
circle = staticmethod(Circle.create)
|
||||||
|
ellipse = staticmethod(Ellipse.create)
|
||||||
rect = staticmethod(Rect.create)
|
rect = staticmethod(Rect.create)
|
||||||
polygon = staticmethod(Polygon.create)
|
polygon = staticmethod(Polygon.create)
|
||||||
path = staticmethod(Path.create)
|
path = staticmethod(Path.create)
|
||||||
stop = staticmethod(Stop.create)
|
stop = staticmethod(Stop.create)
|
||||||
linear_gradient = staticmethod(LinearGradient.create)
|
linear_gradient = staticmethod(LinearGradient.create)
|
||||||
|
radial_gradient = staticmethod(RadialGradient.create)
|
||||||
defs = staticmethod(Defs.create)
|
defs = staticmethod(Defs.create)
|
||||||
__call__ = staticmethod(Svg.create)
|
__call__ = staticmethod(Svg.create)
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -50,41 +50,21 @@ class Base(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Base":
|
) -> "Base":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -156,41 +136,21 @@ class Head(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Head":
|
) -> "Head":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -275,41 +235,21 @@ class Link(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Link":
|
) -> "Link":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -394,41 +334,21 @@ class Meta(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Meta":
|
) -> "Meta":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -480,41 +400,21 @@ class Title(Element):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Title":
|
) -> "Title":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -547,41 +447,21 @@ class StyleEl(Element):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "StyleEl":
|
) -> "StyleEl":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, Dict, Optional, Union, overload
|
||||||
|
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -48,41 +48,21 @@ class Details(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Details":
|
) -> "Details":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -156,41 +136,21 @@ class Dialog(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Dialog":
|
) -> "Dialog":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -263,41 +223,21 @@ class Summary(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Summary":
|
) -> "Summary":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -369,41 +309,21 @@ class Slot(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Slot":
|
) -> "Slot":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -475,41 +395,21 @@ class Template(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Template":
|
) -> "Template":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -581,41 +481,21 @@ class Math(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Math":
|
) -> "Math":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -688,41 +568,21 @@ class Html(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Html":
|
) -> "Html":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, Dict, Optional, Union, overload
|
||||||
|
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -47,41 +47,21 @@ class Canvas(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Canvas":
|
) -> "Canvas":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -153,41 +133,21 @@ class Noscript(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Noscript":
|
) -> "Noscript":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -272,41 +232,21 @@ class Script(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Script":
|
) -> "Script":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, Dict, Optional, Union, overload
|
||||||
|
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -47,41 +47,21 @@ class Body(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Body":
|
) -> "Body":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -153,41 +133,21 @@ class Address(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Address":
|
) -> "Address":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -259,41 +219,21 @@ class Article(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Article":
|
) -> "Article":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -365,41 +305,21 @@ class Aside(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Aside":
|
) -> "Aside":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -471,41 +391,21 @@ class Footer(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Footer":
|
) -> "Footer":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -577,41 +477,21 @@ class Header(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Header":
|
) -> "Header":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -683,41 +563,21 @@ class H1(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "H1":
|
) -> "H1":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -789,41 +649,21 @@ class H2(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "H2":
|
) -> "H2":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -895,41 +735,21 @@ class H3(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "H3":
|
) -> "H3":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1001,41 +821,21 @@ class H4(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "H4":
|
) -> "H4":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1107,41 +907,21 @@ class H5(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "H5":
|
) -> "H5":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1213,41 +993,21 @@ class H6(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "H6":
|
) -> "H6":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1319,41 +1079,21 @@ class Main(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Main":
|
) -> "Main":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1425,41 +1165,21 @@ class Nav(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Nav":
|
) -> "Nav":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1531,41 +1251,21 @@ class Section(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Section":
|
) -> "Section":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, Dict, Optional, Union, overload
|
||||||
|
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -48,41 +48,21 @@ class Caption(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Caption":
|
) -> "Caption":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -157,41 +137,21 @@ class Col(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Col":
|
) -> "Col":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -267,41 +227,21 @@ class Colgroup(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Colgroup":
|
) -> "Colgroup":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -377,41 +317,21 @@ class Table(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Table":
|
) -> "Table":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -486,41 +406,21 @@ class Tbody(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Tbody":
|
) -> "Tbody":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -597,41 +497,21 @@ class Td(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Td":
|
) -> "Td":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -708,41 +588,21 @@ class Tfoot(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Tfoot":
|
) -> "Tfoot":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -820,41 +680,21 @@ class Th(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Th":
|
) -> "Th":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -932,41 +772,21 @@ class Thead(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Thead":
|
) -> "Thead":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1040,41 +860,21 @@ class Tr(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Tr":
|
) -> "Tr":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, Dict, Optional, Union, overload
|
||||||
|
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -48,41 +48,21 @@ class Blockquote(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Blockquote":
|
) -> "Blockquote":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -155,41 +135,21 @@ class Dd(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Dd":
|
) -> "Dd":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -261,41 +221,21 @@ class Div(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Div":
|
) -> "Div":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -367,41 +307,21 @@ class Dl(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Dl":
|
) -> "Dl":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -473,41 +393,21 @@ class Dt(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Dt":
|
) -> "Dt":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -579,41 +479,21 @@ class Figcaption(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Figcaption":
|
) -> "Figcaption":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -686,41 +566,21 @@ class Hr(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Hr":
|
) -> "Hr":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -793,41 +653,21 @@ class Li(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Li":
|
) -> "Li":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -900,41 +740,21 @@ class Menu(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Menu":
|
) -> "Menu":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1010,41 +830,21 @@ class Ol(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Ol":
|
) -> "Ol":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1119,41 +919,21 @@ class P(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "P":
|
) -> "P":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1225,41 +1005,21 @@ class Pre(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Pre":
|
) -> "Pre":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1331,41 +1091,21 @@ class Ul(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Ul":
|
) -> "Ul":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1439,41 +1179,21 @@ class Ins(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Ins":
|
) -> "Ins":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -1549,41 +1269,21 @@ class Del(BaseHTML):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Del":
|
) -> "Del":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
@ -15,9 +15,9 @@ from reflex.vars.base import LiteralVar, Var, is_computed_var
|
|||||||
class Gridjs(Component):
|
class Gridjs(Component):
|
||||||
"""A component that wraps a nivo bar component."""
|
"""A component that wraps a nivo bar component."""
|
||||||
|
|
||||||
library = "gridjs-react@6.0.1"
|
library = "gridjs-react@6.1.1"
|
||||||
|
|
||||||
lib_dependencies: List[str] = ["gridjs@6.0.6"]
|
lib_dependencies: List[str] = ["gridjs@6.2.0"]
|
||||||
|
|
||||||
|
|
||||||
class DataTable(Gridjs):
|
class DataTable(Gridjs):
|
||||||
@ -124,7 +124,8 @@ class DataTable(Gridjs):
|
|||||||
if types.is_dataframe(type(self.data)):
|
if types.is_dataframe(type(self.data)):
|
||||||
# If given a pandas df break up the data and columns
|
# If given a pandas df break up the data and columns
|
||||||
data = serialize(self.data)
|
data = serialize(self.data)
|
||||||
assert isinstance(data, dict), "Serialized dataframe should be a dict."
|
if not isinstance(data, dict):
|
||||||
|
raise ValueError("Serialized dataframe should be a dict.")
|
||||||
self.columns = LiteralVar.create(data["columns"])
|
self.columns = LiteralVar.create(data["columns"])
|
||||||
self.data = LiteralVar.create(data["data"])
|
self.data = LiteralVar.create(data["data"])
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, List, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
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.base import Var
|
from reflex.vars.base import Var
|
||||||
@ -23,41 +23,21 @@ class Gridjs(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Gridjs":
|
) -> "Gridjs":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -95,41 +75,21 @@ class DataTable(Gridjs):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "DataTable":
|
) -> "DataTable":
|
||||||
"""Create a datatable component.
|
"""Create a datatable component.
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -22,41 +22,21 @@ class LucideIconComponent(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "LucideIconComponent":
|
) -> "LucideIconComponent":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
@ -89,41 +69,21 @@ class Icon(LucideIconComponent):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Icon":
|
) -> "Icon":
|
||||||
"""Initialize the Icon component.
|
"""Initialize the Icon component.
|
||||||
|
@ -95,12 +95,16 @@ class Markdown(Component):
|
|||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
**props: The properties of the component.
|
**props: The properties of the component.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
ValueError: If the children are not valid.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The markdown component.
|
The markdown component.
|
||||||
"""
|
"""
|
||||||
assert (
|
if len(children) != 1 or not types._isinstance(children[0], Union[str, Var]):
|
||||||
len(children) == 1 and types._isinstance(children[0], Union[str, Var])
|
raise ValueError(
|
||||||
), "Markdown component must have exactly one child containing the markdown source."
|
"Markdown component must have exactly one child containing the markdown source."
|
||||||
|
)
|
||||||
|
|
||||||
# Update the base component map with the custom component map.
|
# Update the base component map with the custom component map.
|
||||||
component_map = {**get_base_component_map(), **props.pop("component_map", {})}
|
component_map = {**get_base_component_map(), **props.pop("component_map", {})}
|
||||||
@ -147,7 +151,7 @@ class Markdown(Component):
|
|||||||
Returns:
|
Returns:
|
||||||
The imports for the markdown component.
|
The imports for the markdown component.
|
||||||
"""
|
"""
|
||||||
from reflex.components.datadisplay.code import CodeBlock
|
from reflex.components.datadisplay.code import CodeBlock, Theme
|
||||||
from reflex.components.radix.themes.typography.code import Code
|
from reflex.components.radix.themes.typography.code import Code
|
||||||
|
|
||||||
return [
|
return [
|
||||||
@ -173,8 +177,8 @@ class Markdown(Component):
|
|||||||
component(_MOCK_ARG)._get_all_imports() # type: ignore
|
component(_MOCK_ARG)._get_all_imports() # type: ignore
|
||||||
for component in self.component_map.values()
|
for component in self.component_map.values()
|
||||||
],
|
],
|
||||||
CodeBlock.create(theme="light")._get_imports(), # type: ignore,
|
CodeBlock.create(theme=Theme.light)._get_imports(),
|
||||||
Code.create()._get_imports(), # type: ignore,
|
Code.create()._get_imports(),
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_component(self, tag: str, **props) -> Component:
|
def get_component(self, tag: str, **props) -> Component:
|
||||||
|
@ -7,7 +7,7 @@ from functools import lru_cache
|
|||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
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 EventType
|
||||||
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.base import LiteralVar, Var
|
from reflex.vars.base import LiteralVar, Var
|
||||||
@ -42,41 +42,21 @@ class Markdown(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Markdown":
|
) -> "Markdown":
|
||||||
"""Create a markdown component.
|
"""Create a markdown component.
|
||||||
@ -93,6 +73,9 @@ class Markdown(Component):
|
|||||||
custom_attrs: custom attribute
|
custom_attrs: custom attribute
|
||||||
**props: The properties of the component.
|
**props: The properties of the component.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
ValueError: If the children are not valid.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The markdown component.
|
The markdown component.
|
||||||
"""
|
"""
|
||||||
|
@ -4,7 +4,7 @@ import dataclasses
|
|||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
from reflex.components.component import Component, NoSSRComponent
|
from reflex.components.component import Component, NoSSRComponent
|
||||||
from reflex.event import EventHandler
|
from reflex.event import EventHandler, identity_event
|
||||||
from reflex.utils.imports import ImportDict
|
from reflex.utils.imports import ImportDict
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ class Moment(NoSSRComponent):
|
|||||||
tz: Var[str]
|
tz: Var[str]
|
||||||
|
|
||||||
# Fires when the date changes.
|
# Fires when the date changes.
|
||||||
on_change: EventHandler[lambda date: [date]]
|
on_change: EventHandler[identity_event(str)]
|
||||||
|
|
||||||
def add_imports(self) -> ImportDict:
|
def add_imports(self) -> ImportDict:
|
||||||
"""Add the imports for the Moment component.
|
"""Add the imports for the Moment component.
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
import dataclasses
|
import dataclasses
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, Dict, Optional, Union, overload
|
||||||
|
|
||||||
from reflex.components.component import NoSSRComponent
|
from reflex.components.component import NoSSRComponent
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventType
|
||||||
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.base import Var
|
from reflex.vars.base import Var
|
||||||
@ -57,42 +57,22 @@ class Moment(NoSSRComponent):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_change: Optional[EventType[str]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Moment":
|
) -> "Moment":
|
||||||
"""Create a Moment component.
|
"""Create a Moment component.
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -24,41 +24,21 @@ class NextComponent(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "NextComponent":
|
) -> "NextComponent":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from typing import Any, Literal, Optional, Union
|
from typing import Any, Literal, Optional, Union
|
||||||
|
|
||||||
from reflex.event import EventHandler
|
from reflex.event import EventHandler, empty_event
|
||||||
from reflex.utils import types
|
from reflex.utils import types
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -56,10 +56,10 @@ class Image(NextComponent):
|
|||||||
blurDataURL: Var[str]
|
blurDataURL: Var[str]
|
||||||
|
|
||||||
# Fires when the image has loaded.
|
# Fires when the image has loaded.
|
||||||
on_load: EventHandler[lambda: []]
|
on_load: EventHandler[empty_event]
|
||||||
|
|
||||||
# Fires when the image has an error.
|
# Fires when the image has an error.
|
||||||
on_error: EventHandler[lambda: []]
|
on_error: EventHandler[empty_event]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(
|
def create(
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
||||||
|
|
||||||
from reflex.event import EventHandler, EventSpec
|
from reflex.event import EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -37,43 +37,23 @@ class Image(NextComponent):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_error: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_load: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "Image":
|
) -> "Image":
|
||||||
"""Create an Image component from next/image.
|
"""Create an Image component from next/image.
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
# ------------------- DO NOT EDIT ----------------------
|
# ------------------- DO NOT EDIT ----------------------
|
||||||
# This file was generated by `reflex/utils/pyi_generator.py`!
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
||||||
# ------------------------------------------------------
|
# ------------------------------------------------------
|
||||||
from typing import Any, Callable, Dict, Optional, Union, overload
|
from typing import Any, 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 EventType
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
|
||||||
@ -24,41 +24,21 @@ class NextLink(Component):
|
|||||||
class_name: Optional[Any] = None,
|
class_name: Optional[Any] = None,
|
||||||
autofocus: Optional[bool] = None,
|
autofocus: Optional[bool] = None,
|
||||||
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_blur: Optional[EventType[[]]] = None,
|
||||||
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_click: Optional[EventType[[]]] = None,
|
||||||
on_context_menu: Optional[
|
on_context_menu: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_double_click: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_focus: Optional[EventType[[]]] = None,
|
||||||
on_double_click: Optional[
|
on_mount: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_down: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_enter: Optional[EventType[[]]] = None,
|
||||||
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_leave: Optional[EventType[[]]] = None,
|
||||||
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
on_mouse_move: Optional[EventType[[]]] = None,
|
||||||
on_mouse_down: Optional[
|
on_mouse_out: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_mouse_over: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
on_mouse_up: Optional[EventType[[]]] = None,
|
||||||
on_mouse_enter: Optional[
|
on_scroll: Optional[EventType[[]]] = None,
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
on_unmount: Optional[EventType[[]]] = None,
|
||||||
] = None,
|
|
||||||
on_mouse_leave: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_move: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_out: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_over: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_mouse_up: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
||||||
on_unmount: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, Callable, Var]
|
|
||||||
] = None,
|
|
||||||
**props,
|
**props,
|
||||||
) -> "NextLink":
|
) -> "NextLink":
|
||||||
"""Create the component.
|
"""Create the component.
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user