reflex 0.8.15a2__py3-none-any.whl → 0.8.16a1__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/app.py +40 -46
- reflex/app_mixins/lifespan.py +12 -5
- reflex/base.py +1 -0
- reflex/compiler/compiler.py +4 -6
- reflex/compiler/templates.py +25 -31
- reflex/compiler/utils.py +6 -5
- reflex/components/base/body.pyi +1 -195
- reflex/components/base/link.pyi +1 -407
- reflex/components/base/meta.pyi +1 -405
- reflex/components/base/script.pyi +1 -237
- reflex/components/component.py +41 -46
- reflex/components/core/auto_scroll.pyi +1 -195
- reflex/components/core/banner.pyi +1 -391
- reflex/components/core/breakpoints.py +14 -18
- reflex/components/core/html.pyi +1 -197
- reflex/components/core/match.py +2 -2
- reflex/components/core/sticky.py +11 -15
- reflex/components/core/sticky.pyi +0 -788
- reflex/components/core/upload.py +1 -3
- reflex/components/datadisplay/code.pyi +1 -0
- reflex/components/datadisplay/dataeditor.py +4 -6
- reflex/components/datadisplay/shiki_code_block.py +106 -110
- reflex/components/dynamic.py +4 -6
- reflex/components/el/elements/__init__.py +5 -7
- reflex/components/el/elements/__init__.pyi +5 -7
- reflex/components/el/elements/base.py +1 -1
- reflex/components/el/elements/base.pyi +1 -195
- reflex/components/el/elements/forms.py +7 -9
- reflex/components/el/elements/forms.pyi +12 -3112
- reflex/components/el/elements/inline.pyi +0 -5481
- reflex/components/el/elements/media.pyi +0 -10280
- reflex/components/el/elements/metadata.pyi +1 -835
- reflex/components/el/elements/other.pyi +1 -1365
- reflex/components/el/elements/scripts.pyi +1 -625
- reflex/components/el/elements/sectioning.pyi +1 -2911
- reflex/components/el/elements/tables.pyi +1 -1973
- reflex/components/el/elements/typography.pyi +1 -3125
- reflex/components/lucide/icon.py +4 -4
- reflex/components/lucide/icon.pyi +0 -4
- reflex/components/markdown/markdown.py +15 -19
- reflex/components/markdown/markdown.pyi +1 -0
- reflex/components/moment/moment.pyi +0 -49
- reflex/components/props.py +3 -3
- reflex/components/radix/primitives/accordion.py +4 -6
- reflex/components/radix/primitives/accordion.pyi +0 -14
- reflex/components/radix/primitives/base.pyi +0 -5
- reflex/components/radix/primitives/dialog.py +2 -0
- reflex/components/radix/primitives/dialog.pyi +1 -233
- reflex/components/radix/primitives/drawer.pyi +0 -18
- reflex/components/radix/primitives/form.pyi +30 -632
- reflex/components/radix/primitives/progress.pyi +0 -10
- reflex/components/radix/primitives/slider.pyi +0 -10
- reflex/components/radix/themes/color_mode.pyi +1 -284
- reflex/components/radix/themes/components/alert_dialog.pyi +0 -207
- reflex/components/radix/themes/components/aspect_ratio.pyi +0 -2
- reflex/components/radix/themes/components/avatar.pyi +0 -80
- reflex/components/radix/themes/components/badge.pyi +1 -270
- reflex/components/radix/themes/components/button.pyi +1 -274
- reflex/components/radix/themes/components/callout.pyi +0 -1197
- reflex/components/radix/themes/components/card.pyi +1 -209
- reflex/components/radix/themes/components/checkbox.pyi +0 -261
- reflex/components/radix/themes/components/checkbox_cards.pyi +1 -96
- reflex/components/radix/themes/components/checkbox_group.pyi +1 -80
- reflex/components/radix/themes/components/context_menu.pyi +13 -321
- reflex/components/radix/themes/components/data_list.pyi +1 -107
- reflex/components/radix/themes/components/dialog.pyi +1 -210
- reflex/components/radix/themes/components/dropdown_menu.pyi +0 -209
- reflex/components/radix/themes/components/hover_card.pyi +1 -246
- reflex/components/radix/themes/components/icon_button.pyi +1 -195
- reflex/components/radix/themes/components/inset.pyi +0 -252
- reflex/components/radix/themes/components/popover.pyi +1 -234
- reflex/components/radix/themes/components/progress.pyi +1 -84
- reflex/components/radix/themes/components/radio.pyi +1 -72
- reflex/components/radix/themes/components/radio_cards.pyi +1 -123
- reflex/components/radix/themes/components/scroll_area.pyi +1 -11
- reflex/components/radix/themes/components/select.pyi +1 -376
- reflex/components/radix/themes/components/separator.pyi +0 -77
- reflex/components/radix/themes/components/skeleton.pyi +0 -30
- reflex/components/radix/themes/components/slider.py +3 -5
- reflex/components/radix/themes/components/spinner.pyi +0 -5
- reflex/components/radix/themes/components/switch.pyi +0 -89
- reflex/components/radix/themes/components/table.pyi +0 -1453
- reflex/components/radix/themes/components/text_area.pyi +7 -282
- reflex/components/radix/themes/components/text_field.pyi +6 -392
- reflex/components/radix/themes/components/tooltip.pyi +0 -42
- reflex/components/radix/themes/layout/box.pyi +1 -195
- reflex/components/radix/themes/layout/center.pyi +0 -194
- reflex/components/radix/themes/layout/container.pyi +0 -178
- reflex/components/radix/themes/layout/flex.pyi +0 -194
- reflex/components/radix/themes/layout/grid.pyi +0 -194
- reflex/components/radix/themes/layout/list.pyi +0 -978
- reflex/components/radix/themes/layout/section.pyi +0 -194
- reflex/components/radix/themes/layout/spacer.pyi +0 -194
- reflex/components/radix/themes/layout/stack.pyi +0 -582
- reflex/components/radix/themes/typography/blockquote.pyi +0 -196
- reflex/components/radix/themes/typography/code.pyi +0 -194
- reflex/components/radix/themes/typography/heading.pyi +0 -194
- reflex/components/radix/themes/typography/link.pyi +0 -237
- reflex/components/radix/themes/typography/text.pyi +0 -1360
- reflex/components/react_router/dom.pyi +0 -237
- reflex/components/recharts/cartesian.py +12 -18
- reflex/components/recharts/general.py +12 -18
- reflex/constants/installer.py +5 -5
- reflex/custom_components/custom_components.py +6 -5
- reflex/environment.py +30 -7
- reflex/event.py +14 -12
- reflex/experimental/client_state.py +11 -12
- reflex/istate/data.py +8 -10
- reflex/istate/manager/__init__.py +3 -0
- reflex/istate/manager/disk.py +151 -5
- reflex/model.py +1 -1
- reflex/plugins/_screenshot.py +2 -2
- reflex/plugins/shared_tailwind.py +9 -14
- reflex/reflex.py +7 -9
- reflex/state.py +30 -37
- reflex/style.py +6 -6
- reflex/testing.py +54 -30
- reflex/utils/codespaces.py +1 -1
- reflex/utils/compat.py +1 -0
- reflex/utils/decorator.py +3 -3
- reflex/utils/format.py +18 -22
- reflex/utils/prerequisites.py +1 -1
- reflex/utils/pyi_generator.py +51 -57
- reflex/utils/serializers.py +1 -1
- reflex/utils/telemetry.py +1 -1
- reflex/utils/templates.py +4 -4
- reflex/utils/types.py +3 -3
- reflex/vars/base.py +26 -29
- reflex/vars/color.py +6 -8
- reflex/vars/dep_tracking.py +5 -3
- reflex/vars/function.py +3 -3
- reflex/vars/object.py +9 -13
- reflex/vars/sequence.py +18 -24
- {reflex-0.8.15a2.dist-info → reflex-0.8.16a1.dist-info}/METADATA +1 -1
- {reflex-0.8.15a2.dist-info → reflex-0.8.16a1.dist-info}/RECORD +138 -138
- {reflex-0.8.15a2.dist-info → reflex-0.8.16a1.dist-info}/WHEEL +0 -0
- {reflex-0.8.15a2.dist-info → reflex-0.8.16a1.dist-info}/entry_points.txt +0 -0
- {reflex-0.8.15a2.dist-info → reflex-0.8.16a1.dist-info}/licenses/LICENSE +0 -0
reflex/components/core/upload.py
CHANGED
|
@@ -188,9 +188,7 @@ def _default_drop_rejected(rejected_files: ArrayVar[list[dict[str, Any]]]) -> Ev
|
|
|
188
188
|
rf = rf.to(ObjectVar, dict[str, dict[str, Any]])
|
|
189
189
|
file = rf["file"].to(ObjectVar, dict[str, Any])
|
|
190
190
|
errors = rf["errors"].to(ArrayVar, list[dict[str, Any]])
|
|
191
|
-
return (
|
|
192
|
-
f"{file['path']}: {errors.foreach(lambda err: err['message']).join(', ')}"
|
|
193
|
-
)
|
|
191
|
+
return f"{file['path']}: {errors.foreach(lambda kv: kv['message']).join(', ')}" # noqa: FURB118
|
|
194
192
|
|
|
195
193
|
return toast.error(
|
|
196
194
|
title="Files not Accepted",
|
|
@@ -369,12 +369,10 @@ class DataEditor(NoSSRComponent):
|
|
|
369
369
|
columns_path = str(self.columns)
|
|
370
370
|
data_path = str(self.data)
|
|
371
371
|
|
|
372
|
-
code.extend(
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
]
|
|
377
|
-
)
|
|
372
|
+
code.extend([
|
|
373
|
+
f" return formatDataEditorCells(col, row, {columns_path}, {data_path});",
|
|
374
|
+
" }",
|
|
375
|
+
])
|
|
378
376
|
|
|
379
377
|
return ["\n".join(code)]
|
|
380
378
|
|
|
@@ -431,89 +431,87 @@ class ShikiJsTransformer(ShikiBaseTransformers):
|
|
|
431
431
|
]
|
|
432
432
|
)
|
|
433
433
|
style: Style | None = dataclasses.field(
|
|
434
|
-
default_factory=lambda: Style(
|
|
435
|
-
{
|
|
436
|
-
"
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
"
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
"
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
"
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
"
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
"
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
"
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
"
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
"
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
"
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
"
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
"
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
}
|
|
516
|
-
)
|
|
434
|
+
default_factory=lambda: Style({
|
|
435
|
+
"code": {
|
|
436
|
+
"line-height": "1.7",
|
|
437
|
+
"font-size": "0.875em",
|
|
438
|
+
"display": "grid",
|
|
439
|
+
},
|
|
440
|
+
# Diffs
|
|
441
|
+
".diff": {
|
|
442
|
+
"margin": "0 -24px",
|
|
443
|
+
"padding": "0 24px",
|
|
444
|
+
"width": "calc(100% + 48px)",
|
|
445
|
+
"display": "inline-block",
|
|
446
|
+
},
|
|
447
|
+
".diff.add": {
|
|
448
|
+
"background-color": "rgba(16, 185, 129, .14)",
|
|
449
|
+
"position": "relative",
|
|
450
|
+
},
|
|
451
|
+
".diff.remove": {
|
|
452
|
+
"background-color": "rgba(244, 63, 94, .14)",
|
|
453
|
+
"opacity": "0.7",
|
|
454
|
+
"position": "relative",
|
|
455
|
+
},
|
|
456
|
+
".diff.remove:after": {
|
|
457
|
+
"position": "absolute",
|
|
458
|
+
"left": "10px",
|
|
459
|
+
"content": "'-'",
|
|
460
|
+
"color": "#b34e52",
|
|
461
|
+
},
|
|
462
|
+
".diff.add:after": {
|
|
463
|
+
"position": "absolute",
|
|
464
|
+
"left": "10px",
|
|
465
|
+
"content": "'+'",
|
|
466
|
+
"color": "#18794e",
|
|
467
|
+
},
|
|
468
|
+
# Highlight
|
|
469
|
+
".highlighted": {
|
|
470
|
+
"background-color": "rgba(142, 150, 170, .14)",
|
|
471
|
+
"margin": "0 -24px",
|
|
472
|
+
"padding": "0 24px",
|
|
473
|
+
"width": "calc(100% + 48px)",
|
|
474
|
+
"display": "inline-block",
|
|
475
|
+
},
|
|
476
|
+
".highlighted.error": {
|
|
477
|
+
"background-color": "rgba(244, 63, 94, .14)",
|
|
478
|
+
},
|
|
479
|
+
".highlighted.warning": {
|
|
480
|
+
"background-color": "rgba(234, 179, 8, .14)",
|
|
481
|
+
},
|
|
482
|
+
# Highlighted Word
|
|
483
|
+
".highlighted-word": {
|
|
484
|
+
"background-color": color("gray", 2),
|
|
485
|
+
"border": f"1px solid {color('gray', 5)}",
|
|
486
|
+
"padding": "1px 3px",
|
|
487
|
+
"margin": "-1px -3px",
|
|
488
|
+
"border-radius": "4px",
|
|
489
|
+
},
|
|
490
|
+
# Focused Lines
|
|
491
|
+
".has-focused .line:not(.focused)": {
|
|
492
|
+
"opacity": "0.7",
|
|
493
|
+
"filter": "blur(0.095rem)",
|
|
494
|
+
"transition": "filter .35s, opacity .35s",
|
|
495
|
+
},
|
|
496
|
+
".has-focused:hover .line:not(.focused)": {
|
|
497
|
+
"opacity": "1",
|
|
498
|
+
"filter": "none",
|
|
499
|
+
},
|
|
500
|
+
# White Space
|
|
501
|
+
# ".tab, .space": {
|
|
502
|
+
# "position": "relative", # noqa: ERA001
|
|
503
|
+
# },
|
|
504
|
+
# ".tab::before": {
|
|
505
|
+
# "content": "'⇥'", # noqa: ERA001
|
|
506
|
+
# "position": "absolute", # noqa: ERA001
|
|
507
|
+
# "opacity": "0.3",# noqa: ERA001
|
|
508
|
+
# },
|
|
509
|
+
# ".space::before": {
|
|
510
|
+
# "content": "'·'", # noqa: ERA001
|
|
511
|
+
# "position": "absolute", # noqa: ERA001
|
|
512
|
+
# "opacity": "0.3", # noqa: ERA001
|
|
513
|
+
# },
|
|
514
|
+
})
|
|
517
515
|
)
|
|
518
516
|
|
|
519
517
|
def __init__(self, **kwargs):
|
|
@@ -640,9 +638,9 @@ class ShikiCodeBlock(Component, MarkdownComponentMap):
|
|
|
640
638
|
raise ValueError(msg)
|
|
641
639
|
for transformer in self.transformers._var_value:
|
|
642
640
|
if isinstance(transformer, ShikiBaseTransformers):
|
|
643
|
-
imports[transformer.library].extend(
|
|
644
|
-
|
|
645
|
-
)
|
|
641
|
+
imports[transformer.library].extend([
|
|
642
|
+
ImportVar(tag=str(fn)) for fn in transformer.fns
|
|
643
|
+
])
|
|
646
644
|
if transformer.library not in self.lib_dependencies:
|
|
647
645
|
self.lib_dependencies.append(transformer.library)
|
|
648
646
|
return imports
|
|
@@ -780,30 +778,28 @@ class ShikiHighLevelCodeBlock(ShikiCodeBlock):
|
|
|
780
778
|
set_clipboard(cls._strip_transformer_triggers(code)),
|
|
781
779
|
copy_script(),
|
|
782
780
|
],
|
|
783
|
-
style=Style(
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
"
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
"
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
"
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
}
|
|
806
|
-
),
|
|
781
|
+
style=Style({
|
|
782
|
+
"position": "absolute",
|
|
783
|
+
"top": "4px",
|
|
784
|
+
"right": "4px",
|
|
785
|
+
"background": color("gray", 3),
|
|
786
|
+
"border": "1px solid",
|
|
787
|
+
"border-color": color("gray", 5),
|
|
788
|
+
"border-radius": "6px",
|
|
789
|
+
"padding": "5px",
|
|
790
|
+
"opacity": "1",
|
|
791
|
+
"cursor": "pointer",
|
|
792
|
+
"_hover": {
|
|
793
|
+
"background": color("gray", 4),
|
|
794
|
+
},
|
|
795
|
+
"transition": "background 0.250s ease-out",
|
|
796
|
+
"&>svg": {
|
|
797
|
+
"transition": "transform 0.250s ease-out, opacity 0.250s ease-out",
|
|
798
|
+
},
|
|
799
|
+
"_active": {
|
|
800
|
+
"background": color("gray", 5),
|
|
801
|
+
},
|
|
802
|
+
}),
|
|
807
803
|
)
|
|
808
804
|
)
|
|
809
805
|
|
reflex/components/dynamic.py
CHANGED
|
@@ -161,12 +161,10 @@ def load_dynamic_serializer():
|
|
|
161
161
|
)
|
|
162
162
|
]
|
|
163
163
|
|
|
164
|
-
return "\n".join(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
]
|
|
169
|
-
)
|
|
164
|
+
return "\n".join([
|
|
165
|
+
"//__reflex_evaluate",
|
|
166
|
+
*module_code_lines,
|
|
167
|
+
])
|
|
170
168
|
|
|
171
169
|
@transform
|
|
172
170
|
def evaluate_component(js_string: Var[str]) -> Var[Component]:
|
|
@@ -144,13 +144,11 @@ EXCLUDE = ["del_", "Del", "image", "style"]
|
|
|
144
144
|
for v in _MAPPING.values():
|
|
145
145
|
from reflex.utils.format import to_camel_case
|
|
146
146
|
|
|
147
|
-
v.extend(
|
|
148
|
-
[
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
]
|
|
153
|
-
)
|
|
147
|
+
v.extend([
|
|
148
|
+
to_camel_case(mod)[0].upper() + to_camel_case(mod)[1:]
|
|
149
|
+
for mod in v
|
|
150
|
+
if mod not in EXCLUDE
|
|
151
|
+
])
|
|
154
152
|
|
|
155
153
|
_MAPPING["metadata"].extend(["StyleEl"])
|
|
156
154
|
|
|
@@ -395,13 +395,11 @@ EXCLUDE = ["del_", "Del", "image", "style"]
|
|
|
395
395
|
for v in _MAPPING.values():
|
|
396
396
|
from reflex.utils.format import to_camel_case
|
|
397
397
|
|
|
398
|
-
v.extend(
|
|
399
|
-
[
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
]
|
|
404
|
-
)
|
|
398
|
+
v.extend([
|
|
399
|
+
to_camel_case(mod)[0].upper() + to_camel_case(mod)[1:]
|
|
400
|
+
for mod in v
|
|
401
|
+
if mod not in EXCLUDE
|
|
402
|
+
])
|
|
405
403
|
_MAPPING["metadata"].extend(["StyleEl"])
|
|
406
404
|
|
|
407
405
|
__all__ = [
|
|
@@ -6,7 +6,7 @@ from reflex.components.el.element import Element
|
|
|
6
6
|
from reflex.vars.base import Var
|
|
7
7
|
|
|
8
8
|
AutoCapitalize = Literal["off", "none", "on", "sentences", "words", "characters"]
|
|
9
|
-
ContentEditable = Literal[
|
|
9
|
+
ContentEditable = Literal["inherit", "plaintext-only"] | bool
|
|
10
10
|
EnterKeyHint = Literal["enter", "done", "go", "next", "previous", "search", "send"]
|
|
11
11
|
InputMode = Literal[
|
|
12
12
|
"none", "text", "tel", "url", "email", "numeric", "decimal", "search", "search"
|
|
@@ -12,7 +12,7 @@ from reflex.event import EventType, PointerEventInfo
|
|
|
12
12
|
from reflex.vars.base import Var
|
|
13
13
|
|
|
14
14
|
AutoCapitalize = Literal["off", "none", "on", "sentences", "words", "characters"]
|
|
15
|
-
ContentEditable = Literal[
|
|
15
|
+
ContentEditable = Literal["inherit", "plaintext-only"] | bool
|
|
16
16
|
EnterKeyHint = Literal["enter", "done", "go", "next", "previous", "search", "send"]
|
|
17
17
|
InputMode = Literal[
|
|
18
18
|
"none", "text", "tel", "url", "email", "numeric", "decimal", "search", "search"
|
|
@@ -94,184 +94,6 @@ class BaseHTML(Element):
|
|
|
94
94
|
def create(
|
|
95
95
|
cls,
|
|
96
96
|
*children,
|
|
97
|
-
access_key: Var[str] | str | None = None,
|
|
98
|
-
auto_capitalize: Literal[
|
|
99
|
-
"characters", "none", "off", "on", "sentences", "words"
|
|
100
|
-
]
|
|
101
|
-
| Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
|
|
102
|
-
| None = None,
|
|
103
|
-
content_editable: Literal["inherit", "plaintext-only", False, True]
|
|
104
|
-
| Var[Literal["inherit", "plaintext-only", False, True]]
|
|
105
|
-
| None = None,
|
|
106
|
-
context_menu: Var[str] | str | None = None,
|
|
107
|
-
dir: Var[str] | str | None = None,
|
|
108
|
-
draggable: Var[bool] | bool | None = None,
|
|
109
|
-
enter_key_hint: Literal[
|
|
110
|
-
"done", "enter", "go", "next", "previous", "search", "send"
|
|
111
|
-
]
|
|
112
|
-
| Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
|
|
113
|
-
| None = None,
|
|
114
|
-
hidden: Var[bool] | bool | None = None,
|
|
115
|
-
input_mode: Literal[
|
|
116
|
-
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
|
|
117
|
-
]
|
|
118
|
-
| Var[
|
|
119
|
-
Literal[
|
|
120
|
-
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
|
|
121
|
-
]
|
|
122
|
-
]
|
|
123
|
-
| None = None,
|
|
124
|
-
item_prop: Var[str] | str | None = None,
|
|
125
|
-
lang: Var[str] | str | None = None,
|
|
126
|
-
role: Literal[
|
|
127
|
-
"alert",
|
|
128
|
-
"alertdialog",
|
|
129
|
-
"application",
|
|
130
|
-
"article",
|
|
131
|
-
"banner",
|
|
132
|
-
"button",
|
|
133
|
-
"cell",
|
|
134
|
-
"checkbox",
|
|
135
|
-
"columnheader",
|
|
136
|
-
"combobox",
|
|
137
|
-
"complementary",
|
|
138
|
-
"contentinfo",
|
|
139
|
-
"definition",
|
|
140
|
-
"dialog",
|
|
141
|
-
"directory",
|
|
142
|
-
"document",
|
|
143
|
-
"feed",
|
|
144
|
-
"figure",
|
|
145
|
-
"form",
|
|
146
|
-
"grid",
|
|
147
|
-
"gridcell",
|
|
148
|
-
"group",
|
|
149
|
-
"heading",
|
|
150
|
-
"img",
|
|
151
|
-
"link",
|
|
152
|
-
"list",
|
|
153
|
-
"listbox",
|
|
154
|
-
"listitem",
|
|
155
|
-
"log",
|
|
156
|
-
"main",
|
|
157
|
-
"marquee",
|
|
158
|
-
"math",
|
|
159
|
-
"menu",
|
|
160
|
-
"menubar",
|
|
161
|
-
"menuitem",
|
|
162
|
-
"menuitemcheckbox",
|
|
163
|
-
"menuitemradio",
|
|
164
|
-
"navigation",
|
|
165
|
-
"none",
|
|
166
|
-
"note",
|
|
167
|
-
"option",
|
|
168
|
-
"presentation",
|
|
169
|
-
"progressbar",
|
|
170
|
-
"radio",
|
|
171
|
-
"radiogroup",
|
|
172
|
-
"region",
|
|
173
|
-
"row",
|
|
174
|
-
"rowgroup",
|
|
175
|
-
"rowheader",
|
|
176
|
-
"scrollbar",
|
|
177
|
-
"search",
|
|
178
|
-
"searchbox",
|
|
179
|
-
"separator",
|
|
180
|
-
"slider",
|
|
181
|
-
"spinbutton",
|
|
182
|
-
"status",
|
|
183
|
-
"switch",
|
|
184
|
-
"tab",
|
|
185
|
-
"table",
|
|
186
|
-
"tablist",
|
|
187
|
-
"tabpanel",
|
|
188
|
-
"term",
|
|
189
|
-
"textbox",
|
|
190
|
-
"timer",
|
|
191
|
-
"toolbar",
|
|
192
|
-
"tooltip",
|
|
193
|
-
"tree",
|
|
194
|
-
"treegrid",
|
|
195
|
-
"treeitem",
|
|
196
|
-
]
|
|
197
|
-
| Var[
|
|
198
|
-
Literal[
|
|
199
|
-
"alert",
|
|
200
|
-
"alertdialog",
|
|
201
|
-
"application",
|
|
202
|
-
"article",
|
|
203
|
-
"banner",
|
|
204
|
-
"button",
|
|
205
|
-
"cell",
|
|
206
|
-
"checkbox",
|
|
207
|
-
"columnheader",
|
|
208
|
-
"combobox",
|
|
209
|
-
"complementary",
|
|
210
|
-
"contentinfo",
|
|
211
|
-
"definition",
|
|
212
|
-
"dialog",
|
|
213
|
-
"directory",
|
|
214
|
-
"document",
|
|
215
|
-
"feed",
|
|
216
|
-
"figure",
|
|
217
|
-
"form",
|
|
218
|
-
"grid",
|
|
219
|
-
"gridcell",
|
|
220
|
-
"group",
|
|
221
|
-
"heading",
|
|
222
|
-
"img",
|
|
223
|
-
"link",
|
|
224
|
-
"list",
|
|
225
|
-
"listbox",
|
|
226
|
-
"listitem",
|
|
227
|
-
"log",
|
|
228
|
-
"main",
|
|
229
|
-
"marquee",
|
|
230
|
-
"math",
|
|
231
|
-
"menu",
|
|
232
|
-
"menubar",
|
|
233
|
-
"menuitem",
|
|
234
|
-
"menuitemcheckbox",
|
|
235
|
-
"menuitemradio",
|
|
236
|
-
"navigation",
|
|
237
|
-
"none",
|
|
238
|
-
"note",
|
|
239
|
-
"option",
|
|
240
|
-
"presentation",
|
|
241
|
-
"progressbar",
|
|
242
|
-
"radio",
|
|
243
|
-
"radiogroup",
|
|
244
|
-
"region",
|
|
245
|
-
"row",
|
|
246
|
-
"rowgroup",
|
|
247
|
-
"rowheader",
|
|
248
|
-
"scrollbar",
|
|
249
|
-
"search",
|
|
250
|
-
"searchbox",
|
|
251
|
-
"separator",
|
|
252
|
-
"slider",
|
|
253
|
-
"spinbutton",
|
|
254
|
-
"status",
|
|
255
|
-
"switch",
|
|
256
|
-
"tab",
|
|
257
|
-
"table",
|
|
258
|
-
"tablist",
|
|
259
|
-
"tabpanel",
|
|
260
|
-
"term",
|
|
261
|
-
"textbox",
|
|
262
|
-
"timer",
|
|
263
|
-
"toolbar",
|
|
264
|
-
"tooltip",
|
|
265
|
-
"tree",
|
|
266
|
-
"treegrid",
|
|
267
|
-
"treeitem",
|
|
268
|
-
]
|
|
269
|
-
]
|
|
270
|
-
| None = None,
|
|
271
|
-
slot: Var[str] | str | None = None,
|
|
272
|
-
spell_check: Var[bool] | bool | None = None,
|
|
273
|
-
tab_index: Var[int] | int | None = None,
|
|
274
|
-
title: Var[str] | str | None = None,
|
|
275
97
|
style: Sequence[Mapping[str, Any]]
|
|
276
98
|
| Mapping[str, Any]
|
|
277
99
|
| Var[Mapping[str, Any]]
|
|
@@ -304,22 +126,6 @@ class BaseHTML(Element):
|
|
|
304
126
|
|
|
305
127
|
Args:
|
|
306
128
|
*children: The children of the component.
|
|
307
|
-
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
308
|
-
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
309
|
-
content_editable: Indicates whether the element's content is editable.
|
|
310
|
-
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
311
|
-
dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
|
|
312
|
-
draggable: Defines whether the element can be dragged.
|
|
313
|
-
enter_key_hint: Hints what media types the media element is able to play.
|
|
314
|
-
hidden: Defines whether the element is hidden.
|
|
315
|
-
input_mode: Defines the type of the element.
|
|
316
|
-
item_prop: Defines the name of the element for metadata purposes.
|
|
317
|
-
lang: Defines the language used in the element.
|
|
318
|
-
role: Defines the role of the element.
|
|
319
|
-
slot: Assigns a slot in a shadow DOM shadow tree to an element.
|
|
320
|
-
spell_check: Defines whether the element may be checked for spelling errors.
|
|
321
|
-
tab_index: Defines the position of the current element in the tabbing order.
|
|
322
|
-
title: Defines a tooltip for the element.
|
|
323
129
|
style: The style of the component.
|
|
324
130
|
key: A unique key for the component.
|
|
325
131
|
id: The id for the component.
|
|
@@ -229,14 +229,12 @@ class Form(BaseHTML):
|
|
|
229
229
|
def _render(self) -> Tag:
|
|
230
230
|
render_tag = super()._render()
|
|
231
231
|
if EventTriggers.ON_SUBMIT in self.event_triggers:
|
|
232
|
-
render_tag = render_tag.add_props(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}
|
|
239
|
-
)
|
|
232
|
+
render_tag = render_tag.add_props(**{
|
|
233
|
+
EventTriggers.ON_SUBMIT: Var(
|
|
234
|
+
_js_expr=f"handleSubmit_{self.handle_submit_unique_name}",
|
|
235
|
+
_var_type=EventChain,
|
|
236
|
+
)
|
|
237
|
+
})
|
|
240
238
|
return render_tag
|
|
241
239
|
|
|
242
240
|
def _get_form_refs(self) -> dict[str, Any]:
|
|
@@ -319,7 +317,7 @@ class BaseInput(BaseHTML):
|
|
|
319
317
|
auto_focus: Var[bool]
|
|
320
318
|
|
|
321
319
|
# Captures media from the user (camera or microphone)
|
|
322
|
-
capture: Var[Literal[
|
|
320
|
+
capture: Var[Literal["user", "environment"] | bool]
|
|
323
321
|
|
|
324
322
|
# Indicates whether the input is checked (for checkboxes and radio buttons)
|
|
325
323
|
checked: Var[bool]
|