add more props

This commit is contained in:
Elijah 2024-11-07 15:31:17 +00:00
parent 6fc625c5bc
commit 41b6efd23d
4 changed files with 31 additions and 3 deletions

View File

@ -5,11 +5,11 @@ from __future__ import annotations
from typing import Any, Dict, Literal
from reflex.components import Component
from reflex.components.core.breakpoints import Responsive
from reflex.components.tags import Tag
from reflex.config import get_config
from reflex.utils.imports import ImportDict, ImportVar
from reflex.vars.base import Var
from reflex.components.core.breakpoints import Responsive
LiteralAlign = Literal["start", "center", "end", "baseline", "stretch"]
LiteralJustify = Literal["start", "center", "end", "between"]

View File

@ -7,7 +7,7 @@ from reflex.components.core.breakpoints import Responsive
from reflex.components.el import elements
from reflex.vars.base import Var
from ..base import RadixThemesComponent, CommonPaddingProps
from ..base import CommonPaddingProps, RadixThemesComponent
class TableRoot(elements.Table, RadixThemesComponent):
@ -51,6 +51,12 @@ class TableColumnHeaderCell(elements.Th, RadixThemesComponent):
# The justification of the column
justify: Var[Literal["start", "center", "end"]]
# The minimum width of the cell
min_width: Var[Responsive[str]]
# The maximum width of the cell
max_width: Var[Responsive[str]]
_invalid_children: List[str] = [
"TableBody",
"TableHeader",
@ -107,6 +113,12 @@ class TableRowHeaderCell(elements.Th, CommonPaddingProps, RadixThemesComponent):
# The justification of the column
justify: Var[Literal["start", "center", "end"]]
# The minimum width of the cell
min_width: Var[Responsive[str]]
# The maximum width of the cell
max_width: Var[Responsive[str]]
_invalid_children: List[str] = [
"TableBody",
"TableHeader",

View File

@ -322,6 +322,12 @@ class TableColumnHeaderCell(elements.Th, RadixThemesComponent):
Var[Literal["center", "end", "start"]],
]
] = None,
min_width: Optional[
Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str]
] = None,
max_width: Optional[
Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str]
] = None,
align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
col_span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
headers: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
@ -382,6 +388,8 @@ class TableColumnHeaderCell(elements.Th, RadixThemesComponent):
Args:
*children: Child components.
justify: The justification of the column
min_width: The minimum width of the cell
max_width: The maximum width of the cell
align: Alignment of the content within the table header cell
col_span: Number of columns a header cell should span
headers: IDs of the headers associated with this header cell
@ -757,6 +765,12 @@ class TableRowHeaderCell(elements.Th, CommonPaddingProps, RadixThemesComponent):
Var[Literal["center", "end", "start"]],
]
] = None,
min_width: Optional[
Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str]
] = None,
max_width: Optional[
Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str]
] = None,
align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
col_span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
headers: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
@ -936,6 +950,8 @@ class TableRowHeaderCell(elements.Th, CommonPaddingProps, RadixThemesComponent):
Args:
*children: Child components.
justify: The justification of the column
min_width: The minimum width of the cell
max_width: The maximum width of the cell
align: Alignment of the content within the table header cell
col_span: Number of columns a header cell should span
headers: IDs of the headers associated with this header cell

View File

@ -7,7 +7,7 @@ from typing import Literal
from reflex.components.core.breakpoints import Responsive
from reflex.vars.base import Var
from ..base import CommonMarginProps, LiteralSpacing, RadixThemesComponent, CommonPaddingProps
from ..base import CommonMarginProps, CommonPaddingProps, RadixThemesComponent
LiteralBoolNumber = Literal["0", "1"]