|
@@ -8,13 +8,14 @@ from reflex.vars import Var, BaseVar, ComputedVar
|
|
from reflex.event import EventChain, EventHandler, EventSpec
|
|
from reflex.event import EventChain, EventHandler, EventSpec
|
|
from reflex.style import Style
|
|
from reflex.style import Style
|
|
from typing import Literal
|
|
from typing import Literal
|
|
|
|
+from reflex.components.el.elements.inline import A
|
|
from reflex.vars import Var
|
|
from reflex.vars import Var
|
|
from ..base import CommonMarginProps, LiteralAccentColor, RadixThemesComponent
|
|
from ..base import CommonMarginProps, LiteralAccentColor, RadixThemesComponent
|
|
from .base import LiteralTextSize, LiteralTextTrim, LiteralTextWeight
|
|
from .base import LiteralTextSize, LiteralTextTrim, LiteralTextWeight
|
|
|
|
|
|
LiteralLinkUnderline = Literal["auto", "hover", "always"]
|
|
LiteralLinkUnderline = Literal["auto", "hover", "always"]
|
|
|
|
|
|
-class Link(CommonMarginProps, RadixThemesComponent):
|
|
|
|
|
|
+class Link(CommonMarginProps, RadixThemesComponent, A):
|
|
@overload
|
|
@overload
|
|
@classmethod
|
|
@classmethod
|
|
def create( # type: ignore
|
|
def create( # type: ignore
|
|
@@ -151,6 +152,70 @@ class Link(CommonMarginProps, RadixThemesComponent):
|
|
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
]
|
|
]
|
|
] = None,
|
|
] = None,
|
|
|
|
+ download: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ href: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
|
|
+ href_lang: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ media: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ ping: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
|
|
+ referrer_policy: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ rel: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
|
|
+ shape: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ target: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ access_key: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ auto_capitalize: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ content_editable: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ context_menu: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
|
|
+ draggable: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ enter_key_hint: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ hidden: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ input_mode: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ item_prop: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
|
|
+ role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
|
|
+ slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
|
|
+ spell_check: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ tab_index: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ title: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
|
|
+ translate: Optional[
|
|
|
|
+ Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
|
|
+ ] = None,
|
|
style: Optional[Style] = None,
|
|
style: Optional[Style] = None,
|
|
key: Optional[Any] = None,
|
|
key: Optional[Any] = None,
|
|
id: Optional[Any] = None,
|
|
id: Optional[Any] = None,
|
|
@@ -226,6 +291,32 @@ class Link(CommonMarginProps, RadixThemesComponent):
|
|
mr: Margin right: "0" - "9"
|
|
mr: Margin right: "0" - "9"
|
|
mb: Margin bottom: "0" - "9"
|
|
mb: Margin bottom: "0" - "9"
|
|
ml: Margin left: "0" - "9"
|
|
ml: Margin left: "0" - "9"
|
|
|
|
+ download: Specifies that the target (the file specified in the href attribute) will be downloaded when a user clicks on the hyperlink.
|
|
|
|
+ href: Specifies the URL of the page the link goes to
|
|
|
|
+ href_lang: Specifies the language of the linked document
|
|
|
|
+ media: Specifies what media/device the linked document is optimized for
|
|
|
|
+ ping: Specifies which referrer is sent when fetching the resource
|
|
|
|
+ referrer_policy: Specifies the relationship between the current document and the linked document
|
|
|
|
+ rel: Specifies the relationship between the linked document and the current document
|
|
|
|
+ shape: Specifies the shape of the area
|
|
|
|
+ target: Specifies where to open the linked document
|
|
|
|
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
|
|
+ auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
|
|
+ content_editable: Indicates whether the element's content is editable.
|
|
|
|
+ context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
|
|
+ dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
|
|
|
|
+ draggable: Defines whether the element can be dragged.
|
|
|
|
+ enter_key_hint: Hints what media types the media element is able to play.
|
|
|
|
+ hidden: Defines whether the element is hidden.
|
|
|
|
+ input_mode: Defines the type of the element.
|
|
|
|
+ item_prop: Defines the name of the element for metadata purposes.
|
|
|
|
+ lang: Defines the language used in the element.
|
|
|
|
+ role: Defines the role of the element.
|
|
|
|
+ slot: Assigns a slot in a shadow DOM shadow tree to an element.
|
|
|
|
+ spell_check: Defines whether the element may be checked for spelling errors.
|
|
|
|
+ tab_index: Defines the position of the current element in the tabbing order.
|
|
|
|
+ title: Defines a tooltip for the element.
|
|
|
|
+ translate: Specifies whether the content of an element should be translated or not.
|
|
style: The style of the component.
|
|
style: The style of the component.
|
|
key: A unique key for the component.
|
|
key: A unique key for the component.
|
|
id: The id for the component.
|
|
id: The id for the component.
|