Merge branch 'main' into lendemor/add_PTH_rule
This commit is contained in:
commit
193b8d8e30
6
.github/workflows/benchmarks.yml
vendored
6
.github/workflows/benchmarks.yml
vendored
@ -80,7 +80,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, macos-latest]
|
||||||
python-version: ['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
|
||||||
@ -92,7 +92,7 @@ jobs:
|
|||||||
python-version: '3.9.18'
|
python-version: '3.9.18'
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
python-version: '3.10.13'
|
python-version: '3.10.13'
|
||||||
- os: macos-12
|
- os: macos-latest
|
||||||
python-version: '3.12.0'
|
python-version: '3.12.0'
|
||||||
include:
|
include:
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
@ -155,7 +155,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, macos-latest]
|
||||||
python-version: ['3.11.5']
|
python-version: ['3.11.5']
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -58,7 +58,7 @@ jobs:
|
|||||||
working-directory: ./reflex-web
|
working-directory: ./reflex-web
|
||||||
run: poetry run uv pip install -r requirements.txt
|
run: poetry run uv pip install -r requirements.txt
|
||||||
- name: Install additional dependencies for DB access
|
- name: Install additional dependencies for DB access
|
||||||
run: poetry run uv pip install psycopg2-binary
|
run: poetry run uv pip install psycopg
|
||||||
- name: Init Website for reflex-web
|
- name: Init Website for reflex-web
|
||||||
working-directory: ./reflex-web
|
working-directory: ./reflex-web
|
||||||
run: poetry run reflex init
|
run: poetry run reflex init
|
||||||
|
@ -22,9 +22,9 @@ jobs:
|
|||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
state_manager: ["redis", "memory"]
|
state_manager: ['redis', 'memory']
|
||||||
|
python-version: ['3.11.5', '3.12.0', '3.13.0']
|
||||||
split_index: [1, 2]
|
split_index: [1, 2]
|
||||||
python-version: ["3.11.5", "3.12.0"]
|
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
services:
|
services:
|
||||||
|
10
.github/workflows/integration_tests.yml
vendored
10
.github/workflows/integration_tests.yml
vendored
@ -43,7 +43,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
# Show OS combos first in GUI
|
# Show OS combos first in GUI
|
||||||
os: [ubuntu-latest, windows-latest]
|
os: [ubuntu-latest, windows-latest]
|
||||||
python-version: ['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', '3.13.0']
|
||||||
exclude:
|
exclude:
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: '3.10.13'
|
python-version: '3.10.13'
|
||||||
@ -73,7 +73,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
poetry run uv pip install -r requirements.txt
|
poetry run uv pip install -r requirements.txt
|
||||||
- name: Install additional dependencies for DB access
|
- name: Install additional dependencies for DB access
|
||||||
run: poetry run uv pip install psycopg2-binary
|
run: poetry run uv pip install psycopg
|
||||||
- name: Check export --backend-only before init for counter example
|
- name: Check export --backend-only before init for counter example
|
||||||
working-directory: ./reflex-examples/counter
|
working-directory: ./reflex-examples/counter
|
||||||
run: |
|
run: |
|
||||||
@ -147,7 +147,7 @@ jobs:
|
|||||||
working-directory: ./reflex-web
|
working-directory: ./reflex-web
|
||||||
run: poetry run uv pip install $(grep -ivE "reflex " requirements.txt)
|
run: poetry run uv pip install $(grep -ivE "reflex " requirements.txt)
|
||||||
- name: Install additional dependencies for DB access
|
- name: Install additional dependencies for DB access
|
||||||
run: poetry run uv pip install psycopg2-binary
|
run: poetry run uv pip install psycopg
|
||||||
- name: Init Website for reflex-web
|
- name: Init Website for reflex-web
|
||||||
working-directory: ./reflex-web
|
working-directory: ./reflex-web
|
||||||
run: poetry run reflex init
|
run: poetry run reflex init
|
||||||
@ -198,7 +198,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ['3.11.5', '3.12.0']
|
python-version: ['3.11.5', '3.12.0']
|
||||||
runs-on: macos-12
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/setup_build_env
|
- uses: ./.github/actions/setup_build_env
|
||||||
@ -216,7 +216,7 @@ jobs:
|
|||||||
working-directory: ./reflex-web
|
working-directory: ./reflex-web
|
||||||
run: poetry run uv pip install -r requirements.txt
|
run: poetry run uv pip install -r requirements.txt
|
||||||
- name: Install additional dependencies for DB access
|
- name: Install additional dependencies for DB access
|
||||||
run: poetry run uv pip install psycopg2-binary
|
run: poetry run uv pip install psycopg
|
||||||
- name: Init Website for reflex-web
|
- name: Init Website for reflex-web
|
||||||
working-directory: ./reflex-web
|
working-directory: ./reflex-web
|
||||||
run: poetry run reflex init
|
run: poetry run reflex init
|
||||||
|
7
.github/workflows/unit_tests.yml
vendored
7
.github/workflows/unit_tests.yml
vendored
@ -28,7 +28,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest]
|
os: [ubuntu-latest, windows-latest]
|
||||||
python-version: ['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', '3.13.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
|
||||||
@ -88,8 +88,9 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ['3.9.18', '3.10.13', '3.11.5', '3.12.0']
|
# Note: py39, py310 versions chosen due to available arm64 darwin builds.
|
||||||
runs-on: macos-12
|
python-version: ['3.9.13', '3.10.11', '3.11.5', '3.12.0', '3.13.0']
|
||||||
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/setup_build_env
|
- uses: ./.github/actions/setup_build_env
|
||||||
|
@ -52,7 +52,7 @@ FROM python:3.13-slim
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN adduser --disabled-password --home /app reflex
|
RUN adduser --disabled-password --home /app reflex
|
||||||
COPY --chown=reflex --from=init /app /app
|
COPY --chown=reflex --from=init /app /app
|
||||||
# Install libpq-dev for psycopg2 (skip if not using postgres).
|
# Install libpq-dev for psycopg (skip if not using postgres).
|
||||||
RUN apt-get update -y && apt-get install -y libpq-dev && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update -y && apt-get install -y libpq-dev && rm -rf /var/lib/apt/lists/*
|
||||||
USER reflex
|
USER reflex
|
||||||
ENV PATH="/app/.venv/bin:$PATH" PYTHONUNBUFFERED=1
|
ENV PATH="/app/.venv/bin:$PATH" PYTHONUNBUFFERED=1
|
||||||
|
@ -39,7 +39,7 @@ FROM python:3.13-slim
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN adduser --disabled-password --home /app reflex
|
RUN adduser --disabled-password --home /app reflex
|
||||||
COPY --chown=reflex --from=init /app /app
|
COPY --chown=reflex --from=init /app /app
|
||||||
# Install libpq-dev for psycopg2 (skip if not using postgres).
|
# Install libpq-dev for psycopg (skip if not using postgres).
|
||||||
RUN apt-get update -y && apt-get install -y libpq-dev && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update -y && apt-get install -y libpq-dev && rm -rf /var/lib/apt/lists/*
|
||||||
USER reflex
|
USER reflex
|
||||||
ENV PATH="/app/.venv/bin:$PATH" PYTHONUNBUFFERED=1
|
ENV PATH="/app/.venv/bin:$PATH" PYTHONUNBUFFERED=1
|
||||||
|
@ -15,7 +15,7 @@ services:
|
|||||||
|
|
||||||
app:
|
app:
|
||||||
environment:
|
environment:
|
||||||
DB_URL: postgresql+psycopg2://postgres:secret@db/postgres
|
DB_URL: postgresql+psycopg://postgres:secret@db/postgres
|
||||||
REDIS_URL: redis://redis:6379
|
REDIS_URL: redis://redis:6379
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
|
16
poetry.lock
generated
16
poetry.lock
generated
@ -1542,18 +1542,18 @@ type = ["mypy (>=1.11.2)"]
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "playwright"
|
name = "playwright"
|
||||||
version = "1.49.0"
|
version = "1.49.1"
|
||||||
description = "A high-level API to automate web browsers"
|
description = "A high-level API to automate web browsers"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.9"
|
python-versions = ">=3.9"
|
||||||
files = [
|
files = [
|
||||||
{file = "playwright-1.49.0-py3-none-macosx_10_13_x86_64.whl", hash = "sha256:704532a2d8ba580ec9e1895bfeafddce2e3d52320d4eb8aa38e80376acc5cbb0"},
|
{file = "playwright-1.49.1-py3-none-macosx_10_13_x86_64.whl", hash = "sha256:1041ffb45a0d0bc44d698d3a5aa3ac4b67c9bd03540da43a0b70616ad52592b8"},
|
||||||
{file = "playwright-1.49.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e453f02c4e5cc2db7e9759c47e7425f32e50ac76c76b7eb17c69eed72f01c4d8"},
|
{file = "playwright-1.49.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:9f38ed3d0c1f4e0a6d1c92e73dd9a61f8855133249d6f0cec28648d38a7137be"},
|
||||||
{file = "playwright-1.49.0-py3-none-macosx_11_0_universal2.whl", hash = "sha256:37ae985309184472946a6eb1a237e5d93c9e58a781fa73b75c8751325002a5d4"},
|
{file = "playwright-1.49.1-py3-none-macosx_11_0_universal2.whl", hash = "sha256:3be48c6d26dc819ca0a26567c1ae36a980a0303dcd4249feb6f59e115aaddfb8"},
|
||||||
{file = "playwright-1.49.0-py3-none-manylinux1_x86_64.whl", hash = "sha256:68d94beffb3c9213e3ceaafa66171affd9a5d9162e0c8a3eed1b1132c2e57598"},
|
{file = "playwright-1.49.1-py3-none-manylinux1_x86_64.whl", hash = "sha256:753ca90ee31b4b03d165cfd36e477309ebf2b4381953f2a982ff612d85b147d2"},
|
||||||
{file = "playwright-1.49.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7f12d2aecdb41fc25a624cb15f3e8391c252ebd81985e3d5c1c261fe93779345"},
|
{file = "playwright-1.49.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cd9bc8dab37aa25198a01f555f0a2e2c3813fe200fef018ac34dfe86b34994b9"},
|
||||||
{file = "playwright-1.49.0-py3-none-win32.whl", hash = "sha256:91103de52d470594ad375b512d7143fa95d6039111ae11a93eb4fe2f2b4a4858"},
|
{file = "playwright-1.49.1-py3-none-win32.whl", hash = "sha256:43b304be67f096058e587dac453ece550eff87b8fbed28de30f4f022cc1745bb"},
|
||||||
{file = "playwright-1.49.0-py3-none-win_amd64.whl", hash = "sha256:34d28a2c2d46403368610be4339898dc9c34eb9f7c578207b4715c49743a072a"},
|
{file = "playwright-1.49.1-py3-none-win_amd64.whl", hash = "sha256:47b23cb346283278f5b4d1e1990bcb6d6302f80c0aa0ca93dd0601a1400191df"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
|
@ -93,7 +93,19 @@ build-backend = "poetry.core.masonry.api"
|
|||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
target-version = "py39"
|
target-version = "py39"
|
||||||
lint.isort.split-on-trailing-comma = false
|
lint.isort.split-on-trailing-comma = false
|
||||||
lint.select = ["B", "D", "E", "F", "I", "SIM", "W", "PTH", "RUF", "FURB"]
|
lint.select = [
|
||||||
|
"B",
|
||||||
|
"D",
|
||||||
|
"E",
|
||||||
|
"F",
|
||||||
|
"I",
|
||||||
|
"SIM",
|
||||||
|
"W",
|
||||||
|
"PTH",
|
||||||
|
"RUF",
|
||||||
|
"FURB",
|
||||||
|
"ERA"
|
||||||
|
]
|
||||||
lint.ignore = ["B008", "D205", "E501", "F403", "SIM115", "RUF006", "RUF012"]
|
lint.ignore = ["B008", "D205", "E501", "F403", "SIM115", "RUF006", "RUF012"]
|
||||||
lint.pydocstyle.convention = "google"
|
lint.pydocstyle.convention = "google"
|
||||||
|
|
||||||
|
@ -40,9 +40,6 @@ let event_processing = false;
|
|||||||
// Array holding pending events to be processed.
|
// Array holding pending events to be processed.
|
||||||
const event_queue = [];
|
const event_queue = [];
|
||||||
|
|
||||||
// Pending upload promises, by id
|
|
||||||
const upload_controllers = {};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a UUID (Used for session tokens).
|
* Generate a UUID (Used for session tokens).
|
||||||
* Taken from: https://stackoverflow.com/questions/105034/how-do-i-create-a-guid-uuid
|
* Taken from: https://stackoverflow.com/questions/105034/how-do-i-create-a-guid-uuid
|
||||||
@ -300,7 +297,7 @@ export const applyEvent = async (event, socket) => {
|
|||||||
if (socket) {
|
if (socket) {
|
||||||
socket.emit(
|
socket.emit(
|
||||||
"event",
|
"event",
|
||||||
JSON.stringify(event, (k, v) => (v === undefined ? null : v))
|
event,
|
||||||
);
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -407,6 +404,8 @@ export const connect = async (
|
|||||||
transports: transports,
|
transports: transports,
|
||||||
autoUnref: false,
|
autoUnref: false,
|
||||||
});
|
});
|
||||||
|
// Ensure undefined fields in events are sent as null instead of removed
|
||||||
|
socket.current.io.encoder.replacer = (k, v) => (v === undefined ? null : v)
|
||||||
|
|
||||||
function checkVisibility() {
|
function checkVisibility() {
|
||||||
if (document.visibilityState === "visible") {
|
if (document.visibilityState === "visible") {
|
||||||
@ -443,8 +442,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", async (message) => {
|
socket.current.on("event", async (update) => {
|
||||||
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]);
|
||||||
}
|
}
|
||||||
@ -456,7 +454,7 @@ export const connect = async (
|
|||||||
});
|
});
|
||||||
socket.current.on("reload", async (event) => {
|
socket.current.on("reload", async (event) => {
|
||||||
event_processing = false;
|
event_processing = false;
|
||||||
queueEvents([...initialEvents(), JSON5.parse(event)], socket);
|
queueEvents([...initialEvents(), event], socket);
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener("visibilitychange", checkVisibility);
|
document.addEventListener("visibilitychange", checkVisibility);
|
||||||
@ -485,7 +483,9 @@ export const uploadFiles = async (
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (upload_controllers[upload_id]) {
|
const upload_ref_name = `__upload_controllers_${upload_id}`
|
||||||
|
|
||||||
|
if (refs[upload_ref_name]) {
|
||||||
console.log("Upload already in progress for ", upload_id);
|
console.log("Upload already in progress for ", upload_id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -497,23 +497,31 @@ export const uploadFiles = async (
|
|||||||
// Whenever called, responseText will contain the entire response so far.
|
// Whenever called, responseText will contain the entire response so far.
|
||||||
const chunks = progressEvent.event.target.responseText.trim().split("\n");
|
const chunks = progressEvent.event.target.responseText.trim().split("\n");
|
||||||
// So only process _new_ chunks beyond resp_idx.
|
// So only process _new_ chunks beyond resp_idx.
|
||||||
chunks.slice(resp_idx).map((chunk) => {
|
chunks.slice(resp_idx).map((chunk_json) => {
|
||||||
event_callbacks.map((f, ix) => {
|
try {
|
||||||
f(chunk)
|
const chunk = JSON5.parse(chunk_json);
|
||||||
.then(() => {
|
event_callbacks.map((f, ix) => {
|
||||||
if (ix === event_callbacks.length - 1) {
|
f(chunk)
|
||||||
// Mark this chunk as processed.
|
.then(() => {
|
||||||
resp_idx += 1;
|
if (ix === event_callbacks.length - 1) {
|
||||||
}
|
// Mark this chunk as processed.
|
||||||
})
|
resp_idx += 1;
|
||||||
.catch((e) => {
|
}
|
||||||
if (progressEvent.progress === 1) {
|
})
|
||||||
// Chunk may be incomplete, so only report errors when full response is available.
|
.catch((e) => {
|
||||||
console.log("Error parsing chunk", chunk, e);
|
if (progressEvent.progress === 1) {
|
||||||
}
|
// Chunk may be incomplete, so only report errors when full response is available.
|
||||||
return;
|
console.log("Error processing chunk", chunk, e);
|
||||||
});
|
}
|
||||||
});
|
return;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
if (progressEvent.progress === 1) {
|
||||||
|
console.log("Error parsing chunk", chunk_json, e);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -537,7 +545,7 @@ export const uploadFiles = async (
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Send the file to the server.
|
// Send the file to the server.
|
||||||
upload_controllers[upload_id] = controller;
|
refs[upload_ref_name] = controller;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return await axios.post(getBackendURL(UPLOADURL), formdata, config);
|
return await axios.post(getBackendURL(UPLOADURL), formdata, config);
|
||||||
@ -557,7 +565,7 @@ export const uploadFiles = async (
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
delete upload_controllers[upload_id];
|
delete refs[upload_ref_name];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -799,7 +807,7 @@ export const useEventLoop = (
|
|||||||
connect(
|
connect(
|
||||||
socket,
|
socket,
|
||||||
dispatch,
|
dispatch,
|
||||||
["websocket", "polling"],
|
["websocket"],
|
||||||
setConnectErrors,
|
setConnectErrors,
|
||||||
client_storage
|
client_storage
|
||||||
);
|
);
|
||||||
|
@ -331,7 +331,7 @@ _MAPPING: dict = {
|
|||||||
"SessionStorage",
|
"SessionStorage",
|
||||||
],
|
],
|
||||||
"middleware": ["middleware", "Middleware"],
|
"middleware": ["middleware", "Middleware"],
|
||||||
"model": ["session", "Model"],
|
"model": ["asession", "session", "Model"],
|
||||||
"state": [
|
"state": [
|
||||||
"var",
|
"var",
|
||||||
"ComponentState",
|
"ComponentState",
|
||||||
|
@ -186,6 +186,7 @@ from .istate.wrappers import get_state as get_state
|
|||||||
from .middleware import Middleware as Middleware
|
from .middleware import Middleware as Middleware
|
||||||
from .middleware import middleware as middleware
|
from .middleware import middleware as middleware
|
||||||
from .model import Model as Model
|
from .model import Model as Model
|
||||||
|
from .model import asession as asession
|
||||||
from .model import session as session
|
from .model import session as session
|
||||||
from .page import page as page
|
from .page import page as page
|
||||||
from .state import ComponentState as ComponentState
|
from .state import ComponentState as ComponentState
|
||||||
|
@ -17,6 +17,7 @@ import sys
|
|||||||
import traceback
|
import traceback
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from types import SimpleNamespace
|
||||||
from typing import (
|
from typing import (
|
||||||
TYPE_CHECKING,
|
TYPE_CHECKING,
|
||||||
Any,
|
Any,
|
||||||
@ -363,6 +364,11 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
max_http_buffer_size=constants.POLLING_MAX_HTTP_BUFFER_SIZE,
|
max_http_buffer_size=constants.POLLING_MAX_HTTP_BUFFER_SIZE,
|
||||||
ping_interval=constants.Ping.INTERVAL,
|
ping_interval=constants.Ping.INTERVAL,
|
||||||
ping_timeout=constants.Ping.TIMEOUT,
|
ping_timeout=constants.Ping.TIMEOUT,
|
||||||
|
json=SimpleNamespace(
|
||||||
|
dumps=staticmethod(format.json_dumps),
|
||||||
|
loads=staticmethod(json.loads),
|
||||||
|
),
|
||||||
|
transports=["websocket"],
|
||||||
)
|
)
|
||||||
elif getattr(self.sio, "async_mode", "") != "asgi":
|
elif getattr(self.sio, "async_mode", "") != "asgi":
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
@ -467,7 +473,7 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
|
|
||||||
def add_page(
|
def add_page(
|
||||||
self,
|
self,
|
||||||
component: Component | ComponentCallable,
|
component: Component | ComponentCallable | None = None,
|
||||||
route: str | None = None,
|
route: str | None = None,
|
||||||
title: str | Var | None = None,
|
title: str | Var | None = None,
|
||||||
description: str | Var | None = None,
|
description: str | Var | None = None,
|
||||||
@ -490,17 +496,33 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
meta: The metadata of the page.
|
meta: The metadata of the page.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
ValueError: When the specified route name already exists.
|
PageValueError: When the component is not set for a non-404 page.
|
||||||
|
RouteValueError: When the specified route name already exists.
|
||||||
"""
|
"""
|
||||||
# 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:
|
||||||
if not isinstance(component, Callable):
|
if not isinstance(component, Callable):
|
||||||
raise ValueError("Route must be set if component is not a callable.")
|
raise exceptions.RouteValueError(
|
||||||
|
"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:
|
||||||
route = format.format_route(route, format_case=False)
|
route = format.format_route(route, format_case=False)
|
||||||
|
|
||||||
|
if route == constants.Page404.SLUG:
|
||||||
|
if component is None:
|
||||||
|
component = Default404Page.create()
|
||||||
|
component = wait_for_client_redirect(self._generate_component(component))
|
||||||
|
title = title or constants.Page404.TITLE
|
||||||
|
description = description or constants.Page404.DESCRIPTION
|
||||||
|
image = image or constants.Page404.IMAGE
|
||||||
|
else:
|
||||||
|
if component is None:
|
||||||
|
raise exceptions.PageValueError(
|
||||||
|
"Component must be set for a non-404 page."
|
||||||
|
)
|
||||||
|
|
||||||
# Check if the route given is valid
|
# Check if the route given is valid
|
||||||
verify_route_validity(route)
|
verify_route_validity(route)
|
||||||
|
|
||||||
@ -516,7 +538,7 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
if route == constants.PageNames.INDEX_ROUTE
|
if route == constants.PageNames.INDEX_ROUTE
|
||||||
else f"`{route}`"
|
else f"`{route}`"
|
||||||
)
|
)
|
||||||
raise ValueError(
|
raise exceptions.RouteValueError(
|
||||||
f"Duplicate page route {route_name} already exists. Make sure you do not have two"
|
f"Duplicate page route {route_name} already exists. Make sure you do not have two"
|
||||||
f" pages with the same route"
|
f" pages with the same route"
|
||||||
)
|
)
|
||||||
@ -633,10 +655,14 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
on_load: The event handler(s) that will be called each time the page load.
|
on_load: The event handler(s) that will be called each time the page load.
|
||||||
meta: The metadata of the page.
|
meta: The metadata of the page.
|
||||||
"""
|
"""
|
||||||
if component is None:
|
console.deprecate(
|
||||||
component = Default404Page.create()
|
feature_name="App.add_custom_404_page",
|
||||||
|
reason=f"Use app.add_page(component, route='/{constants.Page404.SLUG}') instead.",
|
||||||
|
deprecation_version="0.6.7",
|
||||||
|
removal_version="0.8.0",
|
||||||
|
)
|
||||||
self.add_page(
|
self.add_page(
|
||||||
component=wait_for_client_redirect(self._generate_component(component)),
|
component=component,
|
||||||
route=constants.Page404.SLUG,
|
route=constants.Page404.SLUG,
|
||||||
title=title or constants.Page404.TITLE,
|
title=title or constants.Page404.TITLE,
|
||||||
image=image or constants.Page404.IMAGE,
|
image=image or constants.Page404.IMAGE,
|
||||||
@ -837,7 +863,7 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
|
|
||||||
# Render a default 404 page if the user didn't supply one
|
# Render a default 404 page if the user didn't supply one
|
||||||
if constants.Page404.SLUG not in self.unevaluated_pages:
|
if constants.Page404.SLUG not in self.unevaluated_pages:
|
||||||
self.add_custom_404_page()
|
self.add_page(route=constants.Page404.SLUG)
|
||||||
|
|
||||||
# Fix up the style.
|
# Fix up the style.
|
||||||
self.style = evaluate_style_namespaces(self.style)
|
self.style = evaluate_style_namespaces(self.style)
|
||||||
@ -947,12 +973,12 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
is not None
|
is not None
|
||||||
):
|
):
|
||||||
executor = concurrent.futures.ProcessPoolExecutor(
|
executor = concurrent.futures.ProcessPoolExecutor(
|
||||||
max_workers=number_of_processes,
|
max_workers=number_of_processes or None,
|
||||||
mp_context=multiprocessing.get_context("fork"),
|
mp_context=multiprocessing.get_context("fork"),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
executor = concurrent.futures.ThreadPoolExecutor(
|
executor = concurrent.futures.ThreadPoolExecutor(
|
||||||
max_workers=environment.REFLEX_COMPILE_THREADS.get()
|
max_workers=environment.REFLEX_COMPILE_THREADS.get() or None
|
||||||
)
|
)
|
||||||
|
|
||||||
for route, component in zip(self.pages, page_components):
|
for route, component in zip(self.pages, page_components):
|
||||||
@ -965,7 +991,6 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
|
|
||||||
def _submit_work(fn, *args, **kwargs):
|
def _submit_work(fn, *args, **kwargs):
|
||||||
f = executor.submit(fn, *args, **kwargs)
|
f = executor.submit(fn, *args, **kwargs)
|
||||||
# f = executor.apipe(fn, *args, **kwargs)
|
|
||||||
result_futures.append(f)
|
result_futures.append(f)
|
||||||
|
|
||||||
# Compile the pre-compiled pages.
|
# Compile the pre-compiled pages.
|
||||||
@ -1157,7 +1182,7 @@ class App(MiddlewareMixin, LifespanMixin):
|
|||||||
if hasattr(handler_fn, "__name__"):
|
if hasattr(handler_fn, "__name__"):
|
||||||
_fn_name = handler_fn.__name__
|
_fn_name = handler_fn.__name__
|
||||||
else:
|
else:
|
||||||
_fn_name = handler_fn.__class__.__name__
|
_fn_name = type(handler_fn).__name__
|
||||||
|
|
||||||
if isinstance(handler_fn, functools.partial):
|
if isinstance(handler_fn, functools.partial):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
@ -1270,7 +1295,7 @@ async def process(
|
|||||||
await asyncio.create_task(
|
await asyncio.create_task(
|
||||||
app.event_namespace.emit(
|
app.event_namespace.emit(
|
||||||
"reload",
|
"reload",
|
||||||
data=format.json_dumps(event),
|
data=event,
|
||||||
to=sid,
|
to=sid,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -1523,7 +1548,7 @@ class EventNamespace(AsyncNamespace):
|
|||||||
"""
|
"""
|
||||||
# Creating a task prevents the update from being blocked behind other coroutines.
|
# Creating a task prevents the update from being blocked behind other coroutines.
|
||||||
await asyncio.create_task(
|
await asyncio.create_task(
|
||||||
self.emit(str(constants.SocketEvent.EVENT), update.json(), to=sid)
|
self.emit(str(constants.SocketEvent.EVENT), update, to=sid)
|
||||||
)
|
)
|
||||||
|
|
||||||
async def on_event(self, sid, data):
|
async def on_event(self, sid, data):
|
||||||
@ -1536,7 +1561,7 @@ class EventNamespace(AsyncNamespace):
|
|||||||
sid: The Socket.IO session id.
|
sid: The Socket.IO session id.
|
||||||
data: The event data.
|
data: The event data.
|
||||||
"""
|
"""
|
||||||
fields = json.loads(data)
|
fields = data
|
||||||
# Get the event.
|
# Get the event.
|
||||||
event = Event(
|
event = Event(
|
||||||
**{k: v for k, v in fields.items() if k not in ("handler", "event_actions")}
|
**{k: v for k, v in fields.items() if k not in ("handler", "event_actions")}
|
||||||
|
@ -5,7 +5,7 @@ from pathlib import Path
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from reflex import constants
|
from reflex import constants
|
||||||
from reflex.utils.exec import is_backend_only
|
from reflex.config import EnvironmentVariables
|
||||||
|
|
||||||
|
|
||||||
def asset(
|
def asset(
|
||||||
@ -52,7 +52,7 @@ def asset(
|
|||||||
The relative URL to the asset.
|
The relative URL to the asset.
|
||||||
"""
|
"""
|
||||||
assets = constants.Dirs.APP_ASSETS
|
assets = constants.Dirs.APP_ASSETS
|
||||||
backend_only = is_backend_only()
|
backend_only = EnvironmentVariables.REFLEX_BACKEND_ONLY.get()
|
||||||
|
|
||||||
# Local asset handling
|
# Local asset handling
|
||||||
if not shared:
|
if not shared:
|
||||||
|
@ -161,7 +161,7 @@ class ComponentNamespace(SimpleNamespace):
|
|||||||
Returns:
|
Returns:
|
||||||
The hash of the namespace.
|
The hash of the namespace.
|
||||||
"""
|
"""
|
||||||
return hash(self.__class__.__name__)
|
return hash(type(self).__name__)
|
||||||
|
|
||||||
|
|
||||||
def evaluate_style_namespaces(style: ComponentStyle) -> dict:
|
def evaluate_style_namespaces(style: ComponentStyle) -> dict:
|
||||||
@ -653,7 +653,6 @@ class Component(BaseComponent, ABC):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The event triggers.
|
The event triggers.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
default_triggers: Dict[str, types.ArgsSpec | Sequence[types.ArgsSpec]] = {
|
default_triggers: Dict[str, types.ArgsSpec | Sequence[types.ArgsSpec]] = {
|
||||||
EventTriggers.ON_FOCUS: no_args_event_spec,
|
EventTriggers.ON_FOCUS: no_args_event_spec,
|
||||||
@ -2565,7 +2564,7 @@ class LiteralComponentVar(CachedVarOperation, LiteralVar, ComponentVar):
|
|||||||
Returns:
|
Returns:
|
||||||
The hash of the var.
|
The hash of the var.
|
||||||
"""
|
"""
|
||||||
return hash((self.__class__.__name__, self._js_expr))
|
return hash((type(self).__name__, self._js_expr))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(
|
def create(
|
||||||
|
@ -321,7 +321,7 @@ class ConnectionPulser(Div):
|
|||||||
"""Create a connection pulser component.
|
"""Create a connection pulser component.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -24,7 +24,7 @@ class ClientSideRouting(Component):
|
|||||||
library = "$/utils/client_side_routing"
|
library = "$/utils/client_side_routing"
|
||||||
tag = "useClientSideRouting"
|
tag = "useClientSideRouting"
|
||||||
|
|
||||||
def add_hooks(self) -> list[str]:
|
def add_hooks(self) -> list[str | Var]:
|
||||||
"""Get the hooks to render.
|
"""Get the hooks to render.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@ -66,4 +66,4 @@ class Default404Page(Component):
|
|||||||
tag = "Error"
|
tag = "Error"
|
||||||
is_default = True
|
is_default = True
|
||||||
|
|
||||||
status_code: Var[int] = 404 # type: ignore
|
status_code: Var[int] = Var.create(404)
|
||||||
|
@ -13,7 +13,7 @@ from reflex.vars.base import Var
|
|||||||
route_not_found: Var
|
route_not_found: Var
|
||||||
|
|
||||||
class ClientSideRouting(Component):
|
class ClientSideRouting(Component):
|
||||||
def add_hooks(self) -> list[str]: ...
|
def add_hooks(self) -> list[str | Var]: ...
|
||||||
def render(self) -> str: ...
|
def render(self) -> str: ...
|
||||||
@overload
|
@overload
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -49,9 +49,9 @@ class Cond(MemoizationLeaf):
|
|||||||
The conditional component.
|
The conditional component.
|
||||||
"""
|
"""
|
||||||
# Wrap everything in fragments.
|
# Wrap everything in fragments.
|
||||||
if comp1.__class__.__name__ != "Fragment":
|
if type(comp1).__name__ != "Fragment":
|
||||||
comp1 = Fragment.create(comp1)
|
comp1 = Fragment.create(comp1)
|
||||||
if comp2 is None or comp2.__class__.__name__ != "Fragment":
|
if comp2 is None or type(comp2).__name__ != "Fragment":
|
||||||
comp2 = Fragment.create(comp2) if comp2 else Fragment.create()
|
comp2 = Fragment.create(comp2) if comp2 else Fragment.create()
|
||||||
return Fragment.create(
|
return Fragment.create(
|
||||||
cls(
|
cls(
|
||||||
|
@ -71,7 +71,7 @@ class Html(Div):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
dangerouslySetInnerHTML: The HTML to render.
|
dangerouslySetInnerHTML: The HTML to render.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -29,7 +29,7 @@ from reflex.event import (
|
|||||||
from reflex.utils import format
|
from reflex.utils import format
|
||||||
from reflex.utils.imports import ImportVar
|
from reflex.utils.imports import ImportVar
|
||||||
from reflex.vars import VarData
|
from reflex.vars import VarData
|
||||||
from reflex.vars.base import CallableVar, LiteralVar, Var, get_unique_variable_name
|
from reflex.vars.base import CallableVar, Var, get_unique_variable_name
|
||||||
from reflex.vars.sequence import LiteralStringVar
|
from reflex.vars.sequence import LiteralStringVar
|
||||||
|
|
||||||
DEFAULT_UPLOAD_ID: str = "default"
|
DEFAULT_UPLOAD_ID: str = "default"
|
||||||
@ -108,7 +108,8 @@ def clear_selected_files(id_: str = DEFAULT_UPLOAD_ID) -> EventSpec:
|
|||||||
# UploadFilesProvider assigns a special function to clear selected files
|
# UploadFilesProvider assigns a special function to clear selected files
|
||||||
# into the shared global refs object to make it accessible outside a React
|
# into the shared global refs object to make it accessible outside a React
|
||||||
# component via `run_script` (otherwise backend could never clear files).
|
# component via `run_script` (otherwise backend could never clear files).
|
||||||
return run_script(f"refs['__clear_selected_files']({id_!r})")
|
func = Var("__clear_selected_files")._as_ref()
|
||||||
|
return run_script(f"{func}({id_!r})")
|
||||||
|
|
||||||
|
|
||||||
def cancel_upload(upload_id: str) -> EventSpec:
|
def cancel_upload(upload_id: str) -> EventSpec:
|
||||||
@ -120,7 +121,8 @@ def cancel_upload(upload_id: str) -> EventSpec:
|
|||||||
Returns:
|
Returns:
|
||||||
An event spec that cancels the upload when triggered.
|
An event spec that cancels the upload when triggered.
|
||||||
"""
|
"""
|
||||||
return run_script(f"upload_controllers[{LiteralVar.create(upload_id)!s}]?.abort()")
|
controller = Var(f"__upload_controllers_{upload_id}")._as_ref()
|
||||||
|
return run_script(f"{controller}?.abort()")
|
||||||
|
|
||||||
|
|
||||||
def get_upload_dir() -> Path:
|
def get_upload_dir() -> Path:
|
||||||
|
@ -51,27 +51,6 @@ class GridColumnIcons(Enum):
|
|||||||
VideoUri = "video_uri"
|
VideoUri = "video_uri"
|
||||||
|
|
||||||
|
|
||||||
# @serializer
|
|
||||||
# def serialize_gridcolumn_icon(icon: GridColumnIcons) -> str:
|
|
||||||
# """Serialize grid column icon.
|
|
||||||
|
|
||||||
# Args:
|
|
||||||
# icon: the Icon to serialize.
|
|
||||||
|
|
||||||
# Returns:
|
|
||||||
# The serialized value.
|
|
||||||
# """
|
|
||||||
# return "prefix" + str(icon)
|
|
||||||
|
|
||||||
|
|
||||||
# class DataEditorColumn(Base):
|
|
||||||
# """Column."""
|
|
||||||
|
|
||||||
# title: str
|
|
||||||
# id: Optional[str] = None
|
|
||||||
# type_: str = "str"
|
|
||||||
|
|
||||||
|
|
||||||
class DataEditorTheme(Base):
|
class DataEditorTheme(Base):
|
||||||
"""The theme for the DataEditor component."""
|
"""The theme for the DataEditor component."""
|
||||||
|
|
||||||
@ -229,7 +208,7 @@ class DataEditor(NoSSRComponent):
|
|||||||
header_height: Var[int]
|
header_height: Var[int]
|
||||||
|
|
||||||
# Additional header icons:
|
# Additional header icons:
|
||||||
# header_icons: Var[Any] # (TODO: must be a map of name: svg)
|
# header_icons: Var[Any] # (TODO: must be a map of name: svg) #noqa: ERA001
|
||||||
|
|
||||||
# The maximum width a column can be automatically sized to.
|
# The maximum width a column can be automatically sized to.
|
||||||
max_column_auto_width: Var[int]
|
max_column_auto_width: Var[int]
|
||||||
|
@ -288,7 +288,7 @@ class DataEditor(NoSSRComponent):
|
|||||||
freeze_columns: The number of columns which should remain in place when scrolling horizontally. Doesn't include rowMarkers.
|
freeze_columns: The number of columns which should remain in place when scrolling horizontally. Doesn't include rowMarkers.
|
||||||
group_header_height: Controls the header of the group header row.
|
group_header_height: Controls the header of the group header row.
|
||||||
header_height: Controls the height of the header row.
|
header_height: Controls the height of the header row.
|
||||||
max_column_auto_width: Additional header icons: header_icons: Var[Any] # (TODO: must be a map of name: svg) The maximum width a column can be automatically sized to.
|
max_column_auto_width: The maximum width a column can be automatically sized to.
|
||||||
max_column_width: The maximum width a column can be resized to.
|
max_column_width: The maximum width a column can be resized to.
|
||||||
min_column_width: The minimum width a column can be resized to.
|
min_column_width: The minimum width a column can be resized to.
|
||||||
row_height: Determins the height of each row.
|
row_height: Determins the height of each row.
|
||||||
|
@ -490,17 +490,17 @@ class ShikiJsTransformer(ShikiBaseTransformers):
|
|||||||
},
|
},
|
||||||
# White Space
|
# White Space
|
||||||
# ".tab, .space": {
|
# ".tab, .space": {
|
||||||
# "position": "relative",
|
# "position": "relative", # noqa: ERA001
|
||||||
# },
|
# },
|
||||||
# ".tab::before": {
|
# ".tab::before": {
|
||||||
# "content": "'⇥'",
|
# "content": "'⇥'", # noqa: ERA001
|
||||||
# "position": "absolute",
|
# "position": "absolute", # noqa: ERA001
|
||||||
# "opacity": "0.3",
|
# "opacity": "0.3",# noqa: ERA001
|
||||||
# },
|
# },
|
||||||
# ".space::before": {
|
# ".space::before": {
|
||||||
# "content": "'·'",
|
# "content": "'·'", # noqa: ERA001
|
||||||
# "position": "absolute",
|
# "position": "absolute", # noqa: ERA001
|
||||||
# "opacity": "0.3",
|
# "opacity": "0.3", # noqa: ERA001
|
||||||
# },
|
# },
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Base classes."""
|
||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
@ -9,7 +9,7 @@ from reflex.vars.base import Var
|
|||||||
class BaseHTML(Element):
|
class BaseHTML(Element):
|
||||||
"""Base class for common attributes."""
|
"""Base class for common attributes."""
|
||||||
|
|
||||||
# Provides a hint for generating a keyboard shortcut for the current element.
|
# Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
access_key: Var[Union[str, int, bool]]
|
access_key: Var[Union[str, int, bool]]
|
||||||
|
|
||||||
# Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
# Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
|
@ -67,7 +67,7 @@ class BaseHTML(Element):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Forms classes."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
@ -18,6 +18,7 @@ from reflex.event import (
|
|||||||
prevent_default,
|
prevent_default,
|
||||||
)
|
)
|
||||||
from reflex.utils.imports import ImportDict
|
from reflex.utils.imports import ImportDict
|
||||||
|
from reflex.utils.types import is_optional
|
||||||
from reflex.vars import VarData
|
from reflex.vars import VarData
|
||||||
from reflex.vars.base import LiteralVar, Var
|
from reflex.vars.base import LiteralVar, Var
|
||||||
|
|
||||||
@ -84,7 +85,6 @@ class Datalist(BaseHTML):
|
|||||||
"""Display the datalist element."""
|
"""Display the datalist element."""
|
||||||
|
|
||||||
tag = "datalist"
|
tag = "datalist"
|
||||||
# No unique attributes, only common ones are inherited
|
|
||||||
|
|
||||||
|
|
||||||
class Fieldset(Element):
|
class Fieldset(Element):
|
||||||
@ -250,7 +250,6 @@ class Form(BaseHTML):
|
|||||||
_js_expr=f"getRefValue({ref_var!s})",
|
_js_expr=f"getRefValue({ref_var!s})",
|
||||||
_var_data=VarData.merge(ref_var._get_all_var_data()),
|
_var_data=VarData.merge(ref_var._get_all_var_data()),
|
||||||
)
|
)
|
||||||
# print(repr(form_refs))
|
|
||||||
return form_refs
|
return form_refs
|
||||||
|
|
||||||
def _get_vars(self, include_children: bool = True) -> Iterator[Var]:
|
def _get_vars(self, include_children: bool = True) -> Iterator[Var]:
|
||||||
@ -384,6 +383,33 @@ class Input(BaseHTML):
|
|||||||
# Fired when a key is released
|
# Fired when a key is released
|
||||||
on_key_up: EventHandler[key_event]
|
on_key_up: EventHandler[key_event]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def create(cls, *children, **props):
|
||||||
|
"""Create an Input component.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
*children: The children of the component.
|
||||||
|
**props: The properties of the component.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The component.
|
||||||
|
"""
|
||||||
|
from reflex.vars.number import ternary_operation
|
||||||
|
|
||||||
|
value = props.get("value")
|
||||||
|
|
||||||
|
# React expects an empty string(instead of null) for controlled inputs.
|
||||||
|
if value is not None and is_optional(
|
||||||
|
(value_var := Var.create(value))._var_type
|
||||||
|
):
|
||||||
|
props["value"] = ternary_operation(
|
||||||
|
(value_var != Var.create(None)) # pyright: ignore [reportGeneralTypeIssues]
|
||||||
|
& (value_var != Var(_js_expr="undefined")),
|
||||||
|
value,
|
||||||
|
Var.create(""),
|
||||||
|
)
|
||||||
|
return super().create(*children, **props)
|
||||||
|
|
||||||
|
|
||||||
class Label(BaseHTML):
|
class Label(BaseHTML):
|
||||||
"""Display the label element."""
|
"""Display the label element."""
|
||||||
@ -401,7 +427,6 @@ class Legend(BaseHTML):
|
|||||||
"""Display the legend element."""
|
"""Display the legend element."""
|
||||||
|
|
||||||
tag = "legend"
|
tag = "legend"
|
||||||
# No unique attributes, only common ones are inherited
|
|
||||||
|
|
||||||
|
|
||||||
class Meter(BaseHTML):
|
class Meter(BaseHTML):
|
||||||
|
@ -103,7 +103,7 @@ class Button(BaseHTML):
|
|||||||
name: Name of the button, used when sending form data
|
name: Name of the button, used when sending form data
|
||||||
type: Type of the button (submit, reset, or button)
|
type: Type of the button (submit, reset, or button)
|
||||||
value: Value of the button, used when sending form data
|
value: Value of the button, used when sending form data
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -189,7 +189,7 @@ class Datalist(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: No unique attributes, only common ones are inherited Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -367,7 +367,7 @@ class Form(BaseHTML):
|
|||||||
reset_on_submit: If true, the form will be cleared after submit.
|
reset_on_submit: If true, the form will be cleared after submit.
|
||||||
handle_submit_unique_name: The name used to make this form's submit handler function unique.
|
handle_submit_unique_name: The name used to make this form's submit handler function unique.
|
||||||
on_submit: Fired when the form is submitted
|
on_submit: Fired when the form is submitted
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -512,7 +512,7 @@ class Input(BaseHTML):
|
|||||||
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
||||||
**props,
|
**props,
|
||||||
) -> "Input":
|
) -> "Input":
|
||||||
"""Create the component.
|
"""Create an Input component.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
@ -554,7 +554,7 @@ class Input(BaseHTML):
|
|||||||
on_blur: Fired when the input loses focus
|
on_blur: Fired when the input loses focus
|
||||||
on_key_down: Fired when a key is pressed down
|
on_key_down: Fired when a key is pressed down
|
||||||
on_key_up: Fired when a key is released
|
on_key_up: Fired when a key is released
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -576,7 +576,7 @@ class Input(BaseHTML):
|
|||||||
class_name: The class name for the component.
|
class_name: The class name for the component.
|
||||||
autofocus: Whether the component should take the focus once the page is loaded
|
autofocus: Whether the component should take the focus once the page is loaded
|
||||||
custom_attrs: custom attribute
|
custom_attrs: custom attribute
|
||||||
**props: The props of the component.
|
**props: The properties of the component.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The component.
|
The component.
|
||||||
@ -644,7 +644,7 @@ class Label(BaseHTML):
|
|||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
html_for: ID of a form control with which the label is associated
|
html_for: ID of a form control with which the label is associated
|
||||||
form: Associates the label with a form (by id)
|
form: Associates the label with a form (by id)
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -730,7 +730,7 @@ class Legend(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: No unique attributes, only common ones are inherited Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -830,7 +830,7 @@ class Meter(BaseHTML):
|
|||||||
min: Minimum value of the range
|
min: Minimum value of the range
|
||||||
optimum: Optimum value in the range
|
optimum: Optimum value in the range
|
||||||
value: Current value of the meter
|
value: Current value of the meter
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -920,7 +920,7 @@ class Optgroup(BaseHTML):
|
|||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
disabled: Disables the optgroup
|
disabled: Disables the optgroup
|
||||||
label: Label for the optgroup
|
label: Label for the optgroup
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1014,7 +1014,7 @@ class Option(BaseHTML):
|
|||||||
label: Label for the option, if the text is not the label
|
label: Label for the option, if the text is not the label
|
||||||
selected: Indicates that the option is initially selected
|
selected: Indicates that the option is initially selected
|
||||||
value: Value to be sent as form data
|
value: Value to be sent as form data
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1106,7 +1106,7 @@ class Output(BaseHTML):
|
|||||||
html_for: Associates the output with one or more elements (by their IDs)
|
html_for: Associates the output with one or more elements (by their IDs)
|
||||||
form: Associates the output with a form (by id)
|
form: Associates the output with a form (by id)
|
||||||
name: Name of the output element for form submission
|
name: Name of the output element for form submission
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1198,7 +1198,7 @@ class Progress(BaseHTML):
|
|||||||
form: Associates the progress element with a form (by id)
|
form: Associates the progress element with a form (by id)
|
||||||
max: Maximum value of the progress indicator
|
max: Maximum value of the progress indicator
|
||||||
value: Current value of the progress indicator
|
value: Current value of the progress indicator
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1306,7 +1306,7 @@ class Select(BaseHTML):
|
|||||||
required: Indicates that the select control must have a selected option
|
required: Indicates that the select control must have a selected option
|
||||||
size: Number of visible options in a drop-down list
|
size: Number of visible options in a drop-down list
|
||||||
on_change: Fired when the select value changes
|
on_change: Fired when the select value changes
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1459,7 +1459,7 @@ class Textarea(BaseHTML):
|
|||||||
on_blur: Fired when the input loses focus
|
on_blur: Fired when the input loses focus
|
||||||
on_key_down: Fired when a key is pressed down
|
on_key_down: Fired when a key is pressed down
|
||||||
on_key_up: Fired when a key is released
|
on_key_up: Fired when a key is released
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Inline classes."""
|
||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ class A(BaseHTML):
|
|||||||
rel: Specifies the relationship between the linked document and the current document
|
rel: Specifies the relationship between the linked document and the current document
|
||||||
shape: Specifies the shape of the area
|
shape: Specifies the shape of the area
|
||||||
target: Specifies where to open the linked document
|
target: Specifies where to open the linked document
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -174,7 +174,7 @@ class Abbr(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -260,7 +260,7 @@ class B(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -346,7 +346,7 @@ class Bdi(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -432,7 +432,7 @@ class Bdo(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -518,7 +518,7 @@ class Br(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -604,7 +604,7 @@ class Cite(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -690,7 +690,7 @@ class Code(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -778,7 +778,7 @@ class Data(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
value: Specifies the machine-readable translation of the data element.
|
value: Specifies the machine-readable translation of the data element.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -864,7 +864,7 @@ class Dfn(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -950,7 +950,7 @@ class Em(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1036,7 +1036,7 @@ class I(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1122,7 +1122,7 @@ class Kbd(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1208,7 +1208,7 @@ class Mark(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1296,7 +1296,7 @@ class Q(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
cite: Specifies the source URL of the quote.
|
cite: Specifies the source URL of the quote.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1382,7 +1382,7 @@ class Rp(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1468,7 +1468,7 @@ class Rt(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1554,7 +1554,7 @@ class Ruby(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1640,7 +1640,7 @@ class S(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1726,7 +1726,7 @@ class Samp(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1812,7 +1812,7 @@ class Small(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1898,7 +1898,7 @@ class Span(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1984,7 +1984,7 @@ class Strong(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -2070,7 +2070,7 @@ class Sub(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -2156,7 +2156,7 @@ class Sup(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -2244,7 +2244,7 @@ class Time(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
date_time: Specifies the date and/or time of the element.
|
date_time: Specifies the date and/or time of the element.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -2330,7 +2330,7 @@ class U(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -2416,7 +2416,7 @@ class Wbr(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Media classes."""
|
||||||
|
|
||||||
from typing import Any, Union
|
from typing import Any, Union
|
||||||
|
|
||||||
@ -129,7 +129,6 @@ class Img(BaseHTML):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The component.
|
The component.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return (
|
return (
|
||||||
super().create(src=children[0], **props)
|
super().create(src=children[0], **props)
|
||||||
@ -274,14 +273,12 @@ class Picture(BaseHTML):
|
|||||||
"""Display the picture element."""
|
"""Display the picture element."""
|
||||||
|
|
||||||
tag = "picture"
|
tag = "picture"
|
||||||
# No unique attributes, only common ones are inherited
|
|
||||||
|
|
||||||
|
|
||||||
class Portal(BaseHTML):
|
class Portal(BaseHTML):
|
||||||
"""Display the portal element."""
|
"""Display the portal element."""
|
||||||
|
|
||||||
tag = "portal"
|
tag = "portal"
|
||||||
# No unique attributes, only common ones are inherited
|
|
||||||
|
|
||||||
|
|
||||||
class Source(BaseHTML):
|
class Source(BaseHTML):
|
||||||
|
@ -94,7 +94,7 @@ class Area(BaseHTML):
|
|||||||
rel: Specifies the relationship of the target object to the link object
|
rel: Specifies the relationship of the target object to the link object
|
||||||
shape: Defines the shape of the area (rectangle, circle, polygon)
|
shape: Defines the shape of the area (rectangle, circle, polygon)
|
||||||
target: Specifies where to open the linked document
|
target: Specifies where to open the linked document
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -198,7 +198,7 @@ class Audio(BaseHTML):
|
|||||||
muted: Indicates whether the audio is muted by default
|
muted: Indicates whether the audio is muted by default
|
||||||
preload: Specifies how the audio file should be preloaded
|
preload: Specifies how the audio file should be preloaded
|
||||||
src: URL of the audio to play
|
src: URL of the audio to play
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -314,7 +314,7 @@ class Img(BaseHTML):
|
|||||||
src: URL of the image to display
|
src: URL of the image to display
|
||||||
src_set: A set of source sizes and URLs for responsive images
|
src_set: A set of source sizes and URLs for responsive images
|
||||||
use_map: The name of the map to use with the image
|
use_map: The name of the map to use with the image
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -340,7 +340,6 @@ class Img(BaseHTML):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The component.
|
The component.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
@ -403,7 +402,7 @@ class Map(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
name: Name of the map, referenced by the 'usemap' attribute in 'img' and 'object' elements
|
name: Name of the map, referenced by the 'usemap' attribute in 'img' and 'object' elements
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -499,7 +498,7 @@ class Track(BaseHTML):
|
|||||||
label: Title of the text track, used by the browser when listing available text tracks
|
label: Title of the text track, used by the browser when listing available text tracks
|
||||||
src: URL of the track file
|
src: URL of the track file
|
||||||
src_lang: Language of the track text data
|
src_lang: Language of the track text data
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -609,7 +608,7 @@ class Video(BaseHTML):
|
|||||||
poster: URL of an image to show while the video is downloading, or until the user hits the play button
|
poster: URL of an image to show while the video is downloading, or until the user hits the play button
|
||||||
preload: Specifies how the video file should be preloaded
|
preload: Specifies how the video file should be preloaded
|
||||||
src: URL of the video to play
|
src: URL of the video to play
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -699,7 +698,7 @@ class Embed(BaseHTML):
|
|||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
src: URL of the embedded content
|
src: URL of the embedded content
|
||||||
type: Media type of the embedded content
|
type: Media type of the embedded content
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -805,7 +804,7 @@ class Iframe(BaseHTML):
|
|||||||
sandbox: Security restrictions for the content in the iframe
|
sandbox: Security restrictions for the content in the iframe
|
||||||
src: URL of the document to display in the iframe
|
src: URL of the document to display in the iframe
|
||||||
src_doc: HTML content to embed directly within the iframe
|
src_doc: HTML content to embed directly within the iframe
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -901,7 +900,7 @@ class Object(BaseHTML):
|
|||||||
name: Name of the object, used for scripting or as a target for forms and links
|
name: Name of the object, used for scripting or as a target for forms and links
|
||||||
type: Media type of the data specified in the data attribute
|
type: Media type of the data specified in the data attribute
|
||||||
use_map: Name of an image map to use with the object
|
use_map: Name of an image map to use with the object
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -987,7 +986,7 @@ class Picture(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: No unique attributes, only common ones are inherited Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1073,7 +1072,7 @@ class Portal(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: No unique attributes, only common ones are inherited Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1169,7 +1168,7 @@ class Source(BaseHTML):
|
|||||||
src: URL of the media file or an image for the element to use
|
src: URL of the media file or an image for the element to use
|
||||||
src_set: A set of source sizes and URLs for responsive images
|
src_set: A set of source sizes and URLs for responsive images
|
||||||
type: Media type of the source
|
type: Media type of the source
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1261,7 +1260,7 @@ class Svg(BaseHTML):
|
|||||||
width: The width of the svg.
|
width: The width of the svg.
|
||||||
height: The height of the svg.
|
height: The height of the svg.
|
||||||
xmlns: The XML namespace declaration.
|
xmlns: The XML namespace declaration.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1361,7 +1360,7 @@ class Text(BaseHTML):
|
|||||||
rotate: Rotates orientation of each individual glyph.
|
rotate: Rotates orientation of each individual glyph.
|
||||||
length_adjust: How the text is stretched or compressed to fit the width defined by the text_length attribute.
|
length_adjust: How the text is stretched or compressed to fit the width defined by the text_length attribute.
|
||||||
text_length: A width that the text should be scaled to fit.
|
text_length: A width that the text should be scaled to fit.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1457,7 +1456,7 @@ class Line(BaseHTML):
|
|||||||
y1: The y-axis coordinate of the line starting point.
|
y1: The y-axis coordinate of the line starting point.
|
||||||
y2: The y-axis coordinate of the the line ending point.
|
y2: The y-axis coordinate of the the line ending point.
|
||||||
path_length: The total path length, in user units.
|
path_length: The total path length, in user units.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1551,7 +1550,7 @@ class Circle(BaseHTML):
|
|||||||
cy: The y-axis coordinate of the center of the circle.
|
cy: The y-axis coordinate of the center of the circle.
|
||||||
r: The radius of the circle.
|
r: The radius of the circle.
|
||||||
path_length: The total length for the circle's circumference, in user units.
|
path_length: The total length for the circle's circumference, in user units.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1647,7 +1646,7 @@ class Ellipse(BaseHTML):
|
|||||||
rx: The radius of the ellipse on the x axis.
|
rx: The radius of the ellipse on the x axis.
|
||||||
ry: The radius of the ellipse on the y axis.
|
ry: The radius of the ellipse on the y axis.
|
||||||
path_length: The total length for the ellipse's circumference, in user units.
|
path_length: The total length for the ellipse's circumference, in user units.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1747,7 +1746,7 @@ class Rect(BaseHTML):
|
|||||||
rx: The horizontal corner radius of the rect. Defaults to ry if it is specified.
|
rx: The horizontal corner radius of the rect. Defaults to ry if it is specified.
|
||||||
ry: The vertical corner radius of the rect. Defaults to rx if it is specified.
|
ry: The vertical corner radius of the rect. Defaults to rx if it is specified.
|
||||||
path_length: The total length of the rectangle's perimeter, in user units.
|
path_length: The total length of the rectangle's perimeter, in user units.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1837,7 +1836,7 @@ class Polygon(BaseHTML):
|
|||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
points: defines the list of points (pairs of x,y absolute coordinates) required to draw the polygon.
|
points: defines the list of points (pairs of x,y absolute coordinates) required to draw the polygon.
|
||||||
path_length: This prop lets specify the total length for the path, in user units.
|
path_length: This prop lets specify the total length for the path, in user units.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1923,7 +1922,7 @@ class Defs(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -2023,7 +2022,7 @@ class LinearGradient(BaseHTML):
|
|||||||
x2: X coordinate of the ending point of the gradient.
|
x2: X coordinate of the ending point of the gradient.
|
||||||
y1: Y coordinate of the starting point of the gradient.
|
y1: Y coordinate of the starting point of the gradient.
|
||||||
y2: Y coordinate of the ending point of the gradient.
|
y2: Y coordinate of the ending point of the gradient.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -2127,7 +2126,7 @@ class RadialGradient(BaseHTML):
|
|||||||
gradient_transform: Transform applied to the gradient.
|
gradient_transform: Transform applied to the gradient.
|
||||||
r: The radius of the end circle of the radial gradient.
|
r: The radius of the end circle of the radial gradient.
|
||||||
spread_method: Method used to spread the gradient.
|
spread_method: Method used to spread the gradient.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -2223,7 +2222,7 @@ class Stop(BaseHTML):
|
|||||||
offset: Offset of the gradient stop.
|
offset: Offset of the gradient stop.
|
||||||
stop_color: Color of the gradient stop.
|
stop_color: Color of the gradient stop.
|
||||||
stop_opacity: Opacity of the gradient stop.
|
stop_opacity: Opacity of the gradient stop.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -2311,7 +2310,7 @@ class Path(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
d: Defines the shape of the path.
|
d: Defines the shape of the path.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -2413,7 +2412,7 @@ class SVG(ComponentNamespace):
|
|||||||
width: The width of the svg.
|
width: The width of the svg.
|
||||||
height: The height of the svg.
|
height: The height of the svg.
|
||||||
xmlns: The XML namespace declaration.
|
xmlns: The XML namespace declaration.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Metadata classes."""
|
||||||
|
|
||||||
from typing import List, Union
|
from typing import List, Union
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ class Base(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -157,7 +157,7 @@ class Head(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -265,7 +265,7 @@ class Link(BaseHTML):
|
|||||||
rel: Specifies the relationship between the current document and the linked one
|
rel: Specifies the relationship between the current document and the linked one
|
||||||
sizes: Specifies the sizes of icons for visual media
|
sizes: Specifies the sizes of icons for visual media
|
||||||
type: Specifies the MIME type of the linked document
|
type: Specifies the MIME type of the linked document
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -359,7 +359,7 @@ class Meta(BaseHTML):
|
|||||||
content: Defines the content of the metadata
|
content: Defines the content of the metadata
|
||||||
http_equiv: Provides an HTTP header for the information/value of the content attribute
|
http_equiv: Provides an HTTP header for the information/value of the content attribute
|
||||||
name: Specifies a name for the metadata
|
name: Specifies a name for the metadata
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Other classes."""
|
||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
@ -26,31 +26,39 @@ class Dialog(BaseHTML):
|
|||||||
|
|
||||||
|
|
||||||
class Summary(BaseHTML):
|
class Summary(BaseHTML):
|
||||||
"""Display the summary element."""
|
"""Display the summary element.
|
||||||
|
|
||||||
|
Used as a summary or caption for a <details> element.
|
||||||
|
"""
|
||||||
|
|
||||||
tag = "summary"
|
tag = "summary"
|
||||||
# No unique attributes, only common ones are inherited; used as a summary or caption for a <details> element
|
|
||||||
|
|
||||||
|
|
||||||
class Slot(BaseHTML):
|
class Slot(BaseHTML):
|
||||||
"""Display the slot element."""
|
"""Display the slot element.
|
||||||
|
|
||||||
|
Used as a placeholder inside a web component.
|
||||||
|
"""
|
||||||
|
|
||||||
tag = "slot"
|
tag = "slot"
|
||||||
# No unique attributes, only common ones are inherited; used as a placeholder inside a web component
|
|
||||||
|
|
||||||
|
|
||||||
class Template(BaseHTML):
|
class Template(BaseHTML):
|
||||||
"""Display the template element."""
|
"""Display the template element.
|
||||||
|
|
||||||
|
Used for declaring fragments of HTML that can be cloned and inserted in the document.
|
||||||
|
"""
|
||||||
|
|
||||||
tag = "template"
|
tag = "template"
|
||||||
# No unique attributes, only common ones are inherited; used for declaring fragments of HTML that can be cloned and inserted in the document
|
|
||||||
|
|
||||||
|
|
||||||
class Math(BaseHTML):
|
class Math(BaseHTML):
|
||||||
"""Display the math element."""
|
"""Display the math element.
|
||||||
|
|
||||||
|
Represents a mathematical expression.
|
||||||
|
"""
|
||||||
|
|
||||||
tag = "math"
|
tag = "math"
|
||||||
# No unique attributes, only common ones are inherited; used for displaying mathematical expressions
|
|
||||||
|
|
||||||
|
|
||||||
class Html(BaseHTML):
|
class Html(BaseHTML):
|
||||||
|
@ -70,7 +70,7 @@ class Details(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
open: Indicates whether the details will be visible (expanded) to the user
|
open: Indicates whether the details will be visible (expanded) to the user
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -158,7 +158,7 @@ class Dialog(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
open: Indicates whether the dialog is active and can be interacted with
|
open: Indicates whether the dialog is active and can be interacted with
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -244,7 +244,7 @@ class Summary(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: No unique attributes, only common ones are inherited; used as a summary or caption for a <details> element Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -330,7 +330,7 @@ class Slot(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: No unique attributes, only common ones are inherited; used as a placeholder inside a web component Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -416,7 +416,7 @@ class Template(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: No unique attributes, only common ones are inherited; used for declaring fragments of HTML that can be cloned and inserted in the document Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -502,7 +502,7 @@ class Math(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: No unique attributes, only common ones are inherited; used for displaying mathematical expressions Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -590,7 +590,7 @@ class Html(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
manifest: Specifies the URL of the document's cache manifest (obsolete in HTML5)
|
manifest: Specifies the URL of the document's cache manifest (obsolete in HTML5)
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Scripts classes."""
|
||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
@ -17,7 +17,6 @@ class Noscript(BaseHTML):
|
|||||||
"""Display the noscript element."""
|
"""Display the noscript element."""
|
||||||
|
|
||||||
tag = "noscript"
|
tag = "noscript"
|
||||||
# No unique attributes, only common ones are inherited
|
|
||||||
|
|
||||||
|
|
||||||
class Script(BaseHTML):
|
class Script(BaseHTML):
|
||||||
|
@ -68,7 +68,7 @@ class Canvas(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -154,7 +154,7 @@ class Noscript(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: No unique attributes, only common ones are inherited Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -262,7 +262,7 @@ class Script(BaseHTML):
|
|||||||
referrer_policy: Specifies which referrer information to send when fetching the script
|
referrer_policy: Specifies which referrer information to send when fetching the script
|
||||||
src: URL of an external script
|
src: URL of an external script
|
||||||
type: Specifies the MIME type of the script
|
type: Specifies the MIME type of the script
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Sectioning classes."""
|
||||||
|
|
||||||
from .base import BaseHTML
|
from .base import BaseHTML
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ class Body(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -154,7 +154,7 @@ class Address(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -240,7 +240,7 @@ class Article(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -326,7 +326,7 @@ class Aside(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -412,7 +412,7 @@ class Footer(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -498,7 +498,7 @@ class Header(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -584,7 +584,7 @@ class H1(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -670,7 +670,7 @@ class H2(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -756,7 +756,7 @@ class H3(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -842,7 +842,7 @@ class H4(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -928,7 +928,7 @@ class H5(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1014,7 +1014,7 @@ class H6(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1100,7 +1100,7 @@ class Main(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1186,7 +1186,7 @@ class Nav(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1272,7 +1272,7 @@ class Section(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Tables classes."""
|
||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ class Caption(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
align: Alignment of the caption
|
align: Alignment of the caption
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -160,7 +160,7 @@ class Col(BaseHTML):
|
|||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
align: Alignment of the content within the column
|
align: Alignment of the content within the column
|
||||||
span: Number of columns the col element spans
|
span: Number of columns the col element spans
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -250,7 +250,7 @@ class Colgroup(BaseHTML):
|
|||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
align: Alignment of the content within the column group
|
align: Alignment of the content within the column group
|
||||||
span: Number of columns the colgroup element spans
|
span: Number of columns the colgroup element spans
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -340,7 +340,7 @@ class Table(BaseHTML):
|
|||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
align: Alignment of the table
|
align: Alignment of the table
|
||||||
summary: Provides a summary of the table's purpose and structure
|
summary: Provides a summary of the table's purpose and structure
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -428,7 +428,7 @@ class Tbody(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
align: Alignment of the content within the table body
|
align: Alignment of the content within the table body
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -522,7 +522,7 @@ class Td(BaseHTML):
|
|||||||
col_span: Number of columns a cell should span
|
col_span: Number of columns a cell should span
|
||||||
headers: IDs of the headers associated with this cell
|
headers: IDs of the headers associated with this cell
|
||||||
row_span: Number of rows a cell should span
|
row_span: Number of rows a cell should span
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -610,7 +610,7 @@ class Tfoot(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
align: Alignment of the content within the table footer
|
align: Alignment of the content within the table footer
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -706,7 +706,7 @@ class Th(BaseHTML):
|
|||||||
headers: IDs of the headers associated with this header cell
|
headers: IDs of the headers associated with this header cell
|
||||||
row_span: Number of rows a header cell should span
|
row_span: Number of rows a header cell should span
|
||||||
scope: Scope of the header cell (row, col, rowgroup, colgroup)
|
scope: Scope of the header cell (row, col, rowgroup, colgroup)
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -794,7 +794,7 @@ class Thead(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
align: Alignment of the content within the table header
|
align: Alignment of the content within the table header
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -882,7 +882,7 @@ class Tr(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
align: Alignment of the content within the table row
|
align: Alignment of the content within the table row
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
"""Typography classes."""
|
||||||
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ class Blockquote(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
cite: Define the title of a work.
|
cite: Define the title of a work.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -156,7 +156,7 @@ class Dd(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -242,7 +242,7 @@ class Div(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -328,7 +328,7 @@ class Dl(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -414,7 +414,7 @@ class Dt(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -500,7 +500,7 @@ class Figcaption(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -588,7 +588,7 @@ class Hr(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
align: Used to specify the alignment of text content of The Element. this attribute is used in all elements.
|
align: Used to specify the alignment of text content of The Element. this attribute is used in all elements.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -674,7 +674,7 @@ class Li(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -762,7 +762,7 @@ class Menu(BaseHTML):
|
|||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
type: Specifies that the menu element is a context menu.
|
type: Specifies that the menu element is a context menu.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -854,7 +854,7 @@ class Ol(BaseHTML):
|
|||||||
reversed: Reverses the order of the list.
|
reversed: Reverses the order of the list.
|
||||||
start: Specifies the start value of the first list item in an ordered list.
|
start: Specifies the start value of the first list item in an ordered list.
|
||||||
type: Specifies the kind of marker to use in the list (letters or numbers).
|
type: Specifies the kind of marker to use in the list (letters or numbers).
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -940,7 +940,7 @@ class P(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1026,7 +1026,7 @@ class Pre(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1112,7 +1112,7 @@ class Ul(BaseHTML):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1202,7 +1202,7 @@ class Ins(BaseHTML):
|
|||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
cite: Specifies the URL of the document that explains the reason why the text was inserted/changed.
|
cite: Specifies the URL of the document that explains the reason why the text was inserted/changed.
|
||||||
date_time: Specifies the date and time of when the text was inserted/changed.
|
date_time: Specifies the date and time of when the text was inserted/changed.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1292,7 +1292,7 @@ class Del(BaseHTML):
|
|||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
cite: Specifies the URL of the document that explains the reason why the text was deleted.
|
cite: Specifies the URL of the document that explains the reason why the text was deleted.
|
||||||
date_time: Specifies the date and time of when the text was deleted.
|
date_time: Specifies the date and time of when the text was deleted.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -47,7 +47,7 @@ class Image(NextComponent):
|
|||||||
placeholder: Var[str]
|
placeholder: Var[str]
|
||||||
|
|
||||||
# Allows passing CSS styles to the underlying image element.
|
# Allows passing CSS styles to the underlying image element.
|
||||||
# style: Var[Any]
|
# style: Var[Any] #noqa: ERA001
|
||||||
|
|
||||||
# The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead.
|
# The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead.
|
||||||
loading: Var[Literal["lazy", "eager"]]
|
loading: Var[Literal["lazy", "eager"]]
|
||||||
|
@ -70,7 +70,7 @@ class Image(NextComponent):
|
|||||||
quality: The quality of the optimized image, an integer between 1 and 100, where 100 is the best quality and therefore largest file size. Defaults to 75.
|
quality: The quality of the optimized image, an integer between 1 and 100, where 100 is the best quality and therefore largest file size. Defaults to 75.
|
||||||
priority: When true, the image will be considered high priority and preload. Lazy loading is automatically disabled for images using priority.
|
priority: When true, the image will be considered high priority and preload. Lazy loading is automatically disabled for images using priority.
|
||||||
placeholder: A placeholder to use while the image is loading. Possible values are blur, empty, or data:image/.... Defaults to empty.
|
placeholder: A placeholder to use while the image is loading. Possible values are blur, empty, or data:image/.... Defaults to empty.
|
||||||
loading: Allows passing CSS styles to the underlying image element. style: Var[Any] The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead.
|
loading: The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead.
|
||||||
blurDataURL: A Data URL to be used as a placeholder image before the src image successfully loads. Only takes effect when combined with placeholder="blur".
|
blurDataURL: A Data URL to be used as a placeholder image before the src image successfully loads. Only takes effect when combined with placeholder="blur".
|
||||||
on_load: Fires when the image has loaded.
|
on_load: Fires when the image has loaded.
|
||||||
on_error: Fires when the image has an error.
|
on_error: Fires when the image has an error.
|
||||||
|
@ -160,7 +160,7 @@ class FormRoot(FormComponent, HTMLForm):
|
|||||||
reset_on_submit: If true, the form will be cleared after submit.
|
reset_on_submit: If true, the form will be cleared after submit.
|
||||||
handle_submit_unique_name: The name used to make this form's submit handler function unique.
|
handle_submit_unique_name: The name used to make this form's submit handler function unique.
|
||||||
on_submit: Fired when the form is submitted
|
on_submit: Fired when the form is submitted
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -636,7 +636,7 @@ class Form(FormRoot):
|
|||||||
reset_on_submit: If true, the form will be cleared after submit.
|
reset_on_submit: If true, the form will be cleared after submit.
|
||||||
handle_submit_unique_name: The name used to make this form's submit handler function unique.
|
handle_submit_unique_name: The name used to make this form's submit handler function unique.
|
||||||
on_submit: Fired when the form is submitted
|
on_submit: Fired when the form is submitted
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -769,7 +769,7 @@ class FormNamespace(ComponentNamespace):
|
|||||||
reset_on_submit: If true, the form will be cleared after submit.
|
reset_on_submit: If true, the form will be cleared after submit.
|
||||||
handle_submit_unique_name: The name used to make this form's submit handler function unique.
|
handle_submit_unique_name: The name used to make this form's submit handler function unique.
|
||||||
on_submit: Fired when the form is submitted
|
on_submit: Fired when the form is submitted
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -188,7 +188,7 @@ class Slider(ComponentNamespace):
|
|||||||
else:
|
else:
|
||||||
children = [
|
children = [
|
||||||
track,
|
track,
|
||||||
# Foreach.create(props.get("value"), lambda e: SliderThumb.create()), # foreach doesn't render Thumbs properly
|
# Foreach.create(props.get("value"), lambda e: SliderThumb.create()), # foreach doesn't render Thumbs properly # noqa: ERA001
|
||||||
]
|
]
|
||||||
|
|
||||||
return SliderRoot.create(*children, **props)
|
return SliderRoot.create(*children, **props)
|
||||||
|
@ -53,7 +53,7 @@ LiteralAccentColor = Literal[
|
|||||||
class CommonMarginProps(Component):
|
class CommonMarginProps(Component):
|
||||||
"""Many radix-themes elements accept shorthand margin props."""
|
"""Many radix-themes elements accept shorthand margin props."""
|
||||||
|
|
||||||
# Margin: "0" - "9"
|
# Margin: "0" - "9" # noqa: ERA001
|
||||||
m: Var[LiteralSpacing]
|
m: Var[LiteralSpacing]
|
||||||
|
|
||||||
# Margin horizontal: "0" - "9"
|
# Margin horizontal: "0" - "9"
|
||||||
@ -78,7 +78,7 @@ class CommonMarginProps(Component):
|
|||||||
class CommonPaddingProps(Component):
|
class CommonPaddingProps(Component):
|
||||||
"""Many radix-themes elements accept shorthand padding props."""
|
"""Many radix-themes elements accept shorthand padding props."""
|
||||||
|
|
||||||
# Padding: "0" - "9"
|
# Padding: "0" - "9" # noqa: ERA001
|
||||||
p: Var[Responsive[LiteralSpacing]]
|
p: Var[Responsive[LiteralSpacing]]
|
||||||
|
|
||||||
# Padding horizontal: "0" - "9"
|
# Padding horizontal: "0" - "9"
|
||||||
@ -139,14 +139,7 @@ class RadixThemesComponent(Component):
|
|||||||
component = super().create(*children, **props)
|
component = super().create(*children, **props)
|
||||||
if component.library is None:
|
if component.library is None:
|
||||||
component.library = RadixThemesComponent.__fields__["library"].default
|
component.library = RadixThemesComponent.__fields__["library"].default
|
||||||
component.alias = "RadixThemes" + (
|
component.alias = "RadixThemes" + (component.tag or type(component).__name__)
|
||||||
component.tag or component.__class__.__name__
|
|
||||||
)
|
|
||||||
# value = props.get("value")
|
|
||||||
# if value is not None and component.alias == "RadixThemesSelect.Root":
|
|
||||||
# lv = LiteralVar.create(value)
|
|
||||||
# print(repr(lv))
|
|
||||||
# print(f"Warning: Value {value} is not used in {component.alias}.")
|
|
||||||
return component
|
return component
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -268,6 +261,7 @@ class Theme(RadixThemesComponent):
|
|||||||
_js_expr="{...theme.styles.global[':root'], ...theme.styles.global.body}"
|
_js_expr="{...theme.styles.global[':root'], ...theme.styles.global.body}"
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
tag.remove_props("appearance")
|
||||||
return tag
|
return tag
|
||||||
|
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ class ColorModeIconButton(IconButton):
|
|||||||
name: Name of the button, used when sending form data
|
name: Name of the button, used when sending form data
|
||||||
type: Type of the button (submit, reset, or button)
|
type: Type of the button (submit, reset, or button)
|
||||||
value: Value of the button, used when sending form data
|
value: Value of the button, used when sending form data
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -427,7 +427,7 @@ class ColorModeSwitch(Switch):
|
|||||||
color_scheme: Override theme color for switch
|
color_scheme: Override theme color for switch
|
||||||
high_contrast: Whether to render the switch with higher contrast color against background
|
high_contrast: Whether to render the switch with higher contrast color against background
|
||||||
radius: Override theme radius for switch: "none" | "small" | "full"
|
radius: Override theme radius for switch: "none" | "small" | "full"
|
||||||
on_change: Props to rename Fired when the value of the switch changes
|
on_change: Fired when the value of the switch changes
|
||||||
style: The style of the component.
|
style: The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
id: The id for the component.
|
id: The id for the component.
|
||||||
|
@ -194,7 +194,7 @@ class AlertDialogContent(elements.Div, RadixThemesComponent):
|
|||||||
on_open_auto_focus: Fired when the dialog is opened.
|
on_open_auto_focus: Fired when the dialog is opened.
|
||||||
on_close_auto_focus: Fired when the dialog is closed.
|
on_close_auto_focus: Fired when the dialog is closed.
|
||||||
on_escape_key_down: Fired when the escape key is pressed.
|
on_escape_key_down: Fired when the escape key is pressed.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -164,7 +164,7 @@ class Badge(elements.Span, RadixThemesComponent):
|
|||||||
color_scheme: Color theme of the badge
|
color_scheme: Color theme of the badge
|
||||||
high_contrast: Whether to render the badge with higher contrast color against background
|
high_contrast: Whether to render the badge with higher contrast color against background
|
||||||
radius: Override theme radius for badge: "none" | "small" | "medium" | "large" | "full"
|
radius: Override theme radius for badge: "none" | "small" | "medium" | "large" | "full"
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -196,7 +196,7 @@ class Button(elements.Button, RadixLoadingProp, RadixThemesComponent):
|
|||||||
name: Name of the button, used when sending form data
|
name: Name of the button, used when sending form data
|
||||||
type: Type of the button (submit, reset, or button)
|
type: Type of the button (submit, reset, or button)
|
||||||
value: Value of the button, used when sending form data
|
value: Value of the button, used when sending form data
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -162,7 +162,7 @@ class CalloutRoot(elements.Div, RadixThemesComponent):
|
|||||||
variant: Variant of button: "soft" | "surface" | "outline"
|
variant: Variant of button: "soft" | "surface" | "outline"
|
||||||
color_scheme: Override theme color for button
|
color_scheme: Override theme color for button
|
||||||
high_contrast: Whether to render the button with higher contrast color against background
|
high_contrast: Whether to render the button with higher contrast color against background
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -251,7 +251,7 @@ class CalloutIcon(elements.Div, RadixThemesComponent):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: Child components.
|
*children: Child components.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -340,7 +340,7 @@ class CalloutText(elements.P, RadixThemesComponent):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: Child components.
|
*children: Child components.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -516,7 +516,7 @@ class Callout(CalloutRoot):
|
|||||||
variant: Variant of button: "soft" | "surface" | "outline"
|
variant: Variant of button: "soft" | "surface" | "outline"
|
||||||
color_scheme: Override theme color for button
|
color_scheme: Override theme color for button
|
||||||
high_contrast: Whether to render the button with higher contrast color against background
|
high_contrast: Whether to render the button with higher contrast color against background
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -694,7 +694,7 @@ class CalloutNamespace(ComponentNamespace):
|
|||||||
variant: Variant of button: "soft" | "surface" | "outline"
|
variant: Variant of button: "soft" | "surface" | "outline"
|
||||||
color_scheme: Override theme color for button
|
color_scheme: Override theme color for button
|
||||||
high_contrast: Whether to render the button with higher contrast color against background
|
high_contrast: Whether to render the button with higher contrast color against background
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -95,7 +95,7 @@ class Card(elements.Div, RadixThemesComponent):
|
|||||||
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
|
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
|
||||||
size: Card size: "1" - "5"
|
size: Card size: "1" - "5"
|
||||||
variant: Variant of Card: "solid" | "soft" | "outline" | "ghost"
|
variant: Variant of Card: "solid" | "soft" | "outline" | "ghost"
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -153,7 +153,7 @@ class Checkbox(RadixThemesComponent):
|
|||||||
required: Whether the checkbox is required
|
required: Whether the checkbox is required
|
||||||
name: The name of the checkbox control when submitting the form.
|
name: The name of the checkbox control when submitting the form.
|
||||||
value: The value of the checkbox control when submitting the form.
|
value: The value of the checkbox control when submitting the form.
|
||||||
on_change: Props to rename Fired when the checkbox is checked or unchecked.
|
on_change: Fired when the checkbox is checked or unchecked.
|
||||||
style: The style of the component.
|
style: The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
id: The id for the component.
|
id: The id for the component.
|
||||||
@ -302,7 +302,7 @@ class HighLevelCheckbox(RadixThemesComponent):
|
|||||||
required: Whether the checkbox is required
|
required: Whether the checkbox is required
|
||||||
name: The name of the checkbox control when submitting the form.
|
name: The name of the checkbox control when submitting the form.
|
||||||
value: The value of the checkbox control when submitting the form.
|
value: The value of the checkbox control when submitting the form.
|
||||||
on_change: Props to rename Fired when the checkbox is checked or unchecked.
|
on_change: Fired when the checkbox is checked or unchecked.
|
||||||
style: The style of the component.
|
style: The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
id: The id for the component.
|
id: The id for the component.
|
||||||
@ -449,7 +449,7 @@ class CheckboxNamespace(ComponentNamespace):
|
|||||||
required: Whether the checkbox is required
|
required: Whether the checkbox is required
|
||||||
name: The name of the checkbox control when submitting the form.
|
name: The name of the checkbox control when submitting the form.
|
||||||
value: The value of the checkbox control when submitting the form.
|
value: The value of the checkbox control when submitting the form.
|
||||||
on_change: Props to rename Fired when the checkbox is checked or unchecked.
|
on_change: Fired when the checkbox is checked or unchecked.
|
||||||
style: The style of the component.
|
style: The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
id: The id for the component.
|
id: The id for the component.
|
||||||
|
@ -243,7 +243,7 @@ class DialogContent(elements.Div, RadixThemesComponent):
|
|||||||
on_escape_key_down: Fired when the escape key is pressed.
|
on_escape_key_down: Fired when the escape key is pressed.
|
||||||
on_pointer_down_outside: Fired when the pointer is down outside the dialog.
|
on_pointer_down_outside: Fired when the pointer is down outside the dialog.
|
||||||
on_interact_outside: Fired when the pointer interacts outside the dialog.
|
on_interact_outside: Fired when the pointer interacts outside the dialog.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -228,7 +228,7 @@ class HoverCardContent(elements.Div, RadixThemesComponent):
|
|||||||
sticky: The sticky behavior on the align axis. "partial" will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst "always" will keep the content in the boundary regardless
|
sticky: The sticky behavior on the align axis. "partial" will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst "always" will keep the content in the boundary regardless
|
||||||
hide_when_detached: Whether to hide the content when the trigger becomes fully occluded.
|
hide_when_detached: Whether to hide the content when the trigger becomes fully occluded.
|
||||||
size: Hovercard size "1" - "3"
|
size: Hovercard size "1" - "3"
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -193,7 +193,7 @@ class IconButton(elements.Button, RadixLoadingProp, RadixThemesComponent):
|
|||||||
name: Name of the button, used when sending form data
|
name: Name of the button, used when sending form data
|
||||||
type: Type of the button (submit, reset, or button)
|
type: Type of the button (submit, reset, or button)
|
||||||
value: Value of the button, used when sending form data
|
value: Value of the button, used when sending form data
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -166,7 +166,7 @@ class Inset(elements.Div, RadixThemesComponent):
|
|||||||
pr: Padding on the right
|
pr: Padding on the right
|
||||||
pb: Padding on the bottom
|
pb: Padding on the bottom
|
||||||
pl: Padding on the left
|
pl: Padding on the left
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -233,7 +233,7 @@ class PopoverContent(elements.Div, RadixThemesComponent):
|
|||||||
on_pointer_down_outside: Fired when the pointer is down outside the dialog.
|
on_pointer_down_outside: Fired when the pointer is down outside the dialog.
|
||||||
on_focus_outside: Fired when focus moves outside the dialog.
|
on_focus_outside: Fired when focus moves outside the dialog.
|
||||||
on_interact_outside: Fired when the pointer interacts outside the dialog.
|
on_interact_outside: Fired when the pointer interacts outside the dialog.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -148,7 +148,7 @@ class RadioGroupRoot(RadixThemesComponent):
|
|||||||
disabled: Whether the radio group is disabled
|
disabled: Whether the radio group is disabled
|
||||||
name: The name of the group. Submitted with its owning form as part of a name/value pair.
|
name: The name of the group. Submitted with its owning form as part of a name/value pair.
|
||||||
required: Whether the radio group is required
|
required: Whether the radio group is required
|
||||||
on_change: Props to rename Fired when the value of the radio group changes.
|
on_change: Fired when the value of the radio group changes.
|
||||||
style: The style of the component.
|
style: The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
id: The id for the component.
|
id: The id for the component.
|
||||||
|
@ -81,7 +81,7 @@ class SelectRoot(RadixThemesComponent):
|
|||||||
name: The name of the select control when submitting the form.
|
name: The name of the select control when submitting the form.
|
||||||
disabled: When True, prevents the user from interacting with select.
|
disabled: When True, prevents the user from interacting with select.
|
||||||
required: When True, indicates that the user must select a value before the owning form can be submitted.
|
required: When True, indicates that the user must select a value before the owning form can be submitted.
|
||||||
on_change: Props to rename Fired when the value of the select changes.
|
on_change: Fired when the value of the select changes.
|
||||||
on_open_change: Fired when the select is opened or closed.
|
on_open_change: Fired when the select is opened or closed.
|
||||||
style: The style of the component.
|
style: The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
@ -732,7 +732,7 @@ class HighLevelSelect(SelectRoot):
|
|||||||
name: The name of the select control when submitting the form.
|
name: The name of the select control when submitting the form.
|
||||||
disabled: When True, prevents the user from interacting with select.
|
disabled: When True, prevents the user from interacting with select.
|
||||||
required: When True, indicates that the user must select a value before the owning form can be submitted.
|
required: When True, indicates that the user must select a value before the owning form can be submitted.
|
||||||
on_change: Props to rename Fired when the value of the select changes.
|
on_change: Fired when the value of the select changes.
|
||||||
on_open_change: Fired when the select is opened or closed.
|
on_open_change: Fired when the select is opened or closed.
|
||||||
style: The style of the component.
|
style: The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
@ -912,7 +912,7 @@ class Select(ComponentNamespace):
|
|||||||
name: The name of the select control when submitting the form.
|
name: The name of the select control when submitting the form.
|
||||||
disabled: When True, prevents the user from interacting with select.
|
disabled: When True, prevents the user from interacting with select.
|
||||||
required: When True, indicates that the user must select a value before the owning form can be submitted.
|
required: When True, indicates that the user must select a value before the owning form can be submitted.
|
||||||
on_change: Props to rename Fired when the value of the select changes.
|
on_change: Fired when the value of the select changes.
|
||||||
on_open_change: Fired when the select is opened or closed.
|
on_open_change: Fired when the select is opened or closed.
|
||||||
style: The style of the component.
|
style: The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
|
@ -195,7 +195,7 @@ class Slider(RadixThemesComponent):
|
|||||||
step: The step value of the slider.
|
step: The step value of the slider.
|
||||||
disabled: Whether the slider is disabled
|
disabled: Whether the slider is disabled
|
||||||
orientation: The orientation of the slider.
|
orientation: The orientation of the slider.
|
||||||
on_change: Props to rename Fired when the value of the slider changes.
|
on_change: Fired when the value of the slider changes.
|
||||||
on_value_commit: Fired when a thumb is released after being dragged.
|
on_value_commit: Fired when a thumb is released after being dragged.
|
||||||
style: The style of the component.
|
style: The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
|
@ -157,7 +157,7 @@ class Switch(RadixThemesComponent):
|
|||||||
color_scheme: Override theme color for switch
|
color_scheme: Override theme color for switch
|
||||||
high_contrast: Whether to render the switch with higher contrast color against background
|
high_contrast: Whether to render the switch with higher contrast color against background
|
||||||
radius: Override theme radius for switch: "none" | "small" | "full"
|
radius: Override theme radius for switch: "none" | "small" | "full"
|
||||||
on_change: Props to rename Fired when the value of the switch changes
|
on_change: Fired when the value of the switch changes
|
||||||
style: The style of the component.
|
style: The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
id: The id for the component.
|
id: The id for the component.
|
||||||
|
@ -94,7 +94,7 @@ class TableRoot(elements.Table, RadixThemesComponent):
|
|||||||
variant: The variant of the table
|
variant: The variant of the table
|
||||||
align: Alignment of the table
|
align: Alignment of the table
|
||||||
summary: Provides a summary of the table's purpose and structure
|
summary: Provides a summary of the table's purpose and structure
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -185,7 +185,7 @@ class TableHeader(elements.Thead, RadixThemesComponent):
|
|||||||
Args:
|
Args:
|
||||||
*children: Child components.
|
*children: Child components.
|
||||||
align: Alignment of the content within the table header
|
align: Alignment of the content within the table header
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -281,7 +281,7 @@ class TableRow(elements.Tr, RadixThemesComponent):
|
|||||||
Args:
|
Args:
|
||||||
*children: Child components.
|
*children: Child components.
|
||||||
align: Alignment of the content within the table row
|
align: Alignment of the content within the table row
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -395,7 +395,7 @@ class TableColumnHeaderCell(elements.Th, RadixThemesComponent):
|
|||||||
headers: IDs of the headers associated with this header cell
|
headers: IDs of the headers associated with this header cell
|
||||||
row_span: Number of rows a header cell should span
|
row_span: Number of rows a header cell should span
|
||||||
scope: Scope of the header cell (row, col, rowgroup, colgroup)
|
scope: Scope of the header cell (row, col, rowgroup, colgroup)
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -486,7 +486,7 @@ class TableBody(elements.Tbody, RadixThemesComponent):
|
|||||||
Args:
|
Args:
|
||||||
*children: Child components.
|
*children: Child components.
|
||||||
align: Alignment of the content within the table body
|
align: Alignment of the content within the table body
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -717,7 +717,7 @@ class TableCell(elements.Td, CommonPaddingProps, RadixThemesComponent):
|
|||||||
col_span: Number of columns a cell should span
|
col_span: Number of columns a cell should span
|
||||||
headers: IDs of the headers associated with this cell
|
headers: IDs of the headers associated with this cell
|
||||||
row_span: Number of rows a cell should span
|
row_span: Number of rows a cell should span
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -957,7 +957,7 @@ class TableRowHeaderCell(elements.Th, CommonPaddingProps, RadixThemesComponent):
|
|||||||
headers: IDs of the headers associated with this header cell
|
headers: IDs of the headers associated with this header cell
|
||||||
row_span: Number of rows a header cell should span
|
row_span: Number of rows a header cell should span
|
||||||
scope: Scope of the header cell (row, col, rowgroup, colgroup)
|
scope: Scope of the header cell (row, col, rowgroup, colgroup)
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -72,7 +72,7 @@ class TabsRoot(RadixThemesComponent):
|
|||||||
orientation: The orientation of the tabs.
|
orientation: The orientation of the tabs.
|
||||||
dir: Reading direction of the tabs.
|
dir: Reading direction of the tabs.
|
||||||
activation_mode: The mode of activation for the tabs. "automatic" will activate the tab when focused. "manual" will activate the tab when clicked.
|
activation_mode: The mode of activation for the tabs. "automatic" will activate the tab when focused. "manual" will activate the tab when clicked.
|
||||||
on_change: Props to rename Fired when the value of the tabs changes.
|
on_change: Fired when the value of the tabs changes.
|
||||||
style: The style of the component.
|
style: The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
id: The id for the component.
|
id: The id for the component.
|
||||||
@ -374,7 +374,7 @@ class Tabs(ComponentNamespace):
|
|||||||
orientation: The orientation of the tabs.
|
orientation: The orientation of the tabs.
|
||||||
dir: Reading direction of the tabs.
|
dir: Reading direction of the tabs.
|
||||||
activation_mode: The mode of activation for the tabs. "automatic" will activate the tab when focused. "manual" will activate the tab when clicked.
|
activation_mode: The mode of activation for the tabs. "automatic" will activate the tab when focused. "manual" will activate the tab when clicked.
|
||||||
on_change: Props to rename Fired when the value of the tabs changes.
|
on_change: Fired when the value of the tabs changes.
|
||||||
style: The style of the component.
|
style: The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
id: The id for the component.
|
id: The id for the component.
|
||||||
|
@ -239,7 +239,7 @@ class TextArea(RadixThemesComponent, elements.Textarea):
|
|||||||
on_blur: Fired when the input loses focus
|
on_blur: Fired when the input loses focus
|
||||||
on_key_down: Fired when a key is pressed down
|
on_key_down: Fired when a key is pressed down
|
||||||
on_key_up: Fired when a key is released
|
on_key_up: Fired when a key is released
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -9,7 +9,9 @@ from reflex.components.core.breakpoints import Responsive
|
|||||||
from reflex.components.core.debounce import DebounceInput
|
from reflex.components.core.debounce import DebounceInput
|
||||||
from reflex.components.el import elements
|
from reflex.components.el import elements
|
||||||
from reflex.event import EventHandler, input_event, key_event
|
from reflex.event import EventHandler, input_event, key_event
|
||||||
|
from reflex.utils.types import is_optional
|
||||||
from reflex.vars.base import Var
|
from reflex.vars.base import Var
|
||||||
|
from reflex.vars.number import ternary_operation
|
||||||
|
|
||||||
from ..base import LiteralAccentColor, LiteralRadius, RadixThemesComponent
|
from ..base import LiteralAccentColor, LiteralRadius, RadixThemesComponent
|
||||||
|
|
||||||
@ -96,6 +98,19 @@ class TextFieldRoot(elements.Div, RadixThemesComponent):
|
|||||||
Returns:
|
Returns:
|
||||||
The component.
|
The component.
|
||||||
"""
|
"""
|
||||||
|
value = props.get("value")
|
||||||
|
|
||||||
|
# React expects an empty string(instead of null) for controlled inputs.
|
||||||
|
if value is not None and is_optional(
|
||||||
|
(value_var := Var.create(value))._var_type
|
||||||
|
):
|
||||||
|
props["value"] = ternary_operation(
|
||||||
|
(value_var != Var.create(None)) # pyright: ignore [reportGeneralTypeIssues]
|
||||||
|
& (value_var != Var(_js_expr="undefined")),
|
||||||
|
value,
|
||||||
|
Var.create(""),
|
||||||
|
)
|
||||||
|
|
||||||
component = super().create(*children, **props)
|
component = super().create(*children, **props)
|
||||||
if props.get("value") is not None and props.get("on_change") is not None:
|
if props.get("value") is not None and props.get("on_change") is not None:
|
||||||
# create a debounced input if the user requests full control to avoid typing jank
|
# create a debounced input if the user requests full control to avoid typing jank
|
||||||
|
@ -213,7 +213,7 @@ class TextFieldRoot(elements.Div, RadixThemesComponent):
|
|||||||
on_blur: Fired when the textarea is blurred.
|
on_blur: Fired when the textarea is blurred.
|
||||||
on_key_down: Fired when a key is pressed down.
|
on_key_down: Fired when a key is pressed down.
|
||||||
on_key_up: Fired when a key is released.
|
on_key_up: Fired when a key is released.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -550,7 +550,7 @@ class TextField(ComponentNamespace):
|
|||||||
on_blur: Fired when the textarea is blurred.
|
on_blur: Fired when the textarea is blurred.
|
||||||
on_key_down: Fired when a key is pressed down.
|
on_key_down: Fired when a key is pressed down.
|
||||||
on_key_up: Fired when a key is released.
|
on_key_up: Fired when a key is released.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -72,7 +72,7 @@ class Box(elements.Div, RadixThemesComponent):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: Child components.
|
*children: Child components.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -155,7 +155,7 @@ class Center(Flex):
|
|||||||
justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
|
justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
|
||||||
wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
|
wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
|
||||||
spacing: Gap between children: "0" - "9"
|
spacing: Gap between children: "0" - "9"
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -158,7 +158,7 @@ class Flex(elements.Div, RadixThemesComponent):
|
|||||||
justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
|
justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
|
||||||
wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
|
wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
|
||||||
spacing: Gap between children: "0" - "9"
|
spacing: Gap between children: "0" - "9"
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -190,7 +190,7 @@ class Grid(elements.Div, RadixThemesComponent):
|
|||||||
spacing: Gap between children: "0" - "9"
|
spacing: Gap between children: "0" - "9"
|
||||||
spacing_x: Gap between children horizontal: "0" - "9"
|
spacing_x: Gap between children horizontal: "0" - "9"
|
||||||
spacing_y: Gap between children vertical: "0" - "9"
|
spacing_y: Gap between children vertical: "0" - "9"
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -64,7 +64,6 @@ class BaseList(Component, MarkdownComponentMap):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The list component.
|
The list component.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
items = props.pop("items", None)
|
items = props.pop("items", None)
|
||||||
list_style_type = props.pop("list_style_type", "none")
|
list_style_type = props.pop("list_style_type", "none")
|
||||||
@ -114,7 +113,6 @@ class UnorderedList(BaseList, Ul):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The list component.
|
The list component.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
items = props.pop("items", None)
|
items = props.pop("items", None)
|
||||||
list_style_type = props.pop("list_style_type", "disc")
|
list_style_type = props.pop("list_style_type", "disc")
|
||||||
@ -144,7 +142,6 @@ class OrderedList(BaseList, Ol):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The list component.
|
The list component.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
items = props.pop("items", None)
|
items = props.pop("items", None)
|
||||||
list_style_type = props.pop("list_style_type", "decimal")
|
list_style_type = props.pop("list_style_type", "decimal")
|
||||||
@ -168,7 +165,6 @@ class ListItem(Li, MarkdownComponentMap):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The list item component.
|
The list item component.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
for child in children:
|
for child in children:
|
||||||
if isinstance(child, Text):
|
if isinstance(child, Text):
|
||||||
|
@ -118,7 +118,6 @@ class BaseList(Component, MarkdownComponentMap):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The list component.
|
The list component.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
@ -226,7 +225,7 @@ class UnorderedList(BaseList, Ul):
|
|||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
list_style_type: The style of the list. Default to "none".
|
list_style_type: The style of the list. Default to "none".
|
||||||
items: A list of items to add to the list.
|
items: A list of items to add to the list.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -252,7 +251,6 @@ class UnorderedList(BaseList, Ul):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The list component.
|
The list component.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
@ -364,7 +362,7 @@ class OrderedList(BaseList, Ol):
|
|||||||
reversed: Reverses the order of the list.
|
reversed: Reverses the order of the list.
|
||||||
start: Specifies the start value of the first list item in an ordered list.
|
start: Specifies the start value of the first list item in an ordered list.
|
||||||
type: Specifies the kind of marker to use in the list (letters or numbers).
|
type: Specifies the kind of marker to use in the list (letters or numbers).
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -390,7 +388,6 @@ class OrderedList(BaseList, Ol):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The list component.
|
The list component.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
@ -451,7 +448,7 @@ class ListItem(Li, MarkdownComponentMap):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: The children of the component.
|
*children: The children of the component.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -477,7 +474,6 @@ class ListItem(Li, MarkdownComponentMap):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The list item component.
|
The list item component.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
@ -571,7 +567,6 @@ class List(ComponentNamespace):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The list component.
|
The list component.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ class Section(elements.Section, RadixThemesComponent):
|
|||||||
Args:
|
Args:
|
||||||
*children: Child components.
|
*children: Child components.
|
||||||
size: The size of the section: "1" - "3" (default "2")
|
size: The size of the section: "1" - "3" (default "2")
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -155,7 +155,7 @@ class Spacer(Flex):
|
|||||||
justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
|
justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
|
||||||
wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
|
wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
|
||||||
spacing: Gap between children: "0" - "9"
|
spacing: Gap between children: "0" - "9"
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -129,7 +129,7 @@ class Stack(Flex):
|
|||||||
direction: How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse"
|
direction: How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse"
|
||||||
justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
|
justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
|
||||||
wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
|
wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -264,7 +264,7 @@ class VStack(Stack):
|
|||||||
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
|
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
|
||||||
justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
|
justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
|
||||||
wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
|
wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -399,7 +399,7 @@ class HStack(Stack):
|
|||||||
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
|
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
|
||||||
justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
|
justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
|
||||||
wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
|
wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -168,7 +168,7 @@ class Blockquote(elements.Blockquote, RadixThemesComponent):
|
|||||||
color_scheme: Overrides the accent color inherited from the Theme.
|
color_scheme: Overrides the accent color inherited from the Theme.
|
||||||
high_contrast: Whether to render the text with higher contrast color
|
high_contrast: Whether to render the text with higher contrast color
|
||||||
cite: Define the title of a work.
|
cite: Define the title of a work.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -174,7 +174,7 @@ class Code(elements.Code, RadixThemesComponent, MarkdownComponentMap):
|
|||||||
weight: Thickness of text: "light" | "regular" | "medium" | "bold"
|
weight: Thickness of text: "light" | "regular" | "medium" | "bold"
|
||||||
color_scheme: Overrides the accent color inherited from the Theme.
|
color_scheme: Overrides the accent color inherited from the Theme.
|
||||||
high_contrast: Whether to render the text with higher contrast color
|
high_contrast: Whether to render the text with higher contrast color
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -197,7 +197,7 @@ class Heading(elements.H1, RadixThemesComponent, MarkdownComponentMap):
|
|||||||
trim: Removes the leading trim space: "normal" | "start" | "end" | "both"
|
trim: Removes the leading trim space: "normal" | "start" | "end" | "both"
|
||||||
color_scheme: Overrides the accent color inherited from the Theme.
|
color_scheme: Overrides the accent color inherited from the Theme.
|
||||||
high_contrast: Whether to render the text with higher contrast color
|
high_contrast: Whether to render the text with higher contrast color
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -215,7 +215,7 @@ class Link(RadixThemesComponent, A, MemoizationLeaf, MarkdownComponentMap):
|
|||||||
rel: Specifies the relationship between the linked document and the current document
|
rel: Specifies the relationship between the linked document and the current document
|
||||||
shape: Specifies the shape of the area
|
shape: Specifies the shape of the area
|
||||||
target: Specifies where to open the linked document
|
target: Specifies where to open the linked document
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -264,7 +264,7 @@ class Text(elements.Span, RadixThemesComponent, MarkdownComponentMap):
|
|||||||
trim: Removes the leading trim space: "normal" | "start" | "end" | "both"
|
trim: Removes the leading trim space: "normal" | "start" | "end" | "both"
|
||||||
color_scheme: Overrides the accent color inherited from the Theme.
|
color_scheme: Overrides the accent color inherited from the Theme.
|
||||||
high_contrast: Whether to render the text with higher contrast color
|
high_contrast: Whether to render the text with higher contrast color
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -521,7 +521,7 @@ class Span(Text):
|
|||||||
trim: Removes the leading trim space: "normal" | "start" | "end" | "both"
|
trim: Removes the leading trim space: "normal" | "start" | "end" | "both"
|
||||||
color_scheme: Overrides the accent color inherited from the Theme.
|
color_scheme: Overrides the accent color inherited from the Theme.
|
||||||
high_contrast: Whether to render the text with higher contrast color
|
high_contrast: Whether to render the text with higher contrast color
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -610,7 +610,7 @@ class Em(elements.Em, RadixThemesComponent):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: Child components.
|
*children: Child components.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -706,7 +706,7 @@ class Kbd(elements.Kbd, RadixThemesComponent):
|
|||||||
Args:
|
Args:
|
||||||
*children: Child components.
|
*children: Child components.
|
||||||
size: Text size: "1" - "9"
|
size: Text size: "1" - "9"
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -797,7 +797,7 @@ class Quote(elements.Q, RadixThemesComponent):
|
|||||||
Args:
|
Args:
|
||||||
*children: Child components.
|
*children: Child components.
|
||||||
cite: Specifies the source URL of the quote.
|
cite: Specifies the source URL of the quote.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -886,7 +886,7 @@ class Strong(elements.Strong, RadixThemesComponent):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
*children: Child components.
|
*children: Child components.
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
@ -1147,7 +1147,7 @@ class TextNamespace(ComponentNamespace):
|
|||||||
trim: Removes the leading trim space: "normal" | "start" | "end" | "both"
|
trim: Removes the leading trim space: "normal" | "start" | "end" | "both"
|
||||||
color_scheme: Overrides the accent color inherited from the Theme.
|
color_scheme: Overrides the accent color inherited from the Theme.
|
||||||
high_contrast: Whether to render the text with higher contrast color
|
high_contrast: Whether to render the text with higher contrast color
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
||||||
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
||||||
content_editable: Indicates whether the element's content is editable.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
||||||
|
@ -416,7 +416,7 @@ class Bar(Cartesian):
|
|||||||
radius: Var[Union[int, List[int]]]
|
radius: Var[Union[int, List[int]]]
|
||||||
|
|
||||||
# The active bar is shown when a user enters a bar chart and this chart has tooltip. If set to false, no active bar will be drawn. If set to true, active bar will be drawn with the props calculated internally. If passed an object, active bar will be drawn, and the internally calculated props will be merged with the key value pairs of the passed object.
|
# The active bar is shown when a user enters a bar chart and this chart has tooltip. If set to false, no active bar will be drawn. If set to true, active bar will be drawn with the props calculated internally. If passed an object, active bar will be drawn, and the internally calculated props will be merged with the key value pairs of the passed object.
|
||||||
# active_bar: Var[Union[bool, Dict[str, Any]]]
|
# active_bar: Var[Union[bool, Dict[str, Any]]] #noqa: ERA001
|
||||||
|
|
||||||
# Valid children components
|
# Valid children components
|
||||||
_valid_children: List[str] = ["Cell", "LabelList", "ErrorBar"]
|
_valid_children: List[str] = ["Cell", "LabelList", "ErrorBar"]
|
||||||
|
@ -136,7 +136,7 @@ class Radar(Recharts):
|
|||||||
# Fill color. Default: rx.color("accent", 3)
|
# Fill color. Default: rx.color("accent", 3)
|
||||||
fill: Var[str] = LiteralVar.create(Color("accent", 3))
|
fill: Var[str] = LiteralVar.create(Color("accent", 3))
|
||||||
|
|
||||||
# opacity. Default: 0.6
|
# The opacity to fill the chart. Default: 0.6
|
||||||
fill_opacity: Var[float] = LiteralVar.create(0.6)
|
fill_opacity: Var[float] = LiteralVar.create(0.6)
|
||||||
|
|
||||||
# The type of icon in legend. If set to 'none', no legend item will be rendered. Default: "rect"
|
# The type of icon in legend. If set to 'none', no legend item will be rendered. Default: "rect"
|
||||||
|
@ -204,7 +204,7 @@ class Radar(Recharts):
|
|||||||
dot: If false set, dots will not be drawn. Default: True
|
dot: If false set, dots will not be drawn. Default: True
|
||||||
stroke: Stoke color. Default: rx.color("accent", 9)
|
stroke: Stoke color. Default: rx.color("accent", 9)
|
||||||
fill: Fill color. Default: rx.color("accent", 3)
|
fill: Fill color. Default: rx.color("accent", 3)
|
||||||
fill_opacity: opacity. Default: 0.6
|
fill_opacity: The opacity to fill the chart. Default: 0.6
|
||||||
legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. Default: "rect"
|
legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. Default: "rect"
|
||||||
label: If false set, labels will not be drawn. Default: True
|
label: If false set, labels will not be drawn. Default: True
|
||||||
is_animation_active: If set false, animation of polygon will be disabled. Default: True in CSR, and False in SSR
|
is_animation_active: If set false, animation of polygon will be disabled. Default: True in CSR, and False in SSR
|
||||||
|
@ -98,7 +98,7 @@ class ToastProps(PropsBase, NoExtrasAllowedProps):
|
|||||||
|
|
||||||
# TODO: fix serialization of icons for toast? (might not be possible yet)
|
# TODO: fix serialization of icons for toast? (might not be possible yet)
|
||||||
# Icon displayed in front of toast's text, aligned vertically.
|
# Icon displayed in front of toast's text, aligned vertically.
|
||||||
# icon: Optional[Icon] = None
|
# icon: Optional[Icon] = None # noqa: ERA001
|
||||||
|
|
||||||
# TODO: fix implementation for action / cancel buttons
|
# TODO: fix implementation for action / cancel buttons
|
||||||
# Renders a primary button, clicking it will close the toast.
|
# Renders a primary button, clicking it will close the toast.
|
||||||
@ -364,9 +364,7 @@ class Toaster(Component):
|
|||||||
return super().create(*children, **props)
|
return super().create(*children, **props)
|
||||||
|
|
||||||
|
|
||||||
# TODO: figure out why loading toast stay open forever
|
# TODO: figure out why loading toast stay open forever when using level="loading" in toast()
|
||||||
# def toast_loading(message: str, **kwargs):
|
|
||||||
# return _toast(message, level="loading", **kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
class ToastNamespace(ComponentNamespace):
|
class ToastNamespace(ComponentNamespace):
|
||||||
@ -379,7 +377,6 @@ class ToastNamespace(ComponentNamespace):
|
|||||||
error = staticmethod(Toaster.toast_error)
|
error = staticmethod(Toaster.toast_error)
|
||||||
success = staticmethod(Toaster.toast_success)
|
success = staticmethod(Toaster.toast_success)
|
||||||
dismiss = staticmethod(Toaster.toast_dismiss)
|
dismiss = staticmethod(Toaster.toast_dismiss)
|
||||||
# loading = staticmethod(toast_loading)
|
|
||||||
__call__ = staticmethod(Toaster.send_toast)
|
__call__ = staticmethod(Toaster.send_toast)
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ class Editor(NoSSRComponent):
|
|||||||
# Please refer to the library docs for this.
|
# Please refer to the library docs for this.
|
||||||
# options: "en" | "da" | "de" | "es" | "fr" | "ja" | "ko" | "pt_br" |
|
# options: "en" | "da" | "de" | "es" | "fr" | "ja" | "ko" | "pt_br" |
|
||||||
# "ru" | "zh_cn" | "ro" | "pl" | "ckb" | "lv" | "se" | "ua" | "he" | "it"
|
# "ru" | "zh_cn" | "ro" | "pl" | "ckb" | "lv" | "se" | "ua" | "he" | "it"
|
||||||
# default : "en"
|
# default: "en".
|
||||||
lang: Var[
|
lang: Var[
|
||||||
Union[
|
Union[
|
||||||
Literal[
|
Literal[
|
||||||
@ -172,7 +172,7 @@ class Editor(NoSSRComponent):
|
|||||||
set_options: Var[Dict]
|
set_options: Var[Dict]
|
||||||
|
|
||||||
# Whether all SunEditor plugins should be loaded.
|
# Whether all SunEditor plugins should be loaded.
|
||||||
# default: True
|
# default: True.
|
||||||
set_all_plugins: Var[bool]
|
set_all_plugins: Var[bool]
|
||||||
|
|
||||||
# Set the content of the editor.
|
# Set the content of the editor.
|
||||||
@ -191,19 +191,19 @@ class Editor(NoSSRComponent):
|
|||||||
set_default_style: Var[str]
|
set_default_style: Var[str]
|
||||||
|
|
||||||
# Disable the editor
|
# Disable the editor
|
||||||
# default: False
|
# default: False.
|
||||||
disable: Var[bool]
|
disable: Var[bool]
|
||||||
|
|
||||||
# Hide the editor
|
# Hide the editor
|
||||||
# default: False
|
# default: False.
|
||||||
hide: Var[bool]
|
hide: Var[bool]
|
||||||
|
|
||||||
# Hide the editor toolbar
|
# Hide the editor toolbar
|
||||||
# default: False
|
# default: False.
|
||||||
hide_toolbar: Var[bool]
|
hide_toolbar: Var[bool]
|
||||||
|
|
||||||
# Disable the editor toolbar
|
# Disable the editor toolbar
|
||||||
# default: False
|
# default: False.
|
||||||
disable_toolbar: Var[bool]
|
disable_toolbar: Var[bool]
|
||||||
|
|
||||||
# Fired when the editor content changes.
|
# Fired when the editor content changes.
|
||||||
|
@ -172,7 +172,7 @@ class Editor(NoSSRComponent):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
set_options(Optional[EditorOptions]): Configuration object to further configure the instance.
|
set_options(Optional[EditorOptions]): Configuration object to further configure the instance.
|
||||||
lang: Language of the editor. Alternatively to a string, a dict of your language can be passed to this prop. Please refer to the library docs for this. options: "en" | "da" | "de" | "es" | "fr" | "ja" | "ko" | "pt_br" | "ru" | "zh_cn" | "ro" | "pl" | "ckb" | "lv" | "se" | "ua" | "he" | "it" default : "en"
|
lang: Language of the editor. Alternatively to a string, a dict of your language can be passed to this prop. Please refer to the library docs for this. options: "en" | "da" | "de" | "es" | "fr" | "ja" | "ko" | "pt_br" | "ru" | "zh_cn" | "ro" | "pl" | "ckb" | "lv" | "se" | "ua" | "he" | "it" default: "en".
|
||||||
name: This is used to set the HTML form name of the editor. This means on HTML form submission, it will be submitted together with contents of the editor by the name provided.
|
name: This is used to set the HTML form name of the editor. This means on HTML form submission, it will be submitted together with contents of the editor by the name provided.
|
||||||
default_value: Sets the default value of the editor. This is useful if you don't want the on_change method to be called on render. If you want the on_change method to be called on render please use the set_contents prop
|
default_value: Sets the default value of the editor. This is useful if you don't want the on_change method to be called on render. If you want the on_change method to be called on render please use the set_contents prop
|
||||||
width: Sets the width of the editor. px and percentage values are accepted, eg width="100%" or width="500px" default: 100%
|
width: Sets the width of the editor. px and percentage values are accepted, eg width="100%" or width="500px" default: 100%
|
||||||
@ -180,14 +180,14 @@ class Editor(NoSSRComponent):
|
|||||||
placeholder: Sets the placeholder of the editor.
|
placeholder: Sets the placeholder of the editor.
|
||||||
auto_focus: Should the editor receive focus when initialized?
|
auto_focus: Should the editor receive focus when initialized?
|
||||||
set_options: Pass an EditorOptions instance to modify the behaviour of Editor even more.
|
set_options: Pass an EditorOptions instance to modify the behaviour of Editor even more.
|
||||||
set_all_plugins: Whether all SunEditor plugins should be loaded. default: True
|
set_all_plugins: Whether all SunEditor plugins should be loaded. default: True.
|
||||||
set_contents: Set the content of the editor. Note: To set the initial contents of the editor without calling the on_change event, please use the default_value prop. set_contents is used to set the contents of the editor programmatically. You must be aware that, when the set_contents's prop changes, the on_change event is triggered.
|
set_contents: Set the content of the editor. Note: To set the initial contents of the editor without calling the on_change event, please use the default_value prop. set_contents is used to set the contents of the editor programmatically. You must be aware that, when the set_contents's prop changes, the on_change event is triggered.
|
||||||
append_contents: Append editor content
|
append_contents: Append editor content
|
||||||
set_default_style: Sets the default style of the editor's edit area
|
set_default_style: Sets the default style of the editor's edit area
|
||||||
disable: Disable the editor default: False
|
disable: Disable the editor default: False.
|
||||||
hide: Hide the editor default: False
|
hide: Hide the editor default: False.
|
||||||
hide_toolbar: Hide the editor toolbar default: False
|
hide_toolbar: Hide the editor toolbar default: False.
|
||||||
disable_toolbar: Disable the editor toolbar default: False
|
disable_toolbar: Disable the editor toolbar default: False.
|
||||||
on_change: Fired when the editor content changes.
|
on_change: Fired when the editor content changes.
|
||||||
on_input: Fired when the something is inputted in the editor.
|
on_input: Fired when the something is inputted in the editor.
|
||||||
on_blur: Fired when the editor loses focus.
|
on_blur: Fired when the editor loses focus.
|
||||||
|
@ -82,7 +82,7 @@ class DBConfig(Base):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def postgresql_psycopg2(
|
def postgresql_psycopg(
|
||||||
cls,
|
cls,
|
||||||
database: str,
|
database: str,
|
||||||
username: str,
|
username: str,
|
||||||
@ -90,7 +90,7 @@ class DBConfig(Base):
|
|||||||
host: str | None = None,
|
host: str | None = None,
|
||||||
port: int | None = 5432,
|
port: int | None = 5432,
|
||||||
) -> DBConfig:
|
) -> DBConfig:
|
||||||
"""Create an instance with postgresql+psycopg2 engine.
|
"""Create an instance with postgresql+psycopg engine.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
database: Database name.
|
database: Database name.
|
||||||
@ -103,7 +103,7 @@ class DBConfig(Base):
|
|||||||
DBConfig instance.
|
DBConfig instance.
|
||||||
"""
|
"""
|
||||||
return cls(
|
return cls(
|
||||||
engine="postgresql+psycopg2",
|
engine="postgresql+psycopg",
|
||||||
username=username,
|
username=username,
|
||||||
password=password,
|
password=password,
|
||||||
host=host,
|
host=host,
|
||||||
@ -512,6 +512,9 @@ class EnvironmentVariables:
|
|||||||
# Whether to print the SQL queries if the log level is INFO or lower.
|
# Whether to print the SQL queries if the log level is INFO or lower.
|
||||||
SQLALCHEMY_ECHO: EnvVar[bool] = env_var(False)
|
SQLALCHEMY_ECHO: EnvVar[bool] = env_var(False)
|
||||||
|
|
||||||
|
# Whether to check db connections before using them.
|
||||||
|
SQLALCHEMY_POOL_PRE_PING: EnvVar[bool] = env_var(True)
|
||||||
|
|
||||||
# Whether to ignore the redis config error. Some redis servers only allow out-of-band configuration.
|
# Whether to ignore the redis config error. Some redis servers only allow out-of-band configuration.
|
||||||
REFLEX_IGNORE_REDIS_CONFIG_ERROR: EnvVar[bool] = env_var(False)
|
REFLEX_IGNORE_REDIS_CONFIG_ERROR: EnvVar[bool] = env_var(False)
|
||||||
|
|
||||||
@ -568,6 +571,10 @@ class EnvironmentVariables:
|
|||||||
environment = EnvironmentVariables()
|
environment = EnvironmentVariables()
|
||||||
|
|
||||||
|
|
||||||
|
# These vars are not logged because they may contain sensitive information.
|
||||||
|
_sensitive_env_vars = {"DB_URL", "ASYNC_DB_URL", "REDIS_URL"}
|
||||||
|
|
||||||
|
|
||||||
class Config(Base):
|
class Config(Base):
|
||||||
"""The config defines runtime settings for the app.
|
"""The config defines runtime settings for the app.
|
||||||
|
|
||||||
@ -621,6 +628,9 @@ class Config(Base):
|
|||||||
# The database url used by rx.Model.
|
# The database url used by rx.Model.
|
||||||
db_url: Optional[str] = "sqlite:///reflex.db"
|
db_url: Optional[str] = "sqlite:///reflex.db"
|
||||||
|
|
||||||
|
# The async database url used by rx.Model.
|
||||||
|
async_db_url: Optional[str] = None
|
||||||
|
|
||||||
# The redis url
|
# The redis url
|
||||||
redis_url: Optional[str] = None
|
redis_url: Optional[str] = None
|
||||||
|
|
||||||
@ -674,6 +684,9 @@ class Config(Base):
|
|||||||
# Maximum expiration lock time for redis state manager
|
# Maximum expiration lock time for redis state manager
|
||||||
redis_lock_expiration: int = constants.Expiration.LOCK
|
redis_lock_expiration: int = constants.Expiration.LOCK
|
||||||
|
|
||||||
|
# Maximum lock time before warning for redis state manager.
|
||||||
|
redis_lock_warning_threshold: int = constants.Expiration.LOCK_WARNING_THRESHOLD
|
||||||
|
|
||||||
# Token expiration time for redis state manager
|
# Token expiration time for redis state manager
|
||||||
redis_token_expiration: int = constants.Expiration.TOKEN
|
redis_token_expiration: int = constants.Expiration.TOKEN
|
||||||
|
|
||||||
@ -748,18 +761,20 @@ class Config(Base):
|
|||||||
|
|
||||||
# If the env var is set, override the config value.
|
# If the env var is set, override the config value.
|
||||||
if env_var is not None:
|
if env_var is not None:
|
||||||
if key.upper() != "DB_URL":
|
|
||||||
console.info(
|
|
||||||
f"Overriding config value {key} with env var {key.upper()}={env_var}",
|
|
||||||
dedupe=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Interpret the value.
|
# Interpret the value.
|
||||||
value = interpret_env_var_value(env_var, field.outer_type_, field.name)
|
value = interpret_env_var_value(env_var, field.outer_type_, field.name)
|
||||||
|
|
||||||
# Set the value.
|
# Set the value.
|
||||||
updated_values[key] = value
|
updated_values[key] = value
|
||||||
|
|
||||||
|
if key.upper() in _sensitive_env_vars:
|
||||||
|
env_var = "***"
|
||||||
|
|
||||||
|
console.info(
|
||||||
|
f"Overriding config value {key} with env var {key.upper()}={env_var}",
|
||||||
|
dedupe=True,
|
||||||
|
)
|
||||||
|
|
||||||
return updated_values
|
return updated_values
|
||||||
|
|
||||||
def get_event_namespace(self) -> str:
|
def get_event_namespace(self) -> str:
|
||||||
|
@ -26,9 +26,11 @@ class Expiration(SimpleNamespace):
|
|||||||
# Token expiration time in seconds
|
# Token expiration time in seconds
|
||||||
TOKEN = 60 * 60
|
TOKEN = 60 * 60
|
||||||
# Maximum time in milliseconds that a state can be locked for exclusive access.
|
# Maximum time in milliseconds that a state can be locked for exclusive access.
|
||||||
LOCK = 1000
|
LOCK = 10000
|
||||||
# The PING timeout
|
# The PING timeout
|
||||||
PING = 120
|
PING = 120
|
||||||
|
# The maximum time in milliseconds to hold a lock before throwing a warning.
|
||||||
|
LOCK_WARNING_THRESHOLD = 1000
|
||||||
|
|
||||||
|
|
||||||
class GitIgnore(SimpleNamespace):
|
class GitIgnore(SimpleNamespace):
|
||||||
|
@ -1222,7 +1222,7 @@ def call_event_handler(
|
|||||||
except TypeError:
|
except TypeError:
|
||||||
# TODO: In 0.7.0, remove this block and raise the exception
|
# TODO: In 0.7.0, remove this block and raise the exception
|
||||||
# raise TypeError(
|
# raise TypeError(
|
||||||
# f"Could not compare types {args_types_without_vars[i]} and {type_hints_of_provided_callback[arg]} for argument {arg} of {event_handler.fn.__qualname__} provided for {key}."
|
# f"Could not compare types {args_types_without_vars[i]} and {type_hints_of_provided_callback[arg]} for argument {arg} of {event_handler.fn.__qualname__} provided for {key}." # noqa: ERA001
|
||||||
# ) from e
|
# ) from e
|
||||||
console.warn(
|
console.warn(
|
||||||
f"Could not compare types {args_types_without_vars[i]} and {type_hints_of_provided_callback[arg]} for argument {arg} of {event_callback.fn.__qualname__} provided for {key}."
|
f"Could not compare types {args_types_without_vars[i]} and {type_hints_of_provided_callback[arg]} for argument {arg} of {event_callback.fn.__qualname__} provided for {key}."
|
||||||
@ -1556,7 +1556,7 @@ class LiteralEventVar(VarOperationCall, LiteralVar, EventVar):
|
|||||||
Returns:
|
Returns:
|
||||||
The hash of the var.
|
The hash of the var.
|
||||||
"""
|
"""
|
||||||
return hash((self.__class__.__name__, self._js_expr))
|
return hash((type(self).__name__, self._js_expr))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(
|
def create(
|
||||||
@ -1620,7 +1620,7 @@ class LiteralEventChainVar(ArgsFunctionOperationBuilder, LiteralVar, EventChainV
|
|||||||
Returns:
|
Returns:
|
||||||
The hash of the var.
|
The hash of the var.
|
||||||
"""
|
"""
|
||||||
return hash((self.__class__.__name__, self._js_expr))
|
return hash((type(self).__name__, self._js_expr))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(
|
def create(
|
||||||
|
@ -242,4 +242,5 @@ class ClientStateVar(Var):
|
|||||||
"""
|
"""
|
||||||
if not self._global_ref:
|
if not self._global_ref:
|
||||||
raise ValueError("ClientStateVar must be global to push the value.")
|
raise ValueError("ClientStateVar must be global to push the value.")
|
||||||
|
value = Var.create(value)
|
||||||
return run_script(f"{_client_state_ref(self._setter_name)}({value})")
|
return run_script(f"{_client_state_ref(self._setter_name)}({value})")
|
||||||
|
@ -33,12 +33,6 @@ class Sidebar(Box, MemoizationLeaf):
|
|||||||
Returns:
|
Returns:
|
||||||
The sidebar component.
|
The sidebar component.
|
||||||
"""
|
"""
|
||||||
# props.setdefault("border_right", f"1px solid {color('accent', 12)}")
|
|
||||||
# props.setdefault("background_color", color("accent", 1))
|
|
||||||
# props.setdefault("width", "20vw")
|
|
||||||
# props.setdefault("height", "100vh")
|
|
||||||
# props.setdefault("position", "fixed")
|
|
||||||
|
|
||||||
return super().create(
|
return super().create(
|
||||||
Box.create(*children, **props), # sidebar for content
|
Box.create(*children, **props), # sidebar for content
|
||||||
Box.create(width=props.get("width")), # spacer for layout
|
Box.create(width=props.get("width")), # spacer for layout
|
||||||
|
126
reflex/model.py
126
reflex/model.py
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import re
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from typing import Any, ClassVar, Optional, Type, Union
|
from typing import Any, ClassVar, Optional, Type, Union
|
||||||
|
|
||||||
@ -14,6 +15,7 @@ import alembic.script
|
|||||||
import alembic.util
|
import alembic.util
|
||||||
import sqlalchemy
|
import sqlalchemy
|
||||||
import sqlalchemy.exc
|
import sqlalchemy.exc
|
||||||
|
import sqlalchemy.ext.asyncio
|
||||||
import sqlalchemy.orm
|
import sqlalchemy.orm
|
||||||
|
|
||||||
from reflex.base import Base
|
from reflex.base import Base
|
||||||
@ -21,6 +23,48 @@ from reflex.config import environment, get_config
|
|||||||
from reflex.utils import console
|
from reflex.utils import console
|
||||||
from reflex.utils.compat import sqlmodel, sqlmodel_field_has_primary_key
|
from reflex.utils.compat import sqlmodel, sqlmodel_field_has_primary_key
|
||||||
|
|
||||||
|
_ENGINE: dict[str, sqlalchemy.engine.Engine] = {}
|
||||||
|
_ASYNC_ENGINE: dict[str, sqlalchemy.ext.asyncio.AsyncEngine] = {}
|
||||||
|
_AsyncSessionLocal: dict[str | None, sqlalchemy.ext.asyncio.async_sessionmaker] = {}
|
||||||
|
|
||||||
|
# Import AsyncSession _after_ reflex.utils.compat
|
||||||
|
from sqlmodel.ext.asyncio.session import AsyncSession # noqa: E402
|
||||||
|
|
||||||
|
|
||||||
|
def _safe_db_url_for_logging(url: str) -> str:
|
||||||
|
"""Remove username and password from the database URL for logging.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
url: The database URL.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The database URL with the username and password removed.
|
||||||
|
"""
|
||||||
|
return re.sub(r"://[^@]+@", "://<username>:<password>@", url)
|
||||||
|
|
||||||
|
|
||||||
|
def get_engine_args(url: str | None = None) -> dict[str, Any]:
|
||||||
|
"""Get the database engine arguments.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
url: The database url.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The database engine arguments as a dict.
|
||||||
|
"""
|
||||||
|
kwargs: dict[str, Any] = dict(
|
||||||
|
# Print the SQL queries if the log level is INFO or lower.
|
||||||
|
echo=environment.SQLALCHEMY_ECHO.get(),
|
||||||
|
# Check connections before returning them.
|
||||||
|
pool_pre_ping=environment.SQLALCHEMY_POOL_PRE_PING.get(),
|
||||||
|
)
|
||||||
|
conf = get_config()
|
||||||
|
url = url or conf.db_url
|
||||||
|
if url is not None and url.startswith("sqlite"):
|
||||||
|
# Needed for the admin dash on sqlite.
|
||||||
|
kwargs["connect_args"] = {"check_same_thread": False}
|
||||||
|
return kwargs
|
||||||
|
|
||||||
|
|
||||||
def get_engine(url: str | None = None) -> sqlalchemy.engine.Engine:
|
def get_engine(url: str | None = None) -> sqlalchemy.engine.Engine:
|
||||||
"""Get the database engine.
|
"""Get the database engine.
|
||||||
@ -38,15 +82,62 @@ def get_engine(url: str | None = None) -> sqlalchemy.engine.Engine:
|
|||||||
url = url or conf.db_url
|
url = url or conf.db_url
|
||||||
if url is None:
|
if url is None:
|
||||||
raise ValueError("No database url configured")
|
raise ValueError("No database url configured")
|
||||||
|
|
||||||
|
global _ENGINE
|
||||||
|
if url in _ENGINE:
|
||||||
|
return _ENGINE[url]
|
||||||
|
|
||||||
if not environment.ALEMBIC_CONFIG.get().exists():
|
if not environment.ALEMBIC_CONFIG.get().exists():
|
||||||
console.warn(
|
console.warn(
|
||||||
"Database is not initialized, run [bold]reflex db init[/bold] first."
|
"Database is not initialized, run [bold]reflex db init[/bold] first."
|
||||||
)
|
)
|
||||||
# Print the SQL queries if the log level is INFO or lower.
|
_ENGINE[url] = sqlmodel.create_engine(
|
||||||
echo_db_query = environment.SQLALCHEMY_ECHO.get()
|
url,
|
||||||
# Needed for the admin dash on sqlite.
|
**get_engine_args(url),
|
||||||
connect_args = {"check_same_thread": False} if url.startswith("sqlite") else {}
|
)
|
||||||
return sqlmodel.create_engine(url, echo=echo_db_query, connect_args=connect_args)
|
return _ENGINE[url]
|
||||||
|
|
||||||
|
|
||||||
|
def get_async_engine(url: str | None) -> sqlalchemy.ext.asyncio.AsyncEngine:
|
||||||
|
"""Get the async database engine.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
url: The database url.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The async database engine.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
ValueError: If the async database url is None.
|
||||||
|
"""
|
||||||
|
if url is None:
|
||||||
|
conf = get_config()
|
||||||
|
url = conf.async_db_url
|
||||||
|
if url is not None and conf.db_url is not None:
|
||||||
|
async_db_url_tail = url.partition("://")[2]
|
||||||
|
db_url_tail = conf.db_url.partition("://")[2]
|
||||||
|
if async_db_url_tail != db_url_tail:
|
||||||
|
console.warn(
|
||||||
|
f"async_db_url `{_safe_db_url_for_logging(url)}` "
|
||||||
|
"should reference the same database as "
|
||||||
|
f"db_url `{_safe_db_url_for_logging(conf.db_url)}`."
|
||||||
|
)
|
||||||
|
if url is None:
|
||||||
|
raise ValueError("No async database url configured")
|
||||||
|
|
||||||
|
global _ASYNC_ENGINE
|
||||||
|
if url in _ASYNC_ENGINE:
|
||||||
|
return _ASYNC_ENGINE[url]
|
||||||
|
|
||||||
|
if not environment.ALEMBIC_CONFIG.get().exists():
|
||||||
|
console.warn(
|
||||||
|
"Database is not initialized, run [bold]reflex db init[/bold] first."
|
||||||
|
)
|
||||||
|
_ASYNC_ENGINE[url] = sqlalchemy.ext.asyncio.create_async_engine(
|
||||||
|
url,
|
||||||
|
**get_engine_args(url),
|
||||||
|
)
|
||||||
|
return _ASYNC_ENGINE[url]
|
||||||
|
|
||||||
|
|
||||||
async def get_db_status() -> bool:
|
async def get_db_status() -> bool:
|
||||||
@ -425,6 +516,31 @@ def session(url: str | None = None) -> sqlmodel.Session:
|
|||||||
return sqlmodel.Session(get_engine(url))
|
return sqlmodel.Session(get_engine(url))
|
||||||
|
|
||||||
|
|
||||||
|
def asession(url: str | None = None) -> AsyncSession:
|
||||||
|
"""Get an async sqlmodel session to interact with the database.
|
||||||
|
|
||||||
|
async with rx.asession() as asession:
|
||||||
|
...
|
||||||
|
|
||||||
|
Most operations against the `asession` must be awaited.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
url: The database url.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
An async database session.
|
||||||
|
"""
|
||||||
|
global _AsyncSessionLocal
|
||||||
|
if url not in _AsyncSessionLocal:
|
||||||
|
_AsyncSessionLocal[url] = sqlalchemy.ext.asyncio.async_sessionmaker(
|
||||||
|
bind=get_async_engine(url),
|
||||||
|
class_=AsyncSession,
|
||||||
|
autocommit=False,
|
||||||
|
autoflush=False,
|
||||||
|
)
|
||||||
|
return _AsyncSessionLocal[url]()
|
||||||
|
|
||||||
|
|
||||||
def sqla_session(url: str | None = None) -> sqlalchemy.orm.Session:
|
def sqla_session(url: str | None = None) -> sqlalchemy.orm.Session:
|
||||||
"""Get a bare sqlalchemy session to interact with the database.
|
"""Get a bare sqlalchemy session to interact with the database.
|
||||||
|
|
||||||
|
137
reflex/state.py
137
reflex/state.py
@ -11,6 +11,7 @@ import inspect
|
|||||||
import json
|
import json
|
||||||
import pickle
|
import pickle
|
||||||
import sys
|
import sys
|
||||||
|
import time
|
||||||
import typing
|
import typing
|
||||||
import uuid
|
import uuid
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
@ -39,6 +40,7 @@ from typing import (
|
|||||||
get_type_hints,
|
get_type_hints,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from redis.asyncio.client import PubSub
|
||||||
from sqlalchemy.orm import DeclarativeBase
|
from sqlalchemy.orm import DeclarativeBase
|
||||||
from typing_extensions import Self
|
from typing_extensions import Self
|
||||||
|
|
||||||
@ -69,6 +71,11 @@ try:
|
|||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
BaseModelV1 = BaseModelV2
|
BaseModelV1 = BaseModelV2
|
||||||
|
|
||||||
|
try:
|
||||||
|
from pydantic.v1 import validator
|
||||||
|
except ModuleNotFoundError:
|
||||||
|
from pydantic import validator
|
||||||
|
|
||||||
import wrapt
|
import wrapt
|
||||||
from redis.asyncio import Redis
|
from redis.asyncio import Redis
|
||||||
from redis.exceptions import ResponseError
|
from redis.exceptions import ResponseError
|
||||||
@ -92,11 +99,13 @@ from reflex.utils.exceptions import (
|
|||||||
DynamicRouteArgShadowsStateVar,
|
DynamicRouteArgShadowsStateVar,
|
||||||
EventHandlerShadowsBuiltInStateMethod,
|
EventHandlerShadowsBuiltInStateMethod,
|
||||||
ImmutableStateError,
|
ImmutableStateError,
|
||||||
|
InvalidLockWarningThresholdError,
|
||||||
InvalidStateManagerMode,
|
InvalidStateManagerMode,
|
||||||
LockExpiredError,
|
LockExpiredError,
|
||||||
ReflexRuntimeError,
|
ReflexRuntimeError,
|
||||||
SetUndefinedStateVarError,
|
SetUndefinedStateVarError,
|
||||||
StateSchemaMismatchError,
|
StateSchemaMismatchError,
|
||||||
|
StateSerializationError,
|
||||||
StateTooLargeError,
|
StateTooLargeError,
|
||||||
)
|
)
|
||||||
from reflex.utils.exec import is_testing_env
|
from reflex.utils.exec import is_testing_env
|
||||||
@ -438,7 +447,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
|
|||||||
Returns:
|
Returns:
|
||||||
The string representation of the state.
|
The string representation of the state.
|
||||||
"""
|
"""
|
||||||
return f"{self.__class__.__name__}({self.dict()})"
|
return f"{type(self).__name__}({self.dict()})"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _get_computed_vars(cls) -> list[ComputedVar]:
|
def _get_computed_vars(cls) -> list[ComputedVar]:
|
||||||
@ -1094,6 +1103,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
|
|||||||
if (
|
if (
|
||||||
not field.required
|
not field.required
|
||||||
and field.default is None
|
and field.default is None
|
||||||
|
and field.default_factory is None
|
||||||
and not types.is_optional(prop._var_type)
|
and not types.is_optional(prop._var_type)
|
||||||
):
|
):
|
||||||
# Ensure frontend uses null coalescing when accessing.
|
# Ensure frontend uses null coalescing when accessing.
|
||||||
@ -2121,14 +2131,26 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
|
|||||||
state["__dict__"].pop("router", None)
|
state["__dict__"].pop("router", None)
|
||||||
state["__dict__"].pop("router_data", None)
|
state["__dict__"].pop("router_data", None)
|
||||||
# Never serialize parent_state or substates.
|
# Never serialize parent_state or substates.
|
||||||
state["__dict__"]["parent_state"] = None
|
state["__dict__"].pop("parent_state", None)
|
||||||
state["__dict__"]["substates"] = {}
|
state["__dict__"].pop("substates", None)
|
||||||
state["__dict__"].pop("_was_touched", None)
|
state["__dict__"].pop("_was_touched", None)
|
||||||
# Remove all inherited vars.
|
# Remove all inherited vars.
|
||||||
for inherited_var_name in self.inherited_vars:
|
for inherited_var_name in self.inherited_vars:
|
||||||
state["__dict__"].pop(inherited_var_name, None)
|
state["__dict__"].pop(inherited_var_name, None)
|
||||||
return state
|
return state
|
||||||
|
|
||||||
|
def __setstate__(self, state: dict[str, Any]):
|
||||||
|
"""Set the state from redis deserialization.
|
||||||
|
|
||||||
|
This method is called by pickle to deserialize the object.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
state: The state dict for deserialization.
|
||||||
|
"""
|
||||||
|
state["__dict__"]["parent_state"] = None
|
||||||
|
state["__dict__"]["substates"] = {}
|
||||||
|
super().__setstate__(state)
|
||||||
|
|
||||||
def _check_state_size(
|
def _check_state_size(
|
||||||
self,
|
self,
|
||||||
pickle_state_size: int,
|
pickle_state_size: int,
|
||||||
@ -2193,8 +2215,12 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The serialized state.
|
The serialized state.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
StateSerializationError: If the state cannot be serialized.
|
||||||
"""
|
"""
|
||||||
payload = b""
|
payload = b""
|
||||||
|
error = ""
|
||||||
try:
|
try:
|
||||||
payload = pickle.dumps((self._to_schema(), self))
|
payload = pickle.dumps((self._to_schema(), self))
|
||||||
except HANDLED_PICKLE_ERRORS as og_pickle_error:
|
except HANDLED_PICKLE_ERRORS as og_pickle_error:
|
||||||
@ -2214,8 +2240,13 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
|
|||||||
except HANDLED_PICKLE_ERRORS as ex:
|
except HANDLED_PICKLE_ERRORS as ex:
|
||||||
error += f"Dill was also unable to pickle the state: {ex}"
|
error += f"Dill was also unable to pickle the state: {ex}"
|
||||||
console.warn(error)
|
console.warn(error)
|
||||||
|
|
||||||
if environment.REFLEX_PERF_MODE.get() != PerformanceMode.OFF:
|
if environment.REFLEX_PERF_MODE.get() != PerformanceMode.OFF:
|
||||||
self._check_state_size(len(payload))
|
self._check_state_size(len(payload))
|
||||||
|
|
||||||
|
if not payload:
|
||||||
|
raise StateSerializationError(error)
|
||||||
|
|
||||||
return payload
|
return payload
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -2809,6 +2840,7 @@ class StateManager(Base, ABC):
|
|||||||
redis=redis,
|
redis=redis,
|
||||||
token_expiration=config.redis_token_expiration,
|
token_expiration=config.redis_token_expiration,
|
||||||
lock_expiration=config.redis_lock_expiration,
|
lock_expiration=config.redis_lock_expiration,
|
||||||
|
lock_warning_threshold=config.redis_lock_warning_threshold,
|
||||||
)
|
)
|
||||||
raise InvalidStateManagerMode(
|
raise InvalidStateManagerMode(
|
||||||
f"Expected one of: DISK, MEMORY, REDIS, got {config.state_manager_mode}"
|
f"Expected one of: DISK, MEMORY, REDIS, got {config.state_manager_mode}"
|
||||||
@ -3178,6 +3210,15 @@ def _default_lock_expiration() -> int:
|
|||||||
return get_config().redis_lock_expiration
|
return get_config().redis_lock_expiration
|
||||||
|
|
||||||
|
|
||||||
|
def _default_lock_warning_threshold() -> int:
|
||||||
|
"""Get the default lock warning threshold.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The default lock warning threshold.
|
||||||
|
"""
|
||||||
|
return get_config().redis_lock_warning_threshold
|
||||||
|
|
||||||
|
|
||||||
class StateManagerRedis(StateManager):
|
class StateManagerRedis(StateManager):
|
||||||
"""A state manager that stores states in redis."""
|
"""A state manager that stores states in redis."""
|
||||||
|
|
||||||
@ -3190,6 +3231,11 @@ class StateManagerRedis(StateManager):
|
|||||||
# The maximum time to hold a lock (ms).
|
# The maximum time to hold a lock (ms).
|
||||||
lock_expiration: int = pydantic.Field(default_factory=_default_lock_expiration)
|
lock_expiration: int = pydantic.Field(default_factory=_default_lock_expiration)
|
||||||
|
|
||||||
|
# The maximum time to hold a lock (ms) before warning.
|
||||||
|
lock_warning_threshold: int = pydantic.Field(
|
||||||
|
default_factory=_default_lock_warning_threshold
|
||||||
|
)
|
||||||
|
|
||||||
# The keyspace subscription string when redis is waiting for lock to be released
|
# The keyspace subscription string when redis is waiting for lock to be released
|
||||||
_redis_notify_keyspace_events: str = (
|
_redis_notify_keyspace_events: str = (
|
||||||
"K" # Enable keyspace notifications (target a particular key)
|
"K" # Enable keyspace notifications (target a particular key)
|
||||||
@ -3377,6 +3423,17 @@ class StateManagerRedis(StateManager):
|
|||||||
f"`app.state_manager.lock_expiration` (currently {self.lock_expiration}) "
|
f"`app.state_manager.lock_expiration` (currently {self.lock_expiration}) "
|
||||||
"or use `@rx.event(background=True)` decorator for long-running tasks."
|
"or use `@rx.event(background=True)` decorator for long-running tasks."
|
||||||
)
|
)
|
||||||
|
elif lock_id is not None:
|
||||||
|
time_taken = self.lock_expiration / 1000 - (
|
||||||
|
await self.redis.ttl(self._lock_key(token))
|
||||||
|
)
|
||||||
|
if time_taken > self.lock_warning_threshold / 1000:
|
||||||
|
console.warn(
|
||||||
|
f"Lock for token {token} was held too long {time_taken=}s, "
|
||||||
|
f"use `@rx.event(background=True)` decorator for long-running tasks.",
|
||||||
|
dedupe=True,
|
||||||
|
)
|
||||||
|
|
||||||
client_token, substate_name = _split_substate_key(token)
|
client_token, substate_name = _split_substate_key(token)
|
||||||
# If the substate name on the token doesn't match the instance name, it cannot have a parent.
|
# If the substate name on the token doesn't match the instance name, it cannot have a parent.
|
||||||
if state.parent_state is not None and state.get_full_name() != substate_name:
|
if state.parent_state is not None and state.get_full_name() != substate_name:
|
||||||
@ -3426,6 +3483,27 @@ class StateManagerRedis(StateManager):
|
|||||||
yield state
|
yield state
|
||||||
await self.set_state(token, state, lock_id)
|
await self.set_state(token, state, lock_id)
|
||||||
|
|
||||||
|
@validator("lock_warning_threshold")
|
||||||
|
@classmethod
|
||||||
|
def validate_lock_warning_threshold(cls, lock_warning_threshold: int, values):
|
||||||
|
"""Validate the lock warning threshold.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
lock_warning_threshold: The lock warning threshold.
|
||||||
|
values: The validated attributes.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The lock warning threshold.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
InvalidLockWarningThresholdError: If the lock warning threshold is invalid.
|
||||||
|
"""
|
||||||
|
if lock_warning_threshold >= (lock_expiration := values["lock_expiration"]):
|
||||||
|
raise InvalidLockWarningThresholdError(
|
||||||
|
f"The lock warning threshold({lock_warning_threshold}) must be less than the lock expiration time({lock_expiration})."
|
||||||
|
)
|
||||||
|
return lock_warning_threshold
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _lock_key(token: str) -> bytes:
|
def _lock_key(token: str) -> bytes:
|
||||||
"""Get the redis key for a token's lock.
|
"""Get the redis key for a token's lock.
|
||||||
@ -3457,6 +3535,35 @@ class StateManagerRedis(StateManager):
|
|||||||
nx=True, # only set if it doesn't exist
|
nx=True, # only set if it doesn't exist
|
||||||
)
|
)
|
||||||
|
|
||||||
|
async def _get_pubsub_message(
|
||||||
|
self, pubsub: PubSub, timeout: float | None = None
|
||||||
|
) -> None:
|
||||||
|
"""Get lock release events from the pubsub.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
pubsub: The pubsub to get a message from.
|
||||||
|
timeout: Remaining time to wait for a message.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The message.
|
||||||
|
"""
|
||||||
|
if timeout is None:
|
||||||
|
timeout = self.lock_expiration / 1000.0
|
||||||
|
|
||||||
|
started = time.time()
|
||||||
|
message = await pubsub.get_message(
|
||||||
|
ignore_subscribe_messages=True,
|
||||||
|
timeout=timeout,
|
||||||
|
)
|
||||||
|
if (
|
||||||
|
message is None
|
||||||
|
or message["data"] not in self._redis_keyspace_lock_release_events
|
||||||
|
):
|
||||||
|
remaining = timeout - (time.time() - started)
|
||||||
|
if remaining <= 0:
|
||||||
|
return
|
||||||
|
await self._get_pubsub_message(pubsub, timeout=remaining)
|
||||||
|
|
||||||
async def _wait_lock(self, lock_key: bytes, lock_id: bytes) -> None:
|
async def _wait_lock(self, lock_key: bytes, lock_id: bytes) -> None:
|
||||||
"""Wait for a redis lock to be released via pubsub.
|
"""Wait for a redis lock to be released via pubsub.
|
||||||
|
|
||||||
@ -3469,7 +3576,6 @@ class StateManagerRedis(StateManager):
|
|||||||
Raises:
|
Raises:
|
||||||
ResponseError: when the keyspace config cannot be set.
|
ResponseError: when the keyspace config cannot be set.
|
||||||
"""
|
"""
|
||||||
state_is_locked = False
|
|
||||||
lock_key_channel = f"__keyspace@0__:{lock_key.decode()}"
|
lock_key_channel = f"__keyspace@0__:{lock_key.decode()}"
|
||||||
# Enable keyspace notifications for the lock key, so we know when it is available.
|
# Enable keyspace notifications for the lock key, so we know when it is available.
|
||||||
try:
|
try:
|
||||||
@ -3483,20 +3589,13 @@ class StateManagerRedis(StateManager):
|
|||||||
raise
|
raise
|
||||||
async with self.redis.pubsub() as pubsub:
|
async with self.redis.pubsub() as pubsub:
|
||||||
await pubsub.psubscribe(lock_key_channel)
|
await pubsub.psubscribe(lock_key_channel)
|
||||||
while not state_is_locked:
|
# wait for the lock to be released
|
||||||
# wait for the lock to be released
|
while True:
|
||||||
while True:
|
# fast path
|
||||||
if not await self.redis.exists(lock_key):
|
if await self._try_get_lock(lock_key, lock_id):
|
||||||
break # key was removed, try to get the lock again
|
return
|
||||||
message = await pubsub.get_message(
|
# wait for lock events
|
||||||
ignore_subscribe_messages=True,
|
await self._get_pubsub_message(pubsub)
|
||||||
timeout=self.lock_expiration / 1000.0,
|
|
||||||
)
|
|
||||||
if message is None:
|
|
||||||
continue
|
|
||||||
if message["data"] in self._redis_keyspace_lock_release_events:
|
|
||||||
break
|
|
||||||
state_is_locked = await self._try_get_lock(lock_key, lock_id)
|
|
||||||
|
|
||||||
@contextlib.asynccontextmanager
|
@contextlib.asynccontextmanager
|
||||||
async def _lock(self, token: str):
|
async def _lock(self, token: str):
|
||||||
@ -3618,7 +3717,7 @@ class MutableProxy(wrapt.ObjectProxy):
|
|||||||
Returns:
|
Returns:
|
||||||
The representation of the wrapped object.
|
The representation of the wrapped object.
|
||||||
"""
|
"""
|
||||||
return f"{self.__class__.__name__}({self.__wrapped__})"
|
return f"{type(self).__name__}({self.__wrapped__})"
|
||||||
|
|
||||||
def _mark_dirty(
|
def _mark_dirty(
|
||||||
self,
|
self,
|
||||||
|
@ -138,9 +138,6 @@ def convert_item(
|
|||||||
if isinstance(style_item, Var):
|
if isinstance(style_item, Var):
|
||||||
return style_item, style_item._get_all_var_data()
|
return style_item, style_item._get_all_var_data()
|
||||||
|
|
||||||
# if isinstance(style_item, str) and REFLEX_VAR_OPENING_TAG not in style_item:
|
|
||||||
# return style_item, None
|
|
||||||
|
|
||||||
# Otherwise, convert to Var to collapse VarData encoded in f-string.
|
# Otherwise, convert to Var to collapse VarData encoded in f-string.
|
||||||
new_var = LiteralVar.create(style_item)
|
new_var = LiteralVar.create(style_item)
|
||||||
var_data = new_var._get_all_var_data() if new_var is not None else None
|
var_data = new_var._get_all_var_data() if new_var is not None else None
|
||||||
|
@ -206,7 +206,7 @@ class AppHarness:
|
|||||||
The full state name
|
The full state name
|
||||||
"""
|
"""
|
||||||
# NOTE: using State.get_name() somehow causes trouble here
|
# NOTE: using State.get_name() somehow causes trouble here
|
||||||
# path = [State.get_name()] + [self.get_state_name(p) for p in path]
|
# path = [State.get_name()] + [self.get_state_name(p) for p in path] # noqa: ERA001
|
||||||
path = ["reflex___state____state"] + [self.get_state_name(p) for p in path]
|
path = ["reflex___state____state"] + [self.get_state_name(p) for p in path]
|
||||||
return ".".join(path)
|
return ".".join(path)
|
||||||
|
|
||||||
@ -436,7 +436,6 @@ class AppHarness:
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The rendered app global code.
|
The rendered app global code.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if not inspect.isclass(value) and not inspect.isfunction(value):
|
if not inspect.isclass(value) and not inspect.isfunction(value):
|
||||||
return f"{key} = {value!r}"
|
return f"{key} = {value!r}"
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user