reflex 0.6.4a3__py3-none-any.whl → 0.6.5__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/jinja/web/pages/custom_component.js.jinja2 +0 -14
- reflex/.templates/jinja/web/pages/utils.js.jinja2 +4 -8
- reflex/.templates/web/components/shiki/code.js +16 -11
- reflex/.templates/web/utils/state.js +29 -21
- reflex/__init__.py +4 -0
- reflex/__init__.pyi +4 -0
- reflex/app.py +148 -154
- reflex/app_mixins/lifespan.py +5 -1
- reflex/app_mixins/middleware.py +3 -1
- reflex/app_mixins/mixin.py +3 -2
- reflex/base.py +2 -4
- reflex/compiler/compiler.py +111 -37
- reflex/components/base/app_wrap.pyi +17 -17
- reflex/components/base/bare.py +72 -3
- reflex/components/base/body.pyi +17 -17
- reflex/components/base/document.pyi +81 -81
- reflex/components/base/error_boundary.pyi +25 -18
- reflex/components/base/fragment.pyi +17 -17
- reflex/components/base/head.pyi +33 -33
- reflex/components/base/link.pyi +33 -33
- reflex/components/base/meta.pyi +65 -65
- reflex/components/base/script.py +4 -4
- reflex/components/base/script.pyi +23 -20
- reflex/components/component.py +250 -31
- reflex/components/core/banner.py +1 -1
- reflex/components/core/banner.pyi +81 -81
- reflex/components/core/client_side_routing.pyi +33 -33
- reflex/components/core/clipboard.py +2 -2
- reflex/components/core/clipboard.pyi +24 -18
- reflex/components/core/debounce.py +2 -2
- reflex/components/core/debounce.pyi +18 -18
- reflex/components/core/html.pyi +17 -17
- reflex/components/core/upload.py +90 -28
- reflex/components/core/upload.pyi +128 -72
- reflex/components/datadisplay/code.py +55 -40
- reflex/components/datadisplay/code.pyi +46 -44
- reflex/components/datadisplay/dataeditor.py +21 -20
- reflex/components/datadisplay/dataeditor.pyi +103 -35
- reflex/components/datadisplay/shiki_code_block.py +60 -27
- reflex/components/datadisplay/shiki_code_block.pyi +86 -65
- reflex/components/dynamic.py +9 -5
- reflex/components/el/element.pyi +17 -17
- reflex/components/el/elements/base.pyi +17 -17
- reflex/components/el/elements/forms.py +12 -3
- reflex/components/el/elements/forms.pyi +293 -233
- reflex/components/el/elements/inline.pyi +449 -449
- reflex/components/el/elements/media.pyi +401 -401
- reflex/components/el/elements/metadata.pyi +97 -97
- reflex/components/el/elements/other.pyi +113 -113
- reflex/components/el/elements/scripts.pyi +49 -49
- reflex/components/el/elements/sectioning.pyi +241 -241
- reflex/components/el/elements/tables.pyi +161 -161
- reflex/components/el/elements/typography.pyi +241 -241
- reflex/components/gridjs/datatable.pyi +33 -33
- reflex/components/lucide/icon.py +1 -1
- reflex/components/lucide/icon.pyi +33 -33
- reflex/components/markdown/markdown.py +180 -49
- reflex/components/markdown/markdown.pyi +36 -19
- reflex/components/moment/moment.py +17 -21
- reflex/components/moment/moment.pyi +26 -21
- reflex/components/next/base.pyi +17 -17
- reflex/components/next/image.py +3 -3
- reflex/components/next/image.pyi +21 -19
- reflex/components/next/link.pyi +17 -17
- reflex/components/next/video.pyi +17 -17
- reflex/components/plotly/plotly.py +79 -78
- reflex/components/plotly/plotly.pyi +91 -41
- reflex/components/props.py +34 -0
- reflex/components/radix/primitives/accordion.py +15 -8
- reflex/components/radix/primitives/accordion.pyi +121 -118
- reflex/components/radix/primitives/base.pyi +33 -33
- reflex/components/radix/primitives/drawer.py +41 -20
- reflex/components/radix/primitives/drawer.pyi +279 -190
- reflex/components/radix/primitives/form.py +2 -2
- reflex/components/radix/primitives/form.pyi +200 -167
- reflex/components/radix/primitives/progress.pyi +81 -81
- reflex/components/radix/primitives/slider.pyi +89 -83
- reflex/components/radix/themes/base.py +30 -1
- reflex/components/radix/themes/base.pyi +286 -113
- reflex/components/radix/themes/color_mode.py +17 -9
- reflex/components/radix/themes/color_mode.pyi +68 -56
- reflex/components/radix/themes/components/alert_dialog.py +8 -5
- reflex/components/radix/themes/components/alert_dialog.pyi +125 -117
- reflex/components/radix/themes/components/aspect_ratio.pyi +17 -17
- reflex/components/radix/themes/components/avatar.py +1 -5
- reflex/components/radix/themes/components/avatar.pyi +17 -17
- reflex/components/radix/themes/components/badge.py +1 -5
- reflex/components/radix/themes/components/badge.pyi +17 -17
- reflex/components/radix/themes/components/button.pyi +18 -21
- reflex/components/radix/themes/components/callout.py +1 -4
- reflex/components/radix/themes/components/callout.pyi +81 -81
- reflex/components/radix/themes/components/card.py +1 -3
- reflex/components/radix/themes/components/card.pyi +17 -17
- reflex/components/radix/themes/components/checkbox.py +4 -8
- reflex/components/radix/themes/components/checkbox.pyi +61 -52
- reflex/components/radix/themes/components/checkbox_cards.pyi +33 -33
- reflex/components/radix/themes/components/checkbox_group.pyi +33 -33
- reflex/components/radix/themes/components/context_menu.py +121 -28
- reflex/components/radix/themes/components/context_menu.pyi +250 -147
- reflex/components/radix/themes/components/data_list.pyi +65 -65
- reflex/components/radix/themes/components/dialog.py +11 -11
- reflex/components/radix/themes/components/dialog.pyi +135 -120
- reflex/components/radix/themes/components/dropdown_menu.py +14 -25
- reflex/components/radix/themes/components/dropdown_menu.pyi +157 -145
- reflex/components/radix/themes/components/hover_card.py +19 -7
- reflex/components/radix/themes/components/hover_card.pyi +102 -67
- reflex/components/radix/themes/components/icon_button.pyi +18 -21
- reflex/components/radix/themes/components/inset.py +1 -3
- reflex/components/radix/themes/components/inset.pyi +17 -17
- reflex/components/radix/themes/components/popover.py +22 -13
- reflex/components/radix/themes/components/popover.pyi +98 -72
- reflex/components/radix/themes/components/progress.pyi +17 -17
- reflex/components/radix/themes/components/radio.pyi +17 -17
- reflex/components/radix/themes/components/radio_cards.py +2 -2
- reflex/components/radix/themes/components/radio_cards.pyi +37 -34
- reflex/components/radix/themes/components/radio_group.py +3 -7
- reflex/components/radix/themes/components/radio_group.pyi +69 -66
- reflex/components/radix/themes/components/scroll_area.py +1 -3
- reflex/components/radix/themes/components/scroll_area.pyi +17 -17
- reflex/components/radix/themes/components/segmented_control.pyi +37 -34
- reflex/components/radix/themes/components/select.py +7 -11
- reflex/components/radix/themes/components/select.pyi +175 -154
- reflex/components/radix/themes/components/separator.py +1 -4
- reflex/components/radix/themes/components/separator.pyi +17 -17
- reflex/components/radix/themes/components/skeleton.pyi +17 -17
- reflex/components/radix/themes/components/slider.py +12 -21
- reflex/components/radix/themes/components/slider.pyi +47 -25
- reflex/components/radix/themes/components/spinner.py +1 -4
- reflex/components/radix/themes/components/spinner.pyi +17 -17
- reflex/components/radix/themes/components/switch.py +3 -6
- reflex/components/radix/themes/components/switch.pyi +21 -18
- reflex/components/radix/themes/components/table.py +21 -5
- reflex/components/radix/themes/components/table.pyi +392 -116
- reflex/components/radix/themes/components/tabs.py +3 -6
- reflex/components/radix/themes/components/tabs.pyi +89 -83
- reflex/components/radix/themes/components/text_area.py +1 -5
- reflex/components/radix/themes/components/text_area.pyi +43 -20
- reflex/components/radix/themes/components/text_field.py +1 -5
- reflex/components/radix/themes/components/text_field.pyi +101 -55
- reflex/components/radix/themes/components/tooltip.py +5 -7
- reflex/components/radix/themes/components/tooltip.pyi +25 -22
- reflex/components/radix/themes/layout/base.py +2 -27
- reflex/components/radix/themes/layout/base.pyi +82 -82
- reflex/components/radix/themes/layout/box.pyi +17 -17
- reflex/components/radix/themes/layout/center.pyi +17 -17
- reflex/components/radix/themes/layout/container.pyi +17 -17
- reflex/components/radix/themes/layout/flex.py +1 -6
- reflex/components/radix/themes/layout/flex.pyi +17 -17
- reflex/components/radix/themes/layout/grid.py +1 -6
- reflex/components/radix/themes/layout/grid.pyi +17 -17
- reflex/components/radix/themes/layout/list.py +20 -15
- reflex/components/radix/themes/layout/list.pyi +175 -92
- reflex/components/radix/themes/layout/section.pyi +17 -17
- reflex/components/radix/themes/layout/spacer.pyi +17 -17
- reflex/components/radix/themes/layout/stack.py +6 -6
- reflex/components/radix/themes/layout/stack.pyi +91 -62
- reflex/components/radix/themes/typography/blockquote.py +2 -8
- reflex/components/radix/themes/typography/blockquote.pyi +17 -17
- reflex/components/radix/themes/typography/code.py +4 -10
- reflex/components/radix/themes/typography/code.pyi +19 -18
- reflex/components/radix/themes/typography/heading.py +4 -11
- reflex/components/radix/themes/typography/heading.pyi +19 -18
- reflex/components/radix/themes/typography/link.py +4 -10
- reflex/components/radix/themes/typography/link.pyi +19 -18
- reflex/components/radix/themes/typography/text.py +4 -11
- reflex/components/radix/themes/typography/text.pyi +115 -114
- reflex/components/react_player/audio.pyi +58 -33
- reflex/components/react_player/react_player.py +17 -17
- reflex/components/react_player/react_player.pyi +55 -33
- reflex/components/react_player/video.pyi +58 -33
- reflex/components/recharts/cartesian.py +45 -45
- reflex/components/recharts/cartesian.pyi +389 -304
- reflex/components/recharts/charts.py +22 -22
- reflex/components/recharts/charts.pyi +226 -179
- reflex/components/recharts/general.py +26 -27
- reflex/components/recharts/general.pyi +106 -99
- reflex/components/recharts/polar.py +33 -33
- reflex/components/recharts/polar.pyi +70 -64
- reflex/components/recharts/recharts.pyi +33 -33
- reflex/components/sonner/toast.py +9 -36
- reflex/components/sonner/toast.pyi +20 -24
- reflex/components/suneditor/editor.py +8 -8
- reflex/components/suneditor/editor.pyi +50 -25
- reflex/components/tags/iter_tag.py +1 -10
- reflex/components/tags/tag.py +1 -4
- reflex/config.py +198 -35
- reflex/constants/__init__.py +4 -16
- reflex/constants/base.py +7 -14
- reflex/constants/colors.py +0 -1
- reflex/constants/installer.py +12 -7
- reflex/constants/state.py +4 -0
- reflex/custom_components/custom_components.py +6 -6
- reflex/event.py +486 -241
- reflex/experimental/client_state.py +9 -9
- reflex/experimental/layout.py +2 -2
- reflex/experimental/layout.pyi +95 -87
- reflex/experimental/misc.py +1 -1
- reflex/istate/__init__.py +1 -0
- reflex/istate/proxy.py +33 -0
- reflex/istate/wrappers.py +27 -0
- reflex/model.py +7 -7
- reflex/page.py +2 -1
- reflex/reflex.py +142 -8
- reflex/state.py +133 -46
- reflex/testing.py +9 -7
- reflex/utils/console.py +0 -1
- reflex/utils/exceptions.py +31 -3
- reflex/utils/exec.py +33 -14
- reflex/utils/format.py +15 -12
- reflex/utils/net.py +1 -1
- reflex/utils/path_ops.py +2 -2
- reflex/utils/prerequisites.py +82 -46
- reflex/utils/pyi_generator.py +63 -20
- reflex/utils/registry.py +1 -1
- reflex/utils/serializers.py +75 -36
- reflex/utils/telemetry.py +3 -2
- reflex/utils/types.py +125 -10
- reflex/vars/base.py +131 -119
- reflex/vars/function.py +59 -12
- reflex/vars/number.py +3 -1
- reflex/vars/object.py +30 -24
- reflex/vars/sequence.py +7 -7
- {reflex-0.6.4a3.dist-info → reflex-0.6.5.dist-info}/METADATA +3 -3
- reflex-0.6.5.dist-info/RECORD +394 -0
- reflex-0.6.4a3.dist-info/RECORD +0 -391
- {reflex-0.6.4a3.dist-info → reflex-0.6.5.dist-info}/LICENSE +0 -0
- {reflex-0.6.4a3.dist-info → reflex-0.6.5.dist-info}/WHEEL +0 -0
- {reflex-0.6.4a3.dist-info → reflex-0.6.5.dist-info}/entry_points.txt +0 -0
reflex/compiler/compiler.py
CHANGED
|
@@ -4,10 +4,11 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from datetime import datetime
|
|
6
6
|
from pathlib import Path
|
|
7
|
-
from typing import Dict, Iterable, Optional, Type, Union
|
|
7
|
+
from typing import TYPE_CHECKING, Dict, Iterable, Optional, Tuple, Type, Union
|
|
8
8
|
|
|
9
9
|
from reflex import constants
|
|
10
10
|
from reflex.compiler import templates, utils
|
|
11
|
+
from reflex.components.base.fragment import Fragment
|
|
11
12
|
from reflex.components.component import (
|
|
12
13
|
BaseComponent,
|
|
13
14
|
Component,
|
|
@@ -126,8 +127,8 @@ def _compile_contexts(state: Optional[Type[BaseState]], theme: Component | None)
|
|
|
126
127
|
|
|
127
128
|
|
|
128
129
|
def _compile_page(
|
|
129
|
-
component:
|
|
130
|
-
state: Type[BaseState],
|
|
130
|
+
component: BaseComponent,
|
|
131
|
+
state: Type[BaseState] | None,
|
|
131
132
|
) -> str:
|
|
132
133
|
"""Compile the component given the app state.
|
|
133
134
|
|
|
@@ -142,7 +143,7 @@ def _compile_page(
|
|
|
142
143
|
imports = utils.compile_imports(imports)
|
|
143
144
|
|
|
144
145
|
# Compile the code to render the component.
|
|
145
|
-
kwargs = {"state_name": state.get_name()} if state else {}
|
|
146
|
+
kwargs = {"state_name": state.get_name()} if state is not None else {}
|
|
146
147
|
|
|
147
148
|
return templates.PAGE.render(
|
|
148
149
|
imports=imports,
|
|
@@ -424,7 +425,7 @@ def compile_contexts(
|
|
|
424
425
|
|
|
425
426
|
|
|
426
427
|
def compile_page(
|
|
427
|
-
path: str, component:
|
|
428
|
+
path: str, component: BaseComponent, state: Type[BaseState] | None
|
|
428
429
|
) -> tuple[str, str]:
|
|
429
430
|
"""Compile a single page.
|
|
430
431
|
|
|
@@ -526,7 +527,7 @@ def remove_tailwind_from_postcss() -> tuple[str, str]:
|
|
|
526
527
|
|
|
527
528
|
def purge_web_pages_dir():
|
|
528
529
|
"""Empty out .web/pages directory."""
|
|
529
|
-
if not is_prod_mode() and environment.REFLEX_PERSIST_WEB_DIR:
|
|
530
|
+
if not is_prod_mode() and environment.REFLEX_PERSIST_WEB_DIR.get():
|
|
530
531
|
# Skip purging the web directory in dev mode if REFLEX_PERSIST_WEB_DIR is set.
|
|
531
532
|
return
|
|
532
533
|
|
|
@@ -534,6 +535,81 @@ def purge_web_pages_dir():
|
|
|
534
535
|
utils.empty_dir(get_web_dir() / constants.Dirs.PAGES, keep_files=["_app.js"])
|
|
535
536
|
|
|
536
537
|
|
|
538
|
+
if TYPE_CHECKING:
|
|
539
|
+
from reflex.app import UnevaluatedPage
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
def compile_unevaluated_page(
|
|
543
|
+
route: str,
|
|
544
|
+
page: UnevaluatedPage,
|
|
545
|
+
state: Type[BaseState] | None = None,
|
|
546
|
+
style: ComponentStyle | None = None,
|
|
547
|
+
theme: Component | None = None,
|
|
548
|
+
) -> Tuple[Component, bool]:
|
|
549
|
+
"""Compiles an uncompiled page into a component and adds meta information.
|
|
550
|
+
|
|
551
|
+
Args:
|
|
552
|
+
route: The route of the page.
|
|
553
|
+
page: The uncompiled page object.
|
|
554
|
+
state: The state of the app.
|
|
555
|
+
style: The style of the page.
|
|
556
|
+
theme: The theme of the page.
|
|
557
|
+
|
|
558
|
+
Returns:
|
|
559
|
+
The compiled component and whether state should be enabled.
|
|
560
|
+
"""
|
|
561
|
+
# Generate the component if it is a callable.
|
|
562
|
+
component = page.component
|
|
563
|
+
component = component if isinstance(component, Component) else component()
|
|
564
|
+
|
|
565
|
+
# unpack components that return tuples in an rx.fragment.
|
|
566
|
+
if isinstance(component, tuple):
|
|
567
|
+
component = Fragment.create(*component)
|
|
568
|
+
|
|
569
|
+
component._add_style_recursive(style or {}, theme)
|
|
570
|
+
|
|
571
|
+
enable_state = False
|
|
572
|
+
# Ensure state is enabled if this page uses state.
|
|
573
|
+
if state is None:
|
|
574
|
+
if page.on_load or component._has_stateful_event_triggers():
|
|
575
|
+
enable_state = True
|
|
576
|
+
else:
|
|
577
|
+
for var in component._get_vars(include_children=True):
|
|
578
|
+
var_data = var._get_all_var_data()
|
|
579
|
+
if not var_data:
|
|
580
|
+
continue
|
|
581
|
+
if not var_data.state:
|
|
582
|
+
continue
|
|
583
|
+
enable_state = True
|
|
584
|
+
break
|
|
585
|
+
|
|
586
|
+
from reflex.app import OverlayFragment
|
|
587
|
+
from reflex.utils.format import make_default_page_title
|
|
588
|
+
|
|
589
|
+
component = OverlayFragment.create(component)
|
|
590
|
+
|
|
591
|
+
meta_args = {
|
|
592
|
+
"title": (
|
|
593
|
+
page.title
|
|
594
|
+
if page.title is not None
|
|
595
|
+
else make_default_page_title(get_config().app_name, route)
|
|
596
|
+
),
|
|
597
|
+
"image": page.image,
|
|
598
|
+
"meta": page.meta,
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
if page.description is not None:
|
|
602
|
+
meta_args["description"] = page.description
|
|
603
|
+
|
|
604
|
+
# Add meta information to the component.
|
|
605
|
+
utils.add_meta(
|
|
606
|
+
component,
|
|
607
|
+
**meta_args,
|
|
608
|
+
)
|
|
609
|
+
|
|
610
|
+
return component, enable_state
|
|
611
|
+
|
|
612
|
+
|
|
537
613
|
class ExecutorSafeFunctions:
|
|
538
614
|
"""Helper class to allow parallelisation of parts of the compilation process.
|
|
539
615
|
|
|
@@ -559,13 +635,12 @@ class ExecutorSafeFunctions:
|
|
|
559
635
|
|
|
560
636
|
"""
|
|
561
637
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
STYLE: ComponentStyle | None = None
|
|
638
|
+
COMPONENTS: Dict[str, BaseComponent] = {}
|
|
639
|
+
UNCOMPILED_PAGES: Dict[str, UnevaluatedPage] = {}
|
|
640
|
+
STATE: Optional[Type[BaseState]] = None
|
|
566
641
|
|
|
567
642
|
@classmethod
|
|
568
|
-
def compile_page(cls, route: str):
|
|
643
|
+
def compile_page(cls, route: str) -> tuple[str, str]:
|
|
569
644
|
"""Compile a page.
|
|
570
645
|
|
|
571
646
|
Args:
|
|
@@ -574,46 +649,45 @@ class ExecutorSafeFunctions:
|
|
|
574
649
|
Returns:
|
|
575
650
|
The path and code of the compiled page.
|
|
576
651
|
"""
|
|
577
|
-
return compile_page(
|
|
652
|
+
return compile_page(route, cls.COMPONENTS[route], cls.STATE)
|
|
578
653
|
|
|
579
654
|
@classmethod
|
|
580
|
-
def
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
655
|
+
def compile_unevaluated_page(
|
|
656
|
+
cls,
|
|
657
|
+
route: str,
|
|
658
|
+
style: ComponentStyle,
|
|
659
|
+
theme: Component | None,
|
|
660
|
+
) -> tuple[str, Component, tuple[str, str]]:
|
|
661
|
+
"""Compile an unevaluated page.
|
|
585
662
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
raise ValueError("COMPILE_APP_APP_ROOT should be set")
|
|
591
|
-
return compile_app(cls.COMPILE_APP_APP_ROOT)
|
|
592
|
-
|
|
593
|
-
@classmethod
|
|
594
|
-
def compile_custom_components(cls):
|
|
595
|
-
"""Compile the custom components.
|
|
663
|
+
Args:
|
|
664
|
+
route: The route of the page to compile.
|
|
665
|
+
style: The style of the page.
|
|
666
|
+
theme: The theme of the page.
|
|
596
667
|
|
|
597
668
|
Returns:
|
|
598
|
-
The
|
|
599
|
-
|
|
600
|
-
Raises:
|
|
601
|
-
ValueError: If the custom components are not set.
|
|
669
|
+
The route, compiled component, and compiled page.
|
|
602
670
|
"""
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
671
|
+
component, enable_state = compile_unevaluated_page(
|
|
672
|
+
route, cls.UNCOMPILED_PAGES[route]
|
|
673
|
+
)
|
|
674
|
+
component = component if isinstance(component, Component) else component()
|
|
675
|
+
component._add_style_recursive(style, theme)
|
|
676
|
+
return route, component, compile_page(route, component, cls.STATE)
|
|
606
677
|
|
|
607
678
|
@classmethod
|
|
608
|
-
def compile_theme(cls):
|
|
679
|
+
def compile_theme(cls, style: ComponentStyle | None) -> tuple[str, str]:
|
|
609
680
|
"""Compile the theme.
|
|
610
681
|
|
|
682
|
+
Args:
|
|
683
|
+
style: The style to compile.
|
|
684
|
+
|
|
611
685
|
Returns:
|
|
612
686
|
The path and code of the compiled theme.
|
|
613
687
|
|
|
614
688
|
Raises:
|
|
615
689
|
ValueError: If the style is not set.
|
|
616
690
|
"""
|
|
617
|
-
if
|
|
691
|
+
if style is None:
|
|
618
692
|
raise ValueError("STYLE should be set")
|
|
619
|
-
return compile_theme(
|
|
693
|
+
return compile_theme(style)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
from typing import Any, Dict, Optional, Union, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.base.fragment import Fragment
|
|
9
|
-
from reflex.event import EventType
|
|
9
|
+
from reflex.event import BASE_STATE, EventType
|
|
10
10
|
from reflex.style import Style
|
|
11
11
|
from reflex.vars.base import Var
|
|
12
12
|
|
|
@@ -21,22 +21,22 @@ class AppWrap(Fragment):
|
|
|
21
21
|
id: Optional[Any] = None,
|
|
22
22
|
class_name: Optional[Any] = None,
|
|
23
23
|
autofocus: Optional[bool] = None,
|
|
24
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
25
|
-
on_blur: Optional[EventType[[]]] = None,
|
|
26
|
-
on_click: Optional[EventType[[]]] = None,
|
|
27
|
-
on_context_menu: Optional[EventType[[]]] = None,
|
|
28
|
-
on_double_click: Optional[EventType[[]]] = None,
|
|
29
|
-
on_focus: Optional[EventType[[]]] = None,
|
|
30
|
-
on_mount: Optional[EventType[[]]] = None,
|
|
31
|
-
on_mouse_down: Optional[EventType[[]]] = None,
|
|
32
|
-
on_mouse_enter: Optional[EventType[[]]] = None,
|
|
33
|
-
on_mouse_leave: Optional[EventType[[]]] = None,
|
|
34
|
-
on_mouse_move: Optional[EventType[[]]] = None,
|
|
35
|
-
on_mouse_out: Optional[EventType[[]]] = None,
|
|
36
|
-
on_mouse_over: Optional[EventType[[]]] = None,
|
|
37
|
-
on_mouse_up: Optional[EventType[[]]] = None,
|
|
38
|
-
on_scroll: Optional[EventType[[]]] = None,
|
|
39
|
-
on_unmount: Optional[EventType[[]]] = None,
|
|
24
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
25
|
+
on_blur: Optional[EventType[[], BASE_STATE]] = None,
|
|
26
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
27
|
+
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
|
|
28
|
+
on_double_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
29
|
+
on_focus: Optional[EventType[[], BASE_STATE]] = None,
|
|
30
|
+
on_mount: Optional[EventType[[], BASE_STATE]] = None,
|
|
31
|
+
on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
|
|
32
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
33
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
34
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
35
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
36
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
37
|
+
on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
|
|
38
|
+
on_scroll: Optional[EventType[[], BASE_STATE]] = None,
|
|
39
|
+
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
|
40
40
|
**props,
|
|
41
41
|
) -> "AppWrap":
|
|
42
42
|
"""Create a new AppWrap component.
|
reflex/components/base/bare.py
CHANGED
|
@@ -4,10 +4,11 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from typing import Any, Iterator
|
|
6
6
|
|
|
7
|
-
from reflex.components.component import Component
|
|
7
|
+
from reflex.components.component import Component, LiteralComponentVar
|
|
8
8
|
from reflex.components.tags import Tag
|
|
9
9
|
from reflex.components.tags.tagless import Tagless
|
|
10
|
-
from reflex.
|
|
10
|
+
from reflex.utils.imports import ParsedImportDict
|
|
11
|
+
from reflex.vars import BooleanVar, ObjectVar, Var
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class Bare(Component):
|
|
@@ -31,9 +32,77 @@ class Bare(Component):
|
|
|
31
32
|
contents = str(contents) if contents is not None else ""
|
|
32
33
|
return cls(contents=contents) # type: ignore
|
|
33
34
|
|
|
35
|
+
def _get_all_hooks_internal(self) -> dict[str, None]:
|
|
36
|
+
"""Include the hooks for the component.
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
The hooks for the component.
|
|
40
|
+
"""
|
|
41
|
+
hooks = super()._get_all_hooks_internal()
|
|
42
|
+
if isinstance(self.contents, LiteralComponentVar):
|
|
43
|
+
hooks |= self.contents._var_value._get_all_hooks_internal()
|
|
44
|
+
return hooks
|
|
45
|
+
|
|
46
|
+
def _get_all_hooks(self) -> dict[str, None]:
|
|
47
|
+
"""Include the hooks for the component.
|
|
48
|
+
|
|
49
|
+
Returns:
|
|
50
|
+
The hooks for the component.
|
|
51
|
+
"""
|
|
52
|
+
hooks = super()._get_all_hooks()
|
|
53
|
+
if isinstance(self.contents, LiteralComponentVar):
|
|
54
|
+
hooks |= self.contents._var_value._get_all_hooks()
|
|
55
|
+
return hooks
|
|
56
|
+
|
|
57
|
+
def _get_all_imports(self) -> ParsedImportDict:
|
|
58
|
+
"""Include the imports for the component.
|
|
59
|
+
|
|
60
|
+
Returns:
|
|
61
|
+
The imports for the component.
|
|
62
|
+
"""
|
|
63
|
+
imports = super()._get_all_imports()
|
|
64
|
+
if isinstance(self.contents, LiteralComponentVar):
|
|
65
|
+
var_data = self.contents._get_all_var_data()
|
|
66
|
+
if var_data:
|
|
67
|
+
imports |= {k: list(v) for k, v in var_data.imports}
|
|
68
|
+
return imports
|
|
69
|
+
|
|
70
|
+
def _get_all_dynamic_imports(self) -> set[str]:
|
|
71
|
+
"""Get dynamic imports for the component.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
The dynamic imports.
|
|
75
|
+
"""
|
|
76
|
+
dynamic_imports = super()._get_all_dynamic_imports()
|
|
77
|
+
if isinstance(self.contents, LiteralComponentVar):
|
|
78
|
+
dynamic_imports |= self.contents._var_value._get_all_dynamic_imports()
|
|
79
|
+
return dynamic_imports
|
|
80
|
+
|
|
81
|
+
def _get_all_custom_code(self) -> set[str]:
|
|
82
|
+
"""Get custom code for the component.
|
|
83
|
+
|
|
84
|
+
Returns:
|
|
85
|
+
The custom code.
|
|
86
|
+
"""
|
|
87
|
+
custom_code = super()._get_all_custom_code()
|
|
88
|
+
if isinstance(self.contents, LiteralComponentVar):
|
|
89
|
+
custom_code |= self.contents._var_value._get_all_custom_code()
|
|
90
|
+
return custom_code
|
|
91
|
+
|
|
92
|
+
def _get_all_refs(self) -> set[str]:
|
|
93
|
+
"""Get the refs for the children of the component.
|
|
94
|
+
|
|
95
|
+
Returns:
|
|
96
|
+
The refs for the children.
|
|
97
|
+
"""
|
|
98
|
+
refs = super()._get_all_refs()
|
|
99
|
+
if isinstance(self.contents, LiteralComponentVar):
|
|
100
|
+
refs |= self.contents._var_value._get_all_refs()
|
|
101
|
+
return refs
|
|
102
|
+
|
|
34
103
|
def _render(self) -> Tag:
|
|
35
104
|
if isinstance(self.contents, Var):
|
|
36
|
-
if isinstance(self.contents, (BooleanVar, ObjectVar
|
|
105
|
+
if isinstance(self.contents, (BooleanVar, ObjectVar)):
|
|
37
106
|
return Tagless(contents=f"{{{str(self.contents.to_string())}}}")
|
|
38
107
|
return Tagless(contents=f"{{{str(self.contents)}}}")
|
|
39
108
|
return Tagless(contents=str(self.contents))
|
reflex/components/base/body.pyi
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
from typing import Any, Dict, Optional, Union, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.component import Component
|
|
9
|
-
from reflex.event import EventType
|
|
9
|
+
from reflex.event import BASE_STATE, EventType
|
|
10
10
|
from reflex.style import Style
|
|
11
11
|
from reflex.vars.base import Var
|
|
12
12
|
|
|
@@ -21,22 +21,22 @@ class Body(Component):
|
|
|
21
21
|
id: Optional[Any] = None,
|
|
22
22
|
class_name: Optional[Any] = None,
|
|
23
23
|
autofocus: Optional[bool] = None,
|
|
24
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
25
|
-
on_blur: Optional[EventType[[]]] = None,
|
|
26
|
-
on_click: Optional[EventType[[]]] = None,
|
|
27
|
-
on_context_menu: Optional[EventType[[]]] = None,
|
|
28
|
-
on_double_click: Optional[EventType[[]]] = None,
|
|
29
|
-
on_focus: Optional[EventType[[]]] = None,
|
|
30
|
-
on_mount: Optional[EventType[[]]] = None,
|
|
31
|
-
on_mouse_down: Optional[EventType[[]]] = None,
|
|
32
|
-
on_mouse_enter: Optional[EventType[[]]] = None,
|
|
33
|
-
on_mouse_leave: Optional[EventType[[]]] = None,
|
|
34
|
-
on_mouse_move: Optional[EventType[[]]] = None,
|
|
35
|
-
on_mouse_out: Optional[EventType[[]]] = None,
|
|
36
|
-
on_mouse_over: Optional[EventType[[]]] = None,
|
|
37
|
-
on_mouse_up: Optional[EventType[[]]] = None,
|
|
38
|
-
on_scroll: Optional[EventType[[]]] = None,
|
|
39
|
-
on_unmount: Optional[EventType[[]]] = None,
|
|
24
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
25
|
+
on_blur: Optional[EventType[[], BASE_STATE]] = None,
|
|
26
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
27
|
+
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
|
|
28
|
+
on_double_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
29
|
+
on_focus: Optional[EventType[[], BASE_STATE]] = None,
|
|
30
|
+
on_mount: Optional[EventType[[], BASE_STATE]] = None,
|
|
31
|
+
on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
|
|
32
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
33
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
34
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
35
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
36
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
37
|
+
on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
|
|
38
|
+
on_scroll: Optional[EventType[[], BASE_STATE]] = None,
|
|
39
|
+
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
|
40
40
|
**props,
|
|
41
41
|
) -> "Body":
|
|
42
42
|
"""Create the component.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
from typing import Any, Dict, Optional, Union, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.component import Component
|
|
9
|
-
from reflex.event import EventType
|
|
9
|
+
from reflex.event import BASE_STATE, EventType
|
|
10
10
|
from reflex.style import Style
|
|
11
11
|
from reflex.vars.base import Var
|
|
12
12
|
|
|
@@ -21,22 +21,22 @@ class NextDocumentLib(Component):
|
|
|
21
21
|
id: Optional[Any] = None,
|
|
22
22
|
class_name: Optional[Any] = None,
|
|
23
23
|
autofocus: Optional[bool] = None,
|
|
24
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
25
|
-
on_blur: Optional[EventType[[]]] = None,
|
|
26
|
-
on_click: Optional[EventType[[]]] = None,
|
|
27
|
-
on_context_menu: Optional[EventType[[]]] = None,
|
|
28
|
-
on_double_click: Optional[EventType[[]]] = None,
|
|
29
|
-
on_focus: Optional[EventType[[]]] = None,
|
|
30
|
-
on_mount: Optional[EventType[[]]] = None,
|
|
31
|
-
on_mouse_down: Optional[EventType[[]]] = None,
|
|
32
|
-
on_mouse_enter: Optional[EventType[[]]] = None,
|
|
33
|
-
on_mouse_leave: Optional[EventType[[]]] = None,
|
|
34
|
-
on_mouse_move: Optional[EventType[[]]] = None,
|
|
35
|
-
on_mouse_out: Optional[EventType[[]]] = None,
|
|
36
|
-
on_mouse_over: Optional[EventType[[]]] = None,
|
|
37
|
-
on_mouse_up: Optional[EventType[[]]] = None,
|
|
38
|
-
on_scroll: Optional[EventType[[]]] = None,
|
|
39
|
-
on_unmount: Optional[EventType[[]]] = None,
|
|
24
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
25
|
+
on_blur: Optional[EventType[[], BASE_STATE]] = None,
|
|
26
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
27
|
+
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
|
|
28
|
+
on_double_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
29
|
+
on_focus: Optional[EventType[[], BASE_STATE]] = None,
|
|
30
|
+
on_mount: Optional[EventType[[], BASE_STATE]] = None,
|
|
31
|
+
on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
|
|
32
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
33
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
34
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
35
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
36
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
37
|
+
on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
|
|
38
|
+
on_scroll: Optional[EventType[[], BASE_STATE]] = None,
|
|
39
|
+
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
|
40
40
|
**props,
|
|
41
41
|
) -> "NextDocumentLib":
|
|
42
42
|
"""Create the component.
|
|
@@ -68,22 +68,22 @@ class Html(NextDocumentLib):
|
|
|
68
68
|
id: Optional[Any] = None,
|
|
69
69
|
class_name: Optional[Any] = None,
|
|
70
70
|
autofocus: Optional[bool] = None,
|
|
71
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
72
|
-
on_blur: Optional[EventType[[]]] = None,
|
|
73
|
-
on_click: Optional[EventType[[]]] = None,
|
|
74
|
-
on_context_menu: Optional[EventType[[]]] = None,
|
|
75
|
-
on_double_click: Optional[EventType[[]]] = None,
|
|
76
|
-
on_focus: Optional[EventType[[]]] = None,
|
|
77
|
-
on_mount: Optional[EventType[[]]] = None,
|
|
78
|
-
on_mouse_down: Optional[EventType[[]]] = None,
|
|
79
|
-
on_mouse_enter: Optional[EventType[[]]] = None,
|
|
80
|
-
on_mouse_leave: Optional[EventType[[]]] = None,
|
|
81
|
-
on_mouse_move: Optional[EventType[[]]] = None,
|
|
82
|
-
on_mouse_out: Optional[EventType[[]]] = None,
|
|
83
|
-
on_mouse_over: Optional[EventType[[]]] = None,
|
|
84
|
-
on_mouse_up: Optional[EventType[[]]] = None,
|
|
85
|
-
on_scroll: Optional[EventType[[]]] = None,
|
|
86
|
-
on_unmount: Optional[EventType[[]]] = None,
|
|
71
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
72
|
+
on_blur: Optional[EventType[[], BASE_STATE]] = None,
|
|
73
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
74
|
+
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
|
|
75
|
+
on_double_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
76
|
+
on_focus: Optional[EventType[[], BASE_STATE]] = None,
|
|
77
|
+
on_mount: Optional[EventType[[], BASE_STATE]] = None,
|
|
78
|
+
on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
|
|
79
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
80
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
81
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
82
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
83
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
84
|
+
on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
|
|
85
|
+
on_scroll: Optional[EventType[[], BASE_STATE]] = None,
|
|
86
|
+
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
|
87
87
|
**props,
|
|
88
88
|
) -> "Html":
|
|
89
89
|
"""Create the component.
|
|
@@ -114,22 +114,22 @@ class DocumentHead(NextDocumentLib):
|
|
|
114
114
|
id: Optional[Any] = None,
|
|
115
115
|
class_name: Optional[Any] = None,
|
|
116
116
|
autofocus: Optional[bool] = None,
|
|
117
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
118
|
-
on_blur: Optional[EventType[[]]] = None,
|
|
119
|
-
on_click: Optional[EventType[[]]] = None,
|
|
120
|
-
on_context_menu: Optional[EventType[[]]] = None,
|
|
121
|
-
on_double_click: Optional[EventType[[]]] = None,
|
|
122
|
-
on_focus: Optional[EventType[[]]] = None,
|
|
123
|
-
on_mount: Optional[EventType[[]]] = None,
|
|
124
|
-
on_mouse_down: Optional[EventType[[]]] = None,
|
|
125
|
-
on_mouse_enter: Optional[EventType[[]]] = None,
|
|
126
|
-
on_mouse_leave: Optional[EventType[[]]] = None,
|
|
127
|
-
on_mouse_move: Optional[EventType[[]]] = None,
|
|
128
|
-
on_mouse_out: Optional[EventType[[]]] = None,
|
|
129
|
-
on_mouse_over: Optional[EventType[[]]] = None,
|
|
130
|
-
on_mouse_up: Optional[EventType[[]]] = None,
|
|
131
|
-
on_scroll: Optional[EventType[[]]] = None,
|
|
132
|
-
on_unmount: Optional[EventType[[]]] = None,
|
|
117
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
118
|
+
on_blur: Optional[EventType[[], BASE_STATE]] = None,
|
|
119
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
120
|
+
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
|
|
121
|
+
on_double_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
122
|
+
on_focus: Optional[EventType[[], BASE_STATE]] = None,
|
|
123
|
+
on_mount: Optional[EventType[[], BASE_STATE]] = None,
|
|
124
|
+
on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
|
|
125
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
126
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
127
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
128
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
129
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
130
|
+
on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
|
|
131
|
+
on_scroll: Optional[EventType[[], BASE_STATE]] = None,
|
|
132
|
+
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
|
133
133
|
**props,
|
|
134
134
|
) -> "DocumentHead":
|
|
135
135
|
"""Create the component.
|
|
@@ -160,22 +160,22 @@ class Main(NextDocumentLib):
|
|
|
160
160
|
id: Optional[Any] = None,
|
|
161
161
|
class_name: Optional[Any] = None,
|
|
162
162
|
autofocus: Optional[bool] = None,
|
|
163
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
164
|
-
on_blur: Optional[EventType[[]]] = None,
|
|
165
|
-
on_click: Optional[EventType[[]]] = None,
|
|
166
|
-
on_context_menu: Optional[EventType[[]]] = None,
|
|
167
|
-
on_double_click: Optional[EventType[[]]] = None,
|
|
168
|
-
on_focus: Optional[EventType[[]]] = None,
|
|
169
|
-
on_mount: Optional[EventType[[]]] = None,
|
|
170
|
-
on_mouse_down: Optional[EventType[[]]] = None,
|
|
171
|
-
on_mouse_enter: Optional[EventType[[]]] = None,
|
|
172
|
-
on_mouse_leave: Optional[EventType[[]]] = None,
|
|
173
|
-
on_mouse_move: Optional[EventType[[]]] = None,
|
|
174
|
-
on_mouse_out: Optional[EventType[[]]] = None,
|
|
175
|
-
on_mouse_over: Optional[EventType[[]]] = None,
|
|
176
|
-
on_mouse_up: Optional[EventType[[]]] = None,
|
|
177
|
-
on_scroll: Optional[EventType[[]]] = None,
|
|
178
|
-
on_unmount: Optional[EventType[[]]] = None,
|
|
163
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
164
|
+
on_blur: Optional[EventType[[], BASE_STATE]] = None,
|
|
165
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
166
|
+
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
|
|
167
|
+
on_double_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
168
|
+
on_focus: Optional[EventType[[], BASE_STATE]] = None,
|
|
169
|
+
on_mount: Optional[EventType[[], BASE_STATE]] = None,
|
|
170
|
+
on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
|
|
171
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
172
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
173
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
174
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
175
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
176
|
+
on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
|
|
177
|
+
on_scroll: Optional[EventType[[], BASE_STATE]] = None,
|
|
178
|
+
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
|
179
179
|
**props,
|
|
180
180
|
) -> "Main":
|
|
181
181
|
"""Create the component.
|
|
@@ -206,22 +206,22 @@ class NextScript(NextDocumentLib):
|
|
|
206
206
|
id: Optional[Any] = None,
|
|
207
207
|
class_name: Optional[Any] = None,
|
|
208
208
|
autofocus: Optional[bool] = None,
|
|
209
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
210
|
-
on_blur: Optional[EventType[[]]] = None,
|
|
211
|
-
on_click: Optional[EventType[[]]] = None,
|
|
212
|
-
on_context_menu: Optional[EventType[[]]] = None,
|
|
213
|
-
on_double_click: Optional[EventType[[]]] = None,
|
|
214
|
-
on_focus: Optional[EventType[[]]] = None,
|
|
215
|
-
on_mount: Optional[EventType[[]]] = None,
|
|
216
|
-
on_mouse_down: Optional[EventType[[]]] = None,
|
|
217
|
-
on_mouse_enter: Optional[EventType[[]]] = None,
|
|
218
|
-
on_mouse_leave: Optional[EventType[[]]] = None,
|
|
219
|
-
on_mouse_move: Optional[EventType[[]]] = None,
|
|
220
|
-
on_mouse_out: Optional[EventType[[]]] = None,
|
|
221
|
-
on_mouse_over: Optional[EventType[[]]] = None,
|
|
222
|
-
on_mouse_up: Optional[EventType[[]]] = None,
|
|
223
|
-
on_scroll: Optional[EventType[[]]] = None,
|
|
224
|
-
on_unmount: Optional[EventType[[]]] = None,
|
|
209
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
210
|
+
on_blur: Optional[EventType[[], BASE_STATE]] = None,
|
|
211
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
212
|
+
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
|
|
213
|
+
on_double_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
214
|
+
on_focus: Optional[EventType[[], BASE_STATE]] = None,
|
|
215
|
+
on_mount: Optional[EventType[[], BASE_STATE]] = None,
|
|
216
|
+
on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
|
|
217
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
218
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
219
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
220
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
221
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
222
|
+
on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
|
|
223
|
+
on_scroll: Optional[EventType[[], BASE_STATE]] = None,
|
|
224
|
+
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
|
225
225
|
**props,
|
|
226
226
|
) -> "NextScript":
|
|
227
227
|
"""Create the component.
|