update column select literals (#2150)

This commit is contained in:
Tom Gotsman 2023-11-20 16:17:27 -08:00 committed by GitHub
parent 5eb4c4e62a
commit b6e7744498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -2,7 +2,7 @@
from __future__ import annotations
from enum import Enum
from typing import Any, Callable, Dict, List, Optional, Union
from typing import Any, Callable, Dict, List, Literal, Optional, Union
from reflex.base import Base
from reflex.components.component import Component, NoSSRComponent
@ -179,8 +179,8 @@ class DataEditor(NoSSRComponent):
# Controls the drawing of the left hand vertical border of a column. If set to a boolean value it controls all borders.
vertical_border: Var[bool] # TODO: support a mapping (dict[int, bool])
# Allow columns selections. ("none", "single", "multiple")
column_select: Var[str]
# Allow columns selections. ("none", "single", "multi")
column_select: Var[Literal["none", "single", "multi"]]
# Prevent diagonal scrolling.
prevent_diagonal_scrolling: Var[bool]

View File

@ -8,7 +8,7 @@ from reflex.vars import Var, BaseVar, ComputedVar
from reflex.event import EventChain, EventHandler, EventSpec
from reflex.style import Style
from enum import Enum
from typing import Any, Callable, Dict, List, Optional, Union
from typing import Any, Callable, Dict, List, Literal, Optional, Union
from reflex.base import Base
from reflex.components.component import Component, NoSSRComponent
from reflex.components.literals import LiteralRowMarker
@ -114,7 +114,12 @@ class DataEditor(NoSSRComponent):
smooth_scroll_x: Optional[Union[Var[bool], bool]] = None,
smooth_scroll_y: Optional[Union[Var[bool], bool]] = None,
vertical_border: Optional[Union[Var[bool], bool]] = None,
column_select: Optional[Union[Var[str], str]] = None,
column_select: Optional[
Union[
Var[Literal["none", "single", "multi"]],
Literal["none", "single", "multi"],
]
] = None,
prevent_diagonal_scrolling: Optional[Union[Var[bool], bool]] = None,
overscroll_x: Optional[Union[Var[int], int]] = None,
overscroll_y: Optional[Union[Var[int], int]] = None,
@ -205,7 +210,7 @@ class DataEditor(NoSSRComponent):
smooth_scroll_x: Enable horizontal smooth scrolling.
smooth_scroll_y: Enable vertical smooth scrolling.
vertical_border: Controls the drawing of the left hand vertical border of a column. If set to a boolean value it controls all borders.
column_select: Allow columns selections. ("none", "single", "multiple")
column_select: Allow columns selections. ("none", "single", "multi")
prevent_diagonal_scrolling: Prevent diagonal scrolling.
overscroll_x: Allow to scroll past the limit of the actual content on the horizontal axis.
overscroll_y: Allow to scroll past the limit of the actual content on the vertical axis.