reflex 0.4.2a1__py3-none-any.whl → 0.4.3a2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of reflex might be problematic. Click here for more details.
- reflex/.templates/apps/blank/code/blank.py +1 -1
- reflex/.templates/apps/sidebar/README.md +3 -2
- reflex/.templates/apps/sidebar/assets/reflex_white.svg +8 -0
- reflex/.templates/apps/sidebar/code/components/sidebar.py +26 -22
- reflex/.templates/apps/sidebar/code/pages/dashboard.py +6 -5
- reflex/.templates/apps/sidebar/code/pages/settings.py +45 -6
- reflex/.templates/apps/sidebar/code/styles.py +15 -17
- reflex/.templates/apps/sidebar/code/templates/__init__.py +1 -1
- reflex/.templates/apps/sidebar/code/templates/template.py +54 -40
- reflex/.templates/jinja/custom_components/README.md.jinja2 +9 -0
- reflex/.templates/jinja/custom_components/__init__.py.jinja2 +1 -0
- reflex/.templates/jinja/custom_components/demo_app.py.jinja2 +36 -0
- reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 +35 -0
- reflex/.templates/jinja/custom_components/src.py.jinja2 +57 -0
- reflex/.templates/jinja/web/utils/context.js.jinja2 +26 -6
- reflex/.templates/web/utils/state.js +206 -146
- reflex/app.py +21 -18
- reflex/compiler/compiler.py +6 -2
- reflex/compiler/templates.py +17 -0
- reflex/compiler/utils.py +2 -2
- reflex/components/core/__init__.py +2 -1
- reflex/components/core/banner.py +99 -11
- reflex/components/core/banner.pyi +215 -2
- reflex/components/el/elements/__init__.py +1 -0
- reflex/components/el/elements/forms.py +6 -0
- reflex/components/el/elements/forms.pyi +4 -0
- reflex/components/markdown/markdown.py +13 -25
- reflex/components/markdown/markdown.pyi +5 -5
- reflex/components/plotly/plotly.py +3 -0
- reflex/components/plotly/plotly.pyi +2 -0
- reflex/components/radix/primitives/drawer.py +3 -7
- reflex/components/radix/themes/components/select.py +4 -4
- reflex/components/radix/themes/components/text_field.pyi +4 -0
- reflex/constants/__init__.py +4 -0
- reflex/constants/colors.py +1 -0
- reflex/constants/compiler.py +4 -3
- reflex/constants/custom_components.py +30 -0
- reflex/custom_components/__init__.py +1 -0
- reflex/custom_components/custom_components.py +565 -0
- reflex/reflex.py +11 -2
- reflex/route.py +4 -0
- reflex/state.py +594 -124
- reflex/testing.py +6 -0
- reflex/utils/exec.py +9 -0
- reflex/utils/prerequisites.py +28 -2
- reflex/utils/telemetry.py +3 -1
- reflex/utils/types.py +23 -0
- reflex/vars.py +48 -17
- reflex/vars.pyi +8 -3
- {reflex-0.4.2a1.dist-info → reflex-0.4.3a2.dist-info}/METADATA +4 -2
- {reflex-0.4.2a1.dist-info → reflex-0.4.3a2.dist-info}/RECORD +55 -51
- {reflex-0.4.2a1.dist-info → reflex-0.4.3a2.dist-info}/WHEEL +1 -1
- reflex/components/base/bare.pyi +0 -84
- reflex/constants/base.pyi +0 -94
- reflex/constants/event.pyi +0 -59
- reflex/constants/route.pyi +0 -50
- reflex/constants/style.pyi +0 -20
- /reflex/.templates/apps/sidebar/assets/{icon.svg → reflex_black.svg} +0 -0
- {reflex-0.4.2a1.dist-info → reflex-0.4.3a2.dist-info}/LICENSE +0 -0
- {reflex-0.4.2a1.dist-info → reflex-0.4.3a2.dist-info}/entry_points.txt +0 -0
reflex/app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""The main Reflex app."""
|
|
2
|
+
|
|
2
3
|
from __future__ import annotations
|
|
3
4
|
|
|
4
5
|
import asyncio
|
|
@@ -36,7 +37,7 @@ from reflex.admin import AdminDash
|
|
|
36
37
|
from reflex.base import Base
|
|
37
38
|
from reflex.compiler import compiler
|
|
38
39
|
from reflex.compiler import utils as compiler_utils
|
|
39
|
-
from reflex.components import connection_modal
|
|
40
|
+
from reflex.components import connection_modal, connection_pulser
|
|
40
41
|
from reflex.components.base.app_wrap import AppWrap
|
|
41
42
|
from reflex.components.base.fragment import Fragment
|
|
42
43
|
from reflex.components.component import (
|
|
@@ -69,9 +70,11 @@ from reflex.state import (
|
|
|
69
70
|
State,
|
|
70
71
|
StateManager,
|
|
71
72
|
StateUpdate,
|
|
73
|
+
_substate_key,
|
|
72
74
|
code_uses_state_contexts,
|
|
73
75
|
)
|
|
74
76
|
from reflex.utils import console, exceptions, format, prerequisites, types
|
|
77
|
+
from reflex.utils.exec import is_testing_env
|
|
75
78
|
from reflex.utils.imports import ImportVar
|
|
76
79
|
|
|
77
80
|
# Define custom types.
|
|
@@ -85,7 +88,7 @@ def default_overlay_component() -> Component:
|
|
|
85
88
|
Returns:
|
|
86
89
|
The default overlay_component, which is a connection_modal.
|
|
87
90
|
"""
|
|
88
|
-
return connection_modal()
|
|
91
|
+
return Fragment.create(connection_pulser(), connection_modal())
|
|
89
92
|
|
|
90
93
|
|
|
91
94
|
class App(Base):
|
|
@@ -159,10 +162,9 @@ class App(Base):
|
|
|
159
162
|
)
|
|
160
163
|
super().__init__(*args, **kwargs)
|
|
161
164
|
state_subclasses = BaseState.__subclasses__()
|
|
162
|
-
is_testing_env = constants.PYTEST_CURRENT_TEST in os.environ
|
|
163
165
|
|
|
164
166
|
# Special case to allow test cases have multiple subclasses of rx.BaseState.
|
|
165
|
-
if not is_testing_env:
|
|
167
|
+
if not is_testing_env():
|
|
166
168
|
# Only one Base State class is allowed.
|
|
167
169
|
if len(state_subclasses) > 1:
|
|
168
170
|
raise ValueError(
|
|
@@ -176,7 +178,8 @@ class App(Base):
|
|
|
176
178
|
deprecation_version="0.3.5",
|
|
177
179
|
removal_version="0.5.0",
|
|
178
180
|
)
|
|
179
|
-
if
|
|
181
|
+
# 2 substates are built-in and not considered when determining if app is stateless.
|
|
182
|
+
if len(State.class_subclasses) > 2:
|
|
180
183
|
self.state = State
|
|
181
184
|
# Get the config
|
|
182
185
|
config = get_config()
|
|
@@ -196,9 +199,11 @@ class App(Base):
|
|
|
196
199
|
# Set up the Socket.IO AsyncServer.
|
|
197
200
|
self.sio = AsyncServer(
|
|
198
201
|
async_mode="asgi",
|
|
199
|
-
cors_allowed_origins=
|
|
200
|
-
|
|
201
|
-
|
|
202
|
+
cors_allowed_origins=(
|
|
203
|
+
"*"
|
|
204
|
+
if config.cors_allowed_origins == ["*"]
|
|
205
|
+
else config.cors_allowed_origins
|
|
206
|
+
),
|
|
202
207
|
cors_credentials=True,
|
|
203
208
|
max_http_buffer_size=constants.POLLING_MAX_HTTP_BUFFER_SIZE,
|
|
204
209
|
ping_interval=constants.Ping.INTERVAL,
|
|
@@ -374,7 +379,7 @@ class App(Base):
|
|
|
374
379
|
raise TypeError(
|
|
375
380
|
"You may be trying to use an invalid Python function on a state var. "
|
|
376
381
|
"When referencing a var inside your render code, only limited var operations are supported. "
|
|
377
|
-
"See the var operation docs here: https://reflex.dev/docs/
|
|
382
|
+
"See the var operation docs here: https://reflex.dev/docs/vars/var-operations/"
|
|
378
383
|
) from e
|
|
379
384
|
raise e
|
|
380
385
|
|
|
@@ -385,10 +390,9 @@ class App(Base):
|
|
|
385
390
|
title: str = constants.DefaultPage.TITLE,
|
|
386
391
|
description: str = constants.DefaultPage.DESCRIPTION,
|
|
387
392
|
image: str = constants.DefaultPage.IMAGE,
|
|
388
|
-
on_load:
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
| None = None,
|
|
393
|
+
on_load: (
|
|
394
|
+
EventHandler | EventSpec | list[EventHandler | EventSpec] | None
|
|
395
|
+
) = None,
|
|
392
396
|
meta: list[dict[str, str]] = constants.DefaultPage.META_LIST,
|
|
393
397
|
script_tags: list[Component] | None = None,
|
|
394
398
|
):
|
|
@@ -518,10 +522,9 @@ class App(Base):
|
|
|
518
522
|
title: str = constants.Page404.TITLE,
|
|
519
523
|
image: str = constants.Page404.IMAGE,
|
|
520
524
|
description: str = constants.Page404.DESCRIPTION,
|
|
521
|
-
on_load:
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
| None = None,
|
|
525
|
+
on_load: (
|
|
526
|
+
EventHandler | EventSpec | list[EventHandler | EventSpec] | None
|
|
527
|
+
) = None,
|
|
525
528
|
meta: list[dict[str, str]] = constants.DefaultPage.META_LIST,
|
|
526
529
|
):
|
|
527
530
|
"""Define a custom 404 page for any url having no match.
|
|
@@ -1002,7 +1005,7 @@ def upload(app: App):
|
|
|
1002
1005
|
)
|
|
1003
1006
|
|
|
1004
1007
|
# Get the state for the session.
|
|
1005
|
-
substate_token = token
|
|
1008
|
+
substate_token = _substate_key(token, handler.rpartition(".")[0])
|
|
1006
1009
|
state = await app.state_manager.get_state(substate_token)
|
|
1007
1010
|
|
|
1008
1011
|
# get the current session ID
|
reflex/compiler/compiler.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Compiler for the reflex apps."""
|
|
2
|
+
|
|
2
3
|
from __future__ import annotations
|
|
3
4
|
|
|
4
5
|
import os
|
|
@@ -78,18 +79,21 @@ def _compile_contexts(state: Optional[Type[BaseState]], theme: Component) -> str
|
|
|
78
79
|
Returns:
|
|
79
80
|
The compiled context file.
|
|
80
81
|
"""
|
|
82
|
+
appearance = getattr(theme, "appearance", None)
|
|
83
|
+
if appearance is None:
|
|
84
|
+
appearance = LIGHT_COLOR_MODE
|
|
81
85
|
return (
|
|
82
86
|
templates.CONTEXT.render(
|
|
83
87
|
initial_state=utils.compile_state(state),
|
|
84
88
|
state_name=state.get_name(),
|
|
85
89
|
client_storage=utils.compile_client_storage(state),
|
|
86
90
|
is_dev_mode=_is_dev_mode(),
|
|
87
|
-
default_color_mode=
|
|
91
|
+
default_color_mode=appearance,
|
|
88
92
|
)
|
|
89
93
|
if state
|
|
90
94
|
else templates.CONTEXT.render(
|
|
91
95
|
is_dev_mode=_is_dev_mode(),
|
|
92
|
-
default_color_mode=
|
|
96
|
+
default_color_mode=appearance,
|
|
93
97
|
)
|
|
94
98
|
)
|
|
95
99
|
|
reflex/compiler/templates.py
CHANGED
|
@@ -98,3 +98,20 @@ STYLE = get_template("web/styles/styles.css.jinja2")
|
|
|
98
98
|
|
|
99
99
|
# Code that generate the package json file
|
|
100
100
|
PACKAGE_JSON = get_template("web/package.json.jinja2")
|
|
101
|
+
|
|
102
|
+
# Code that generate the pyproject.toml file for custom components
|
|
103
|
+
CUSTOM_COMPONENTS_PYPROJECT_TOML = get_template(
|
|
104
|
+
"custom_components/pyproject.toml.jinja2"
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
# Code that generates the README file for custom components
|
|
108
|
+
CUSTOM_COMPONENTS_README = get_template("custom_components/README.md.jinja2")
|
|
109
|
+
|
|
110
|
+
# Code that generates the source file for custom components
|
|
111
|
+
CUSTOM_COMPONENTS_SOURCE = get_template("custom_components/src.py.jinja2")
|
|
112
|
+
|
|
113
|
+
# Code that generates the init file for custom components
|
|
114
|
+
CUSTOM_COMPONENTS_INIT_FILE = get_template("custom_components/__init__.py.jinja2")
|
|
115
|
+
|
|
116
|
+
# Code that generates the demo app main py file for testing custom components
|
|
117
|
+
CUSTOM_COMPONENTS_DEMO_APP = get_template("custom_components/demo_app.py.jinja2")
|
reflex/compiler/utils.py
CHANGED
|
@@ -138,12 +138,12 @@ def compile_state(state: Type[BaseState]) -> dict:
|
|
|
138
138
|
A dictionary of the compiled state.
|
|
139
139
|
"""
|
|
140
140
|
try:
|
|
141
|
-
initial_state = state().dict()
|
|
141
|
+
initial_state = state(_reflex_internal_init=True).dict(initial=True)
|
|
142
142
|
except Exception as e:
|
|
143
143
|
console.warn(
|
|
144
144
|
f"Failed to compile initial state with computed vars, excluding them: {e}"
|
|
145
145
|
)
|
|
146
|
-
initial_state = state().dict(include_computed=False)
|
|
146
|
+
initial_state = state(_reflex_internal_init=True).dict(include_computed=False)
|
|
147
147
|
return format.format_state(initial_state)
|
|
148
148
|
|
|
149
149
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Core Reflex components."""
|
|
2
2
|
|
|
3
3
|
from . import layout as layout
|
|
4
|
-
from .banner import ConnectionBanner, ConnectionModal
|
|
4
|
+
from .banner import ConnectionBanner, ConnectionModal, ConnectionPulser
|
|
5
5
|
from .colors import color
|
|
6
6
|
from .cond import Cond, color_mode_cond, cond
|
|
7
7
|
from .debounce import DebounceInput
|
|
@@ -26,6 +26,7 @@ from .upload import (
|
|
|
26
26
|
|
|
27
27
|
connection_banner = ConnectionBanner.create
|
|
28
28
|
connection_modal = ConnectionModal.create
|
|
29
|
+
connection_pulser = ConnectionPulser.create
|
|
29
30
|
debounce_input = DebounceInput.create
|
|
30
31
|
foreach = Foreach.create
|
|
31
32
|
html = Html.create
|
reflex/components/core/banner.py
CHANGED
|
@@ -7,14 +7,17 @@ from typing import Optional
|
|
|
7
7
|
from reflex.components.base.bare import Bare
|
|
8
8
|
from reflex.components.component import Component
|
|
9
9
|
from reflex.components.core.cond import cond
|
|
10
|
+
from reflex.components.el.elements.typography import Div
|
|
11
|
+
from reflex.components.lucide.icon import Icon
|
|
10
12
|
from reflex.components.radix.themes.components.dialog import (
|
|
11
13
|
DialogContent,
|
|
12
14
|
DialogRoot,
|
|
13
15
|
DialogTitle,
|
|
14
16
|
)
|
|
15
|
-
from reflex.components.radix.themes.layout import
|
|
17
|
+
from reflex.components.radix.themes.layout import Flex
|
|
16
18
|
from reflex.components.radix.themes.typography.text import Text
|
|
17
19
|
from reflex.constants import Dirs, Hooks, Imports
|
|
20
|
+
from reflex.state import State
|
|
18
21
|
from reflex.utils import imports
|
|
19
22
|
from reflex.vars import Var, VarData
|
|
20
23
|
|
|
@@ -24,12 +27,24 @@ connect_error_var_data: VarData = VarData( # type: ignore
|
|
|
24
27
|
)
|
|
25
28
|
|
|
26
29
|
connection_error: Var = Var.create_safe(
|
|
27
|
-
value="(
|
|
30
|
+
value="(connectErrors.length > 0) ? connectErrors[connectErrors.length - 1].message : ''",
|
|
28
31
|
_var_is_local=False,
|
|
29
32
|
_var_is_string=False,
|
|
30
33
|
)._replace(merge_var_data=connect_error_var_data)
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
|
|
35
|
+
connection_errors_count: Var = Var.create_safe(
|
|
36
|
+
value="connectErrors.length",
|
|
37
|
+
_var_is_string=False,
|
|
38
|
+
_var_is_local=False,
|
|
39
|
+
)._replace(merge_var_data=connect_error_var_data)
|
|
40
|
+
|
|
41
|
+
has_connection_errors: Var = Var.create_safe(
|
|
42
|
+
value="connectErrors.length > 0",
|
|
43
|
+
_var_is_string=False,
|
|
44
|
+
)._replace(_var_type=bool, merge_var_data=connect_error_var_data)
|
|
45
|
+
|
|
46
|
+
has_too_many_connection_errors: Var = Var.create_safe(
|
|
47
|
+
value="connectErrors.length >= 2",
|
|
33
48
|
_var_is_string=False,
|
|
34
49
|
)._replace(_var_type=bool, merge_var_data=connect_error_var_data)
|
|
35
50
|
|
|
@@ -81,16 +96,20 @@ class ConnectionBanner(Component):
|
|
|
81
96
|
The connection banner component.
|
|
82
97
|
"""
|
|
83
98
|
if not comp:
|
|
84
|
-
comp =
|
|
99
|
+
comp = Flex.create(
|
|
85
100
|
Text.create(
|
|
86
101
|
*default_connection_error(),
|
|
87
|
-
|
|
88
|
-
|
|
102
|
+
color="black",
|
|
103
|
+
size="4",
|
|
89
104
|
),
|
|
90
|
-
|
|
105
|
+
justify="center",
|
|
106
|
+
background_color="crimson",
|
|
107
|
+
width="100vw",
|
|
108
|
+
padding="5px",
|
|
109
|
+
position="fixed",
|
|
91
110
|
)
|
|
92
111
|
|
|
93
|
-
return cond(
|
|
112
|
+
return cond(has_connection_errors, comp)
|
|
94
113
|
|
|
95
114
|
|
|
96
115
|
class ConnectionModal(Component):
|
|
@@ -109,12 +128,81 @@ class ConnectionModal(Component):
|
|
|
109
128
|
if not comp:
|
|
110
129
|
comp = Text.create(*default_connection_error())
|
|
111
130
|
return cond(
|
|
112
|
-
|
|
131
|
+
has_too_many_connection_errors,
|
|
113
132
|
DialogRoot.create(
|
|
114
133
|
DialogContent.create(
|
|
115
134
|
DialogTitle.create("Connection Error"),
|
|
116
135
|
comp,
|
|
117
136
|
),
|
|
118
|
-
open=
|
|
137
|
+
open=has_too_many_connection_errors,
|
|
138
|
+
z_index=9999,
|
|
139
|
+
),
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
class WifiOffPulse(Icon):
|
|
144
|
+
"""A wifi_off icon with an animated opacity pulse."""
|
|
145
|
+
|
|
146
|
+
@classmethod
|
|
147
|
+
def create(cls, **props) -> Component:
|
|
148
|
+
"""Create a wifi_off icon with an animated opacity pulse.
|
|
149
|
+
|
|
150
|
+
Args:
|
|
151
|
+
**props: The properties of the component.
|
|
152
|
+
|
|
153
|
+
Returns:
|
|
154
|
+
The icon component with default props applied.
|
|
155
|
+
"""
|
|
156
|
+
return super().create(
|
|
157
|
+
"wifi_off",
|
|
158
|
+
color=props.pop("color", "crimson"),
|
|
159
|
+
size=props.pop("size", 32),
|
|
160
|
+
z_index=props.pop("z_index", 9999),
|
|
161
|
+
position=props.pop("position", "fixed"),
|
|
162
|
+
bottom=props.pop("botton", "30px"),
|
|
163
|
+
right=props.pop("right", "30px"),
|
|
164
|
+
animation=Var.create(f"${{pulse}} 1s infinite", _var_is_string=True),
|
|
165
|
+
**props,
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
def _get_imports(self) -> imports.ImportDict:
|
|
169
|
+
return imports.merge_imports(
|
|
170
|
+
super()._get_imports(),
|
|
171
|
+
{"@emotion/react": [imports.ImportVar(tag="keyframes")]},
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
def _get_custom_code(self) -> str | None:
|
|
175
|
+
return """
|
|
176
|
+
const pulse = keyframes`
|
|
177
|
+
0% {
|
|
178
|
+
opacity: 0;
|
|
179
|
+
}
|
|
180
|
+
100% {
|
|
181
|
+
opacity: 1;
|
|
182
|
+
}
|
|
183
|
+
`
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
class ConnectionPulser(Div):
|
|
188
|
+
"""A connection pulser component."""
|
|
189
|
+
|
|
190
|
+
@classmethod
|
|
191
|
+
def create(cls, **props) -> Component:
|
|
192
|
+
"""Create a connection pulser component.
|
|
193
|
+
|
|
194
|
+
Args:
|
|
195
|
+
**props: The properties of the component.
|
|
196
|
+
|
|
197
|
+
Returns:
|
|
198
|
+
The connection pulser component.
|
|
199
|
+
"""
|
|
200
|
+
return super().create(
|
|
201
|
+
cond(
|
|
202
|
+
~State.is_hydrated | has_connection_errors, # type: ignore
|
|
203
|
+
WifiOffPulse.create(**props),
|
|
119
204
|
),
|
|
205
|
+
position="fixed",
|
|
206
|
+
width="100vw",
|
|
207
|
+
height="0",
|
|
120
208
|
)
|
|
@@ -11,20 +11,25 @@ from typing import Optional
|
|
|
11
11
|
from reflex.components.base.bare import Bare
|
|
12
12
|
from reflex.components.component import Component
|
|
13
13
|
from reflex.components.core.cond import cond
|
|
14
|
+
from reflex.components.el.elements.typography import Div
|
|
15
|
+
from reflex.components.lucide.icon import Icon
|
|
14
16
|
from reflex.components.radix.themes.components.dialog import (
|
|
15
17
|
DialogContent,
|
|
16
18
|
DialogRoot,
|
|
17
19
|
DialogTitle,
|
|
18
20
|
)
|
|
19
|
-
from reflex.components.radix.themes.layout import
|
|
21
|
+
from reflex.components.radix.themes.layout import Flex
|
|
20
22
|
from reflex.components.radix.themes.typography.text import Text
|
|
21
23
|
from reflex.constants import Dirs, Hooks, Imports
|
|
24
|
+
from reflex.state import State
|
|
22
25
|
from reflex.utils import imports
|
|
23
26
|
from reflex.vars import Var, VarData
|
|
24
27
|
|
|
25
28
|
connect_error_var_data: VarData
|
|
26
29
|
connection_error: Var
|
|
27
|
-
|
|
30
|
+
connection_errors_count: Var
|
|
31
|
+
has_connection_errors: Var
|
|
32
|
+
has_too_many_connection_errors: Var
|
|
28
33
|
|
|
29
34
|
class WebsocketTargetURL(Bare):
|
|
30
35
|
@overload
|
|
@@ -232,3 +237,211 @@ class ConnectionModal(Component):
|
|
|
232
237
|
The connection banner component.
|
|
233
238
|
"""
|
|
234
239
|
...
|
|
240
|
+
|
|
241
|
+
class WifiOffPulse(Icon):
|
|
242
|
+
@overload
|
|
243
|
+
@classmethod
|
|
244
|
+
def create( # type: ignore
|
|
245
|
+
cls,
|
|
246
|
+
*children,
|
|
247
|
+
size: Optional[Union[Var[int], int]] = None,
|
|
248
|
+
style: Optional[Style] = None,
|
|
249
|
+
key: Optional[Any] = None,
|
|
250
|
+
id: Optional[Any] = None,
|
|
251
|
+
class_name: Optional[Any] = None,
|
|
252
|
+
autofocus: Optional[bool] = None,
|
|
253
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
254
|
+
on_blur: Optional[
|
|
255
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
256
|
+
] = None,
|
|
257
|
+
on_click: Optional[
|
|
258
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
259
|
+
] = None,
|
|
260
|
+
on_context_menu: Optional[
|
|
261
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
262
|
+
] = None,
|
|
263
|
+
on_double_click: Optional[
|
|
264
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
265
|
+
] = None,
|
|
266
|
+
on_focus: Optional[
|
|
267
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
268
|
+
] = None,
|
|
269
|
+
on_mount: Optional[
|
|
270
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
271
|
+
] = None,
|
|
272
|
+
on_mouse_down: Optional[
|
|
273
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
274
|
+
] = None,
|
|
275
|
+
on_mouse_enter: Optional[
|
|
276
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
277
|
+
] = None,
|
|
278
|
+
on_mouse_leave: Optional[
|
|
279
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
280
|
+
] = None,
|
|
281
|
+
on_mouse_move: Optional[
|
|
282
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
283
|
+
] = None,
|
|
284
|
+
on_mouse_out: Optional[
|
|
285
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
286
|
+
] = None,
|
|
287
|
+
on_mouse_over: Optional[
|
|
288
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
289
|
+
] = None,
|
|
290
|
+
on_mouse_up: Optional[
|
|
291
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
292
|
+
] = None,
|
|
293
|
+
on_scroll: Optional[
|
|
294
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
295
|
+
] = None,
|
|
296
|
+
on_unmount: Optional[
|
|
297
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
298
|
+
] = None,
|
|
299
|
+
**props
|
|
300
|
+
) -> "WifiOffPulse":
|
|
301
|
+
"""Create a wifi_off icon with an animated opacity pulse.
|
|
302
|
+
|
|
303
|
+
Args:
|
|
304
|
+
size: The size of the icon in pixels.
|
|
305
|
+
style: The style of the component.
|
|
306
|
+
key: A unique key for the component.
|
|
307
|
+
id: The id for the component.
|
|
308
|
+
class_name: The class name for the component.
|
|
309
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
310
|
+
custom_attrs: custom attribute
|
|
311
|
+
**props: The properties of the component.
|
|
312
|
+
|
|
313
|
+
Returns:
|
|
314
|
+
The icon component with default props applied.
|
|
315
|
+
"""
|
|
316
|
+
...
|
|
317
|
+
|
|
318
|
+
class ConnectionPulser(Div):
|
|
319
|
+
@overload
|
|
320
|
+
@classmethod
|
|
321
|
+
def create( # type: ignore
|
|
322
|
+
cls,
|
|
323
|
+
*children,
|
|
324
|
+
access_key: Optional[
|
|
325
|
+
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
326
|
+
] = None,
|
|
327
|
+
auto_capitalize: Optional[
|
|
328
|
+
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
329
|
+
] = None,
|
|
330
|
+
content_editable: Optional[
|
|
331
|
+
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
332
|
+
] = None,
|
|
333
|
+
context_menu: Optional[
|
|
334
|
+
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
335
|
+
] = None,
|
|
336
|
+
dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
337
|
+
draggable: Optional[
|
|
338
|
+
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
339
|
+
] = None,
|
|
340
|
+
enter_key_hint: Optional[
|
|
341
|
+
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
342
|
+
] = None,
|
|
343
|
+
hidden: Optional[
|
|
344
|
+
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
345
|
+
] = None,
|
|
346
|
+
input_mode: Optional[
|
|
347
|
+
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
348
|
+
] = None,
|
|
349
|
+
item_prop: Optional[
|
|
350
|
+
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
351
|
+
] = None,
|
|
352
|
+
lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
353
|
+
role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
354
|
+
slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
355
|
+
spell_check: Optional[
|
|
356
|
+
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
357
|
+
] = None,
|
|
358
|
+
tab_index: Optional[
|
|
359
|
+
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
360
|
+
] = None,
|
|
361
|
+
title: Optional[
|
|
362
|
+
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
363
|
+
] = None,
|
|
364
|
+
style: Optional[Style] = None,
|
|
365
|
+
key: Optional[Any] = None,
|
|
366
|
+
id: Optional[Any] = None,
|
|
367
|
+
class_name: Optional[Any] = None,
|
|
368
|
+
autofocus: Optional[bool] = None,
|
|
369
|
+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
370
|
+
on_blur: Optional[
|
|
371
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
372
|
+
] = None,
|
|
373
|
+
on_click: Optional[
|
|
374
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
375
|
+
] = None,
|
|
376
|
+
on_context_menu: Optional[
|
|
377
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
378
|
+
] = None,
|
|
379
|
+
on_double_click: Optional[
|
|
380
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
381
|
+
] = None,
|
|
382
|
+
on_focus: Optional[
|
|
383
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
384
|
+
] = None,
|
|
385
|
+
on_mount: Optional[
|
|
386
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
387
|
+
] = None,
|
|
388
|
+
on_mouse_down: Optional[
|
|
389
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
390
|
+
] = None,
|
|
391
|
+
on_mouse_enter: Optional[
|
|
392
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
393
|
+
] = None,
|
|
394
|
+
on_mouse_leave: Optional[
|
|
395
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
396
|
+
] = None,
|
|
397
|
+
on_mouse_move: Optional[
|
|
398
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
399
|
+
] = None,
|
|
400
|
+
on_mouse_out: Optional[
|
|
401
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
402
|
+
] = None,
|
|
403
|
+
on_mouse_over: Optional[
|
|
404
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
405
|
+
] = None,
|
|
406
|
+
on_mouse_up: Optional[
|
|
407
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
408
|
+
] = None,
|
|
409
|
+
on_scroll: Optional[
|
|
410
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
411
|
+
] = None,
|
|
412
|
+
on_unmount: Optional[
|
|
413
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
414
|
+
] = None,
|
|
415
|
+
**props
|
|
416
|
+
) -> "ConnectionPulser":
|
|
417
|
+
"""Create a connection pulser component.
|
|
418
|
+
|
|
419
|
+
Args:
|
|
420
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
421
|
+
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
422
|
+
content_editable: Indicates whether the element's content is editable.
|
|
423
|
+
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
424
|
+
dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
|
|
425
|
+
draggable: Defines whether the element can be dragged.
|
|
426
|
+
enter_key_hint: Hints what media types the media element is able to play.
|
|
427
|
+
hidden: Defines whether the element is hidden.
|
|
428
|
+
input_mode: Defines the type of the element.
|
|
429
|
+
item_prop: Defines the name of the element for metadata purposes.
|
|
430
|
+
lang: Defines the language used in the element.
|
|
431
|
+
role: Defines the role of the element.
|
|
432
|
+
slot: Assigns a slot in a shadow DOM shadow tree to an element.
|
|
433
|
+
spell_check: Defines whether the element may be checked for spelling errors.
|
|
434
|
+
tab_index: Defines the position of the current element in the tabbing order.
|
|
435
|
+
title: Defines a tooltip for the element.
|
|
436
|
+
style: The style of the component.
|
|
437
|
+
key: A unique key for the component.
|
|
438
|
+
id: The id for the component.
|
|
439
|
+
class_name: The class name for the component.
|
|
440
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
441
|
+
custom_attrs: custom attribute
|
|
442
|
+
**props: The properties of the component.
|
|
443
|
+
|
|
444
|
+
Returns:
|
|
445
|
+
The connection pulser component.
|
|
446
|
+
"""
|
|
447
|
+
...
|
|
@@ -125,6 +125,12 @@ class Input(BaseHTML):
|
|
|
125
125
|
# Indicates whether the input is checked (for checkboxes and radio buttons)
|
|
126
126
|
checked: Var[Union[str, int, bool]]
|
|
127
127
|
|
|
128
|
+
# The initial value (for checkboxes and radio buttons)
|
|
129
|
+
default_checked: Var[bool]
|
|
130
|
+
|
|
131
|
+
# The initial value for a text field
|
|
132
|
+
default_value: Var[str]
|
|
133
|
+
|
|
128
134
|
# Name part of the input to submit in 'dir' and 'name' pair when form is submitted
|
|
129
135
|
dirname: Var[Union[str, int, bool]]
|
|
130
136
|
|
|
@@ -598,6 +598,8 @@ class Input(BaseHTML):
|
|
|
598
598
|
checked: Optional[
|
|
599
599
|
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
600
600
|
] = None,
|
|
601
|
+
default_checked: Optional[Union[Var[bool], bool]] = None,
|
|
602
|
+
default_value: Optional[Union[Var[str], str]] = None,
|
|
601
603
|
dirname: Optional[
|
|
602
604
|
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
603
605
|
] = None,
|
|
@@ -767,6 +769,8 @@ class Input(BaseHTML):
|
|
|
767
769
|
auto_focus: Automatically focuses the input when the page loads
|
|
768
770
|
capture: Captures media from the user (camera or microphone)
|
|
769
771
|
checked: Indicates whether the input is checked (for checkboxes and radio buttons)
|
|
772
|
+
default_checked: The initial value (for checkboxes and radio buttons)
|
|
773
|
+
default_value: The initial value for a text field
|
|
770
774
|
dirname: Name part of the input to submit in 'dir' and 'name' pair when form is submitted
|
|
771
775
|
disabled: Disables the input
|
|
772
776
|
form: Associates the input with a form (by id)
|