Skip to content

Commit

Permalink
fix: Remove tooltip prop (#334)
Browse files Browse the repository at this point in the history
We do not want to support this prop. Removing it.
  • Loading branch information
jnumainville authored Mar 4, 2024
1 parent 9d6b7de commit cbe2140
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 52 deletions.
24 changes: 0 additions & 24 deletions plugins/ui/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,6 @@ ui.picker(
selected_key: Key | None = None,
on_selection_change: Callable[[Key], None] | None = None,
on_change: Callable[[Key], None] | None = None,
tooltip: bool | TooltipOptions | None = None,
**props: Any
) -> ItemElement
```
Expand All @@ -1088,7 +1087,6 @@ ui.picker(
| `selected_key` | `Key \| None` | The currently selected key in the collection (controlled). |
| `on_selection_change` | `Callable[[Key], None] \| None` | Handler that is called when the selection changes. |
| `on_change` | `Callable[[Key], None] \| None` | Alias of `on_selection_change`. Handler that is called when the selection changes. |
| `tooltip` | `bool \| TooltipOptions \| None` | Whether to show a tooltip on hover. If `True`, the tooltip will show. If `TooltipOptions`, the tooltip will be created with the specified options. |
| `**props` | `Any` | Any other [Picker](https://react-spectrum.adobe.com/react-spectrum/Picker.html) prop, with the exception of `items`, `validate`, `errorMessage` (as a callback) and `onLoadMore` |

```py
Expand Down Expand Up @@ -1705,23 +1703,6 @@ TransformedData = Any
Stringable = str | int | float | bool
PickerItem = Stringable | ItemElement
Key = Stringable
PlacementOptions = Literal[
'auto',
'auto-start',
'auto-end',
'top',
'top-start',
'top-end',
'bottom',
'bottom-start',
'bottom-end',
'right',
'right-start',
'right-end',
'left',
'left-start',
'left-end'
]

T = TypeVar("T")
Combination: TypeAlias = T | set[T] | Sequence[T]
Expand Down Expand Up @@ -1767,11 +1748,6 @@ class LinkPoint(TypedDict):

# Column to link to
column: str

# Typed dictionaty for tooltip options
# https://popper.js.org/docs/v2/constructors/#options
class TooltipOptions(TypedDict):
placement: Optional[PlacementOptions]
```

#### Context
Expand Down
7 changes: 1 addition & 6 deletions plugins/ui/src/deephaven/ui/components/picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .section import SectionElement, PickerItem
from ..elements import BaseElement
from .._internal.utils import create_props
from ..types import ColumnName, Key, TooltipOptions
from ..types import ColumnName, Key

PickerElement = BaseElement

Expand All @@ -22,7 +22,6 @@ def picker(
selected_key: Key | None = None,
on_selection_change: Callable[[Key], None] | None = None,
on_change: Callable[[Key], None] | None = None,
tooltip: bool | TooltipOptions | None = None,
**props: Any,
) -> PickerElement:
"""
Expand Down Expand Up @@ -60,10 +59,6 @@ def picker(
Handler that is called when the selection changes.
on_change:
Alias of `on_selection_change`. Handler that is called when the selection changes.
tooltip:
Whether to show a tooltip on hover.
If `True`, the tooltip will show.
If `TooltipOptions`, the tooltip will be created with the specified options.
**props:
Any other Picker prop, except items.
Expand Down
22 changes: 0 additions & 22 deletions plugins/ui/src/deephaven/ui/types/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,3 @@
# Stringable is a type that is naturally convertible to a string
Stringable = Union[str, int, float, bool]
Key = Stringable

PlacementOptions = Literal[
"auto",
"auto-start",
"auto-end",
"top",
"top-start",
"top-end",
"bottom",
"bottom-start",
"bottom-end",
"right",
"right-start",
"right-end",
"left",
"left-start",
"left-end",
]


class TooltipOptions(TypedDict):
placement: Optional[PlacementOptions]

0 comments on commit cbe2140

Please sign in to comment.