small updates to size prop and type prop
This commit is contained in:
parent
bece5bdb44
commit
730489bc19
@ -17,6 +17,9 @@ class AlertDialogRoot(CommonMarginProps, RadixThemesComponent):
|
|||||||
# The controlled open state of the dialog.
|
# The controlled open state of the dialog.
|
||||||
open: Var[bool]
|
open: Var[bool]
|
||||||
|
|
||||||
|
# The size of the dialog.
|
||||||
|
size: Var[LiteralSize]
|
||||||
|
|
||||||
def get_event_triggers(self) -> Dict[str, Any]:
|
def get_event_triggers(self) -> Dict[str, Any]:
|
||||||
"""Get the events triggers signatures for the component.
|
"""Get the events triggers signatures for the component.
|
||||||
|
|
||||||
@ -34,6 +37,9 @@ class AlertDialogTrigger(CommonMarginProps, RadixThemesComponent):
|
|||||||
|
|
||||||
tag = "AlertDialog.Trigger"
|
tag = "AlertDialog.Trigger"
|
||||||
|
|
||||||
|
# The size of the dialog.
|
||||||
|
size: Var[LiteralSize]
|
||||||
|
|
||||||
|
|
||||||
class AlertDialogContent(el.Div, CommonMarginProps, RadixThemesComponent):
|
class AlertDialogContent(el.Div, CommonMarginProps, RadixThemesComponent):
|
||||||
"""Contains the content of the dialog. This component is based on the div element."""
|
"""Contains the content of the dialog. This component is based on the div element."""
|
||||||
@ -68,6 +74,9 @@ class AlertDialogTitle(CommonMarginProps, RadixThemesComponent):
|
|||||||
|
|
||||||
tag = "AlertDialog.Title"
|
tag = "AlertDialog.Title"
|
||||||
|
|
||||||
|
# The size of the dialog.
|
||||||
|
size: Var[LiteralSize]
|
||||||
|
|
||||||
|
|
||||||
class AlertDialogDescription(CommonMarginProps, RadixThemesComponent):
|
class AlertDialogDescription(CommonMarginProps, RadixThemesComponent):
|
||||||
"""An optional accessible description that is announced when the dialog is opened.
|
"""An optional accessible description that is announced when the dialog is opened.
|
||||||
@ -76,6 +85,9 @@ class AlertDialogDescription(CommonMarginProps, RadixThemesComponent):
|
|||||||
|
|
||||||
tag = "AlertDialog.Description"
|
tag = "AlertDialog.Description"
|
||||||
|
|
||||||
|
# The size of the dialog.
|
||||||
|
size: Var[LiteralSize]
|
||||||
|
|
||||||
|
|
||||||
class AlertDialogAction(CommonMarginProps, RadixThemesComponent):
|
class AlertDialogAction(CommonMarginProps, RadixThemesComponent):
|
||||||
"""Wraps the control that will close the dialog. This should be distinguished
|
"""Wraps the control that will close the dialog. This should be distinguished
|
||||||
@ -84,6 +96,9 @@ class AlertDialogAction(CommonMarginProps, RadixThemesComponent):
|
|||||||
|
|
||||||
tag = "AlertDialog.Action"
|
tag = "AlertDialog.Action"
|
||||||
|
|
||||||
|
# The size of the dialog.
|
||||||
|
size: Var[LiteralSize]
|
||||||
|
|
||||||
|
|
||||||
class AlertDialogCancel(CommonMarginProps, RadixThemesComponent):
|
class AlertDialogCancel(CommonMarginProps, RadixThemesComponent):
|
||||||
"""Wraps the control that will close the dialog. This should be distinguished
|
"""Wraps the control that will close the dialog. This should be distinguished
|
||||||
@ -91,3 +106,6 @@ class AlertDialogCancel(CommonMarginProps, RadixThemesComponent):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
tag = "AlertDialog.Cancel"
|
tag = "AlertDialog.Cancel"
|
||||||
|
|
||||||
|
# The size of the dialog.
|
||||||
|
size: Var[LiteralSize]
|
||||||
|
@ -85,6 +85,12 @@ class AlertDialogRoot(CommonMarginProps, RadixThemesComponent):
|
|||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
open: Optional[Union[Var[bool], bool]] = None,
|
open: Optional[Union[Var[bool], bool]] = None,
|
||||||
|
size: Optional[
|
||||||
|
Union[
|
||||||
|
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
||||||
|
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
||||||
|
]
|
||||||
|
] = None,
|
||||||
m: Optional[
|
m: Optional[
|
||||||
Union[
|
Union[
|
||||||
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
||||||
@ -193,6 +199,7 @@ class AlertDialogRoot(CommonMarginProps, RadixThemesComponent):
|
|||||||
color: map to CSS default color property.
|
color: map to CSS default color property.
|
||||||
color_scheme: map to radix color property.
|
color_scheme: map to radix color property.
|
||||||
open: The controlled open state of the dialog.
|
open: The controlled open state of the dialog.
|
||||||
|
size: The size of the dialog.
|
||||||
m: Margin: "0" - "9"
|
m: Margin: "0" - "9"
|
||||||
mx: Margin horizontal: "0" - "9"
|
mx: Margin horizontal: "0" - "9"
|
||||||
my: Margin vertical: "0" - "9"
|
my: Margin vertical: "0" - "9"
|
||||||
@ -282,6 +289,12 @@ class AlertDialogTrigger(CommonMarginProps, RadixThemesComponent):
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
|
size: Optional[
|
||||||
|
Union[
|
||||||
|
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
||||||
|
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
||||||
|
]
|
||||||
|
] = None,
|
||||||
m: Optional[
|
m: Optional[
|
||||||
Union[
|
Union[
|
||||||
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
||||||
@ -386,6 +399,7 @@ class AlertDialogTrigger(CommonMarginProps, RadixThemesComponent):
|
|||||||
*children: Child components.
|
*children: Child components.
|
||||||
color: map to CSS default color property.
|
color: map to CSS default color property.
|
||||||
color_scheme: map to radix color property.
|
color_scheme: map to radix color property.
|
||||||
|
size: The size of the dialog.
|
||||||
m: Margin: "0" - "9"
|
m: Margin: "0" - "9"
|
||||||
mx: Margin horizontal: "0" - "9"
|
mx: Margin horizontal: "0" - "9"
|
||||||
my: Margin vertical: "0" - "9"
|
my: Margin vertical: "0" - "9"
|
||||||
@ -747,6 +761,12 @@ class AlertDialogTitle(CommonMarginProps, RadixThemesComponent):
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
|
size: Optional[
|
||||||
|
Union[
|
||||||
|
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
||||||
|
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
||||||
|
]
|
||||||
|
] = None,
|
||||||
m: Optional[
|
m: Optional[
|
||||||
Union[
|
Union[
|
||||||
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
||||||
@ -851,6 +871,7 @@ class AlertDialogTitle(CommonMarginProps, RadixThemesComponent):
|
|||||||
*children: Child components.
|
*children: Child components.
|
||||||
color: map to CSS default color property.
|
color: map to CSS default color property.
|
||||||
color_scheme: map to radix color property.
|
color_scheme: map to radix color property.
|
||||||
|
size: The size of the dialog.
|
||||||
m: Margin: "0" - "9"
|
m: Margin: "0" - "9"
|
||||||
mx: Margin horizontal: "0" - "9"
|
mx: Margin horizontal: "0" - "9"
|
||||||
my: Margin vertical: "0" - "9"
|
my: Margin vertical: "0" - "9"
|
||||||
@ -940,6 +961,12 @@ class AlertDialogDescription(CommonMarginProps, RadixThemesComponent):
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
|
size: Optional[
|
||||||
|
Union[
|
||||||
|
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
||||||
|
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
||||||
|
]
|
||||||
|
] = None,
|
||||||
m: Optional[
|
m: Optional[
|
||||||
Union[
|
Union[
|
||||||
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
||||||
@ -1044,6 +1071,7 @@ class AlertDialogDescription(CommonMarginProps, RadixThemesComponent):
|
|||||||
*children: Child components.
|
*children: Child components.
|
||||||
color: map to CSS default color property.
|
color: map to CSS default color property.
|
||||||
color_scheme: map to radix color property.
|
color_scheme: map to radix color property.
|
||||||
|
size: The size of the dialog.
|
||||||
m: Margin: "0" - "9"
|
m: Margin: "0" - "9"
|
||||||
mx: Margin horizontal: "0" - "9"
|
mx: Margin horizontal: "0" - "9"
|
||||||
my: Margin vertical: "0" - "9"
|
my: Margin vertical: "0" - "9"
|
||||||
@ -1133,6 +1161,12 @@ class AlertDialogAction(CommonMarginProps, RadixThemesComponent):
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
|
size: Optional[
|
||||||
|
Union[
|
||||||
|
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
||||||
|
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
||||||
|
]
|
||||||
|
] = None,
|
||||||
m: Optional[
|
m: Optional[
|
||||||
Union[
|
Union[
|
||||||
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
||||||
@ -1237,6 +1271,7 @@ class AlertDialogAction(CommonMarginProps, RadixThemesComponent):
|
|||||||
*children: Child components.
|
*children: Child components.
|
||||||
color: map to CSS default color property.
|
color: map to CSS default color property.
|
||||||
color_scheme: map to radix color property.
|
color_scheme: map to radix color property.
|
||||||
|
size: The size of the dialog.
|
||||||
m: Margin: "0" - "9"
|
m: Margin: "0" - "9"
|
||||||
mx: Margin horizontal: "0" - "9"
|
mx: Margin horizontal: "0" - "9"
|
||||||
my: Margin vertical: "0" - "9"
|
my: Margin vertical: "0" - "9"
|
||||||
@ -1326,6 +1361,12 @@ class AlertDialogCancel(CommonMarginProps, RadixThemesComponent):
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
|
size: Optional[
|
||||||
|
Union[
|
||||||
|
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
||||||
|
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
||||||
|
]
|
||||||
|
] = None,
|
||||||
m: Optional[
|
m: Optional[
|
||||||
Union[
|
Union[
|
||||||
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
||||||
@ -1430,6 +1471,7 @@ class AlertDialogCancel(CommonMarginProps, RadixThemesComponent):
|
|||||||
*children: Child components.
|
*children: Child components.
|
||||||
color: map to CSS default color property.
|
color: map to CSS default color property.
|
||||||
color_scheme: map to radix color property.
|
color_scheme: map to radix color property.
|
||||||
|
size: The size of the dialog.
|
||||||
m: Margin: "0" - "9"
|
m: Margin: "0" - "9"
|
||||||
mx: Margin horizontal: "0" - "9"
|
mx: Margin horizontal: "0" - "9"
|
||||||
my: Margin vertical: "0" - "9"
|
my: Margin vertical: "0" - "9"
|
||||||
|
@ -5,6 +5,7 @@ import reflex as rx
|
|||||||
from reflex.components import el
|
from reflex.components import el
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.components.core.debounce import DebounceInput
|
from reflex.components.core.debounce import DebounceInput
|
||||||
|
from reflex.components.literals import LiteralInputType
|
||||||
from reflex.components.radix.themes.components.icons import Icon
|
from reflex.components.radix.themes.components.icons import Icon
|
||||||
from reflex.constants import EventTriggers
|
from reflex.constants import EventTriggers
|
||||||
from reflex.vars import Var
|
from reflex.vars import Var
|
||||||
@ -136,6 +137,9 @@ class Input(RadixThemesComponent):
|
|||||||
# Indicates that the input is required
|
# Indicates that the input is required
|
||||||
required: Var[bool]
|
required: Var[bool]
|
||||||
|
|
||||||
|
# The type of input.
|
||||||
|
type: Var[LiteralInputType] = "text" # type: ignore
|
||||||
|
|
||||||
# Value of the input
|
# Value of the input
|
||||||
value: Var[str]
|
value: Var[str]
|
||||||
|
|
||||||
@ -160,6 +164,7 @@ class Input(RadixThemesComponent):
|
|||||||
"name",
|
"name",
|
||||||
"placeholder",
|
"placeholder",
|
||||||
"required",
|
"required",
|
||||||
|
"type",
|
||||||
"value",
|
"value",
|
||||||
"on_change",
|
"on_change",
|
||||||
"on_focus",
|
"on_focus",
|
||||||
|
@ -22,6 +22,7 @@ from ..base import (
|
|||||||
LiteralSize,
|
LiteralSize,
|
||||||
RadixThemesComponent,
|
RadixThemesComponent,
|
||||||
)
|
)
|
||||||
|
from reflex.components.literals import LiteralInputType
|
||||||
|
|
||||||
LiteralTextFieldSize = Literal["1", "2", "3"]
|
LiteralTextFieldSize = Literal["1", "2", "3"]
|
||||||
LiteralTextFieldVariant = Literal["classic", "surface", "soft"]
|
LiteralTextFieldVariant = Literal["classic", "surface", "soft"]
|
||||||
@ -924,6 +925,60 @@ class Input(RadixThemesComponent):
|
|||||||
name: Optional[Union[Var[str], str]] = None,
|
name: Optional[Union[Var[str], str]] = None,
|
||||||
placeholder: Optional[Union[Var[str], str]] = None,
|
placeholder: Optional[Union[Var[str], str]] = None,
|
||||||
required: Optional[Union[Var[bool], bool]] = None,
|
required: Optional[Union[Var[bool], bool]] = None,
|
||||||
|
type: Optional[
|
||||||
|
Union[
|
||||||
|
Var[
|
||||||
|
Literal[
|
||||||
|
"button",
|
||||||
|
"checkbox",
|
||||||
|
"color",
|
||||||
|
"date",
|
||||||
|
"datetime-local",
|
||||||
|
"email",
|
||||||
|
"file",
|
||||||
|
"hidden",
|
||||||
|
"image",
|
||||||
|
"month",
|
||||||
|
"number",
|
||||||
|
"password",
|
||||||
|
"radio",
|
||||||
|
"range",
|
||||||
|
"reset",
|
||||||
|
"search",
|
||||||
|
"submit",
|
||||||
|
"tel",
|
||||||
|
"text",
|
||||||
|
"time",
|
||||||
|
"url",
|
||||||
|
"week",
|
||||||
|
]
|
||||||
|
],
|
||||||
|
Literal[
|
||||||
|
"button",
|
||||||
|
"checkbox",
|
||||||
|
"color",
|
||||||
|
"date",
|
||||||
|
"datetime-local",
|
||||||
|
"email",
|
||||||
|
"file",
|
||||||
|
"hidden",
|
||||||
|
"image",
|
||||||
|
"month",
|
||||||
|
"number",
|
||||||
|
"password",
|
||||||
|
"radio",
|
||||||
|
"range",
|
||||||
|
"reset",
|
||||||
|
"search",
|
||||||
|
"submit",
|
||||||
|
"tel",
|
||||||
|
"text",
|
||||||
|
"time",
|
||||||
|
"url",
|
||||||
|
"week",
|
||||||
|
],
|
||||||
|
]
|
||||||
|
] = None,
|
||||||
value: Optional[Union[Var[str], str]] = None,
|
value: Optional[Union[Var[str], str]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
@ -1003,6 +1058,7 @@ class Input(RadixThemesComponent):
|
|||||||
name: Name of the input, used when sending form data
|
name: Name of the input, used when sending form data
|
||||||
placeholder: Placeholder text in the input
|
placeholder: Placeholder text in the input
|
||||||
required: Indicates that the input is required
|
required: Indicates that the input is required
|
||||||
|
type: The type of input.
|
||||||
value: Value of the input
|
value: Value of the input
|
||||||
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.
|
||||||
|
Loading…
Reference in New Issue
Block a user