From 3910e5beb4e553a4c0fd10e824412999063331ba Mon Sep 17 00:00:00 2001 From: Joe Numainville Date: Thu, 14 Mar 2024 10:46:42 -0500 Subject: [PATCH 1/7] initial impl --- .../src/deephaven/ui/components/__init__.py | 2 + .../src/deephaven/ui/components/list_view.py | 83 +++++++++++++++++++ .../ui/components/spectrum/action_button.py | 4 +- plugins/ui/src/deephaven/ui/types/types.py | 3 +- 4 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 plugins/ui/src/deephaven/ui/components/list_view.py diff --git a/plugins/ui/src/deephaven/ui/components/__init__.py b/plugins/ui/src/deephaven/ui/components/__init__.py index 02d648588..884f4aa53 100644 --- a/plugins/ui/src/deephaven/ui/components/__init__.py +++ b/plugins/ui/src/deephaven/ui/components/__init__.py @@ -11,6 +11,7 @@ from .picker import picker from .section import section from .item import item +from .list_view import list_view from . import html @@ -34,6 +35,7 @@ "icon_wrapper", "item", "illustrated_message", + "list_view", "html", "number_field", "panel", diff --git a/plugins/ui/src/deephaven/ui/components/list_view.py b/plugins/ui/src/deephaven/ui/components/list_view.py new file mode 100644 index 000000000..b230b6ee5 --- /dev/null +++ b/plugins/ui/src/deephaven/ui/components/list_view.py @@ -0,0 +1,83 @@ +from __future__ import annotations + +from typing import Callable, Any, Union + +from deephaven.table import Table + +from .item import ItemElement +from .. import Element +from ..elements import BaseElement +from .._internal.utils import create_props +from ..types import ColumnName, Stringable, Selection +from .spectrum import ActionButtonElement + +ListViewItem = Union[Stringable, ItemElement] + +ListViewElement = Element + +# TODO: ActionGroupElement and ActionMenuElement are not created yet +ActionGroupElement = Element +ActionMenuElement = Element + + +def list_view( + *children: ListViewItem | Table, + key_column: ColumnName | None = None, + label_column: ColumnName | None = None, + description_column: ColumnName | None = None, + icon_column: ColumnName | None = None, + action_buttons: ActionButtonElement + | ActionGroupElement + | ActionMenuElement + | None = None, + default_selected_keys: Selection | None = None, + selected_keys: Selection | None = None, + render_empty_state: Element | None = None, + on_selection_change: Callable[[Selection], None] | None = None, + on_change: Callable[[Selection], None] | None = None, + **props: Any, +) -> ListViewElement: + """ + A list view that can be used to create a list of items. Children should be one of two types: + 1. If children are of type `ListViewItem`, they are the list items. + 2. If children are of type `Table`, the values in the table are the list items. + There can only be one child, the `Table`. + + + Args: + *children: The options to render within the list_view. + key_column: + Only valid if children are of type Table. + The column of values to use as item keys. Defaults to the first column. + label_column: + Only valid if children are of type Table. + The column of values to display as primary text. Defaults to the key_column value. + description_column: + Only valid if children are of type Table. + The column of values to display as descriptions. + icon_column: Only valid if children are of type Table. + The column of values to map to icons. + action_buttons: + Only valid if any `ListViewItem` children do not already have embedded buttons. + The action buttons to render for all elements within the list view. + The `on_*` event handlers within the passed object will be modified + so that the second argument is the key for the `list_view` item that the buttons are embedded in. + default_selected_keys: + The initial selected key in the collection (uncontrolled). + selected_keys: + The currently selected key in the collection (controlled). + render_empty_state: + Sets what the `list_view` should render when there is no content to display. + on_selection_change: + Handler that is called when the selection changes. + on_change: + Alias of `on_selection_change`. Handler that is called when the selection changes. + **props: + Any other ListView prop, except items, dragAndDropHooks, and onLoadMore. + + Returns: + The rendered ListView. + """ + children, props = create_props(locals()) + + return BaseElement("deephaven.ui.components.ListView", *children, **props) diff --git a/plugins/ui/src/deephaven/ui/components/spectrum/action_button.py b/plugins/ui/src/deephaven/ui/components/spectrum/action_button.py index 3b322b5cf..d8d99d9b2 100644 --- a/plugins/ui/src/deephaven/ui/components/spectrum/action_button.py +++ b/plugins/ui/src/deephaven/ui/components/spectrum/action_button.py @@ -20,6 +20,8 @@ from .basic import spectrum_element from ...elements import Element +ActionButtonElement = Element + def action_button( *children: Any, @@ -86,7 +88,7 @@ def action_button( aria_details: str | None = None, UNSAFE_class_name: str | None = None, UNSAFE_style: CSSProperties | None = None, -) -> Element: +) -> ActionButtonElement: """ ActionButtons allow users to perform an action. They're used for similar, task-based options within a workflow, and are ideal for interfaces where buttons aren't meant to draw a lot of attention. Python implementation for the Adobe React Spectrum ActionButton component: https://react-spectrum.adobe.com/react-spectrum/ActionButton.html diff --git a/plugins/ui/src/deephaven/ui/types/types.py b/plugins/ui/src/deephaven/ui/types/types.py index 7962f207d..614858e51 100644 --- a/plugins/ui/src/deephaven/ui/types/types.py +++ b/plugins/ui/src/deephaven/ui/types/types.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, Literal, Union, List, Tuple, Callable, TypedDict +from typing import Any, Dict, Literal, Union, List, Tuple, Callable, TypedDict, Sequence from deephaven import SortDirection @@ -106,3 +106,4 @@ class RowDataValue(CellData): Stringable = Union[str, int, float, bool] Key = Stringable Dependencies = Union[Tuple[Any], List[Any]] +Selection = Sequence[Key] From 7cdb160aa10a7ad69bcd4112af3cbe5979c4307a Mon Sep 17 00:00:00 2001 From: Joe Numainville Date: Thu, 14 Mar 2024 11:07:39 -0500 Subject: [PATCH 2/7] small fix --- plugins/ui/src/deephaven/ui/components/list_view.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/ui/src/deephaven/ui/components/list_view.py b/plugins/ui/src/deephaven/ui/components/list_view.py index b230b6ee5..ed71f1e32 100644 --- a/plugins/ui/src/deephaven/ui/components/list_view.py +++ b/plugins/ui/src/deephaven/ui/components/list_view.py @@ -63,9 +63,9 @@ def list_view( The `on_*` event handlers within the passed object will be modified so that the second argument is the key for the `list_view` item that the buttons are embedded in. default_selected_keys: - The initial selected key in the collection (uncontrolled). + The initial selected keys in the collection (uncontrolled). selected_keys: - The currently selected key in the collection (controlled). + The currently selected keys in the collection (controlled). render_empty_state: Sets what the `list_view` should render when there is no content to display. on_selection_change: From dbec9037a2f03761bb07f696bb2ef8915fa60c6b Mon Sep 17 00:00:00 2001 From: Joe Numainville Date: Thu, 14 Mar 2024 11:21:21 -0500 Subject: [PATCH 3/7] fix import --- plugins/ui/src/deephaven/ui/components/list_view.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/ui/src/deephaven/ui/components/list_view.py b/plugins/ui/src/deephaven/ui/components/list_view.py index ed71f1e32..83a04183b 100644 --- a/plugins/ui/src/deephaven/ui/components/list_view.py +++ b/plugins/ui/src/deephaven/ui/components/list_view.py @@ -5,8 +5,7 @@ from deephaven.table import Table from .item import ItemElement -from .. import Element -from ..elements import BaseElement +from ..elements import BaseElement, Element from .._internal.utils import create_props from ..types import ColumnName, Stringable, Selection from .spectrum import ActionButtonElement From 17dc230269770ef12d87c3f4d91d0c44390a2986 Mon Sep 17 00:00:00 2001 From: Joe Numainville Date: Wed, 27 Mar 2024 16:40:06 -0500 Subject: [PATCH 4/7] comments --- plugins/ui/DESIGN.md | 80 ++++++++++++++----- .../ui/components/list_action_group.py | 37 +++++++++ .../ui/components/list_action_menu.py | 38 +++++++++ .../src/deephaven/ui/components/list_view.py | 21 ++--- plugins/ui/src/deephaven/ui/types/types.py | 2 + 5 files changed, 145 insertions(+), 33 deletions(-) create mode 100644 plugins/ui/src/deephaven/ui/components/list_action_group.py create mode 100644 plugins/ui/src/deephaven/ui/components/list_action_menu.py diff --git a/plugins/ui/DESIGN.md b/plugins/ui/DESIGN.md index fbbfd49c3..ecc9d2f90 100644 --- a/plugins/ui/DESIGN.md +++ b/plugins/ui/DESIGN.md @@ -1188,6 +1188,50 @@ picker7 = ui.picker( ) ``` +###### ui.list_action_group +A group of action buttons that can be used to create a list of actions. +This component should be used within the actions prop of a `ListView` component. + +```py +def list_action_group( + *children: ActionGroupItem, + on_action: Callable[[ButtonKey, Key], None] | None = None, + on_selection_change: Callable[[Selection, Key], None] | None = None, + **props: Any +) -> ListActionGroupElement: +``` + +###### Parameters +| Parameter | Type | Description | +|-------------------------|------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------| +| `*children` | `ActionGroupItem` | The options to render within the picker. | +| `on_action` | `Callable[[ButtonKey, Key], None] \| None` | Handler that is called when an item is pressed. The first argument is the key of the action, the second argument is the key of the list_view item. | +| `on_selection_change` | `Callable[[Selection, Key], None] \| None` | Handler that is called when the selection changes. The first argument is the selection, the second argument is the key of the list_view item. | +| `**props` | `Any` | Any other [ActionGroup](https://react-spectrum.adobe.com/react-spectrum/ActionGroup.html) prop. | + + + +###### ui.list_action_menu +A group of action buttons that can be used to create a list of actions. +This component should be used within the actions prop of a `ListView` component. + +```py +def list_action_menu( + *children: ActionMenuItem, + on_action: Callable[[Key, Key], None] | None = None, + on_open_change: Callable[[bool, Key], None] | None = None, + **props: Any +) -> ListActionMenuElement: +``` + +###### Parameters +| Parameter | Type | Description | +|-------------------------|------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------| +| `*children` | `ActionMenuItem` | The options to render within the picker. | +| `on_action` | `Callable[[Key, Key], None] \| None` | Handler that is called when an item is pressed. The first argument is the key of the action, the second argument is the key of the list_view item. | +| `on_open_change` | `Callable[[bool, Key], None] \| None` | The first argument is a boolean indicating if the menu is open, the second argument is the key of the list_view item. | +| `**props` | `Any` | Any other [ActionMenu](https://react-spectrum.adobe.com/react-spectrum/ActionMenu.html) prop. | + ###### ui.list_view A list view that can be used to create a list of items. Children should be one of two types: 1. If children are of type `ListViewItem`, they are the list items. @@ -1201,7 +1245,7 @@ ui.list_view( label_column: ColumnName | None = None, description_column: ColumnName | None = None, icon_column: ColumnName | None = None, - action_buttons: ActionButtonElement | ActionGroupElement | ActionMenuElement | None = None, + actions: ListActionGroupElement | ListActionMenuElement | None = None, default_selected_keys: Selection | None = None, selected_keys: Selection | None = None, render_empty_state: Element | None = None, @@ -1212,20 +1256,20 @@ ui.list_view( ``` ###### Parameters -| Parameter | Type | Description | -|------------------------------|----------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `*children` | `ListViewItem \| Table` | The options to render within the picker. | -| `key_column` | `ColumnName \| None` | Only valid if children are of type `Table`. The column of values to use as item keys. Defaults to the first column. | -| `label_column` | `ColumnName \| None` | Only valid if children are of type `Table`. The column of values to display as primary text. Defaults to the `key_column` value. | -| `description_column` | `ColumnName \| None` | Only valid if children are of type `Table`. The column of values to display as descriptions. | -| `icon_column` | `ColumnName \| None` | Only valid if children are of type `Table`. The column of values to map to icons. | -| `action_buttons` | `ActionButtonElement \| ActionGroupElement \| ActionMenuElement \| None` | Only valid if any `ListViewItem` children do not already have embedded buttons. The action buttons to render for all elements within the list view. The `on_*` event handlers within the passed object will be modified so that the second argument is the key for the `list_view` item that the buttons are embedded in. | -| `default_selected_keys` | `Selection \| None` | The initial selected keys in the collection (uncontrolled). | -| `selected_keys` | `Selection \| None` | The currently selected keys in the collection (controlled). | -| `render_empty_state` | `Element \| None` | Sets what the `list_view` should render when there is no content to display. | -| `on_selection_change` | `Callable[[Selection], None] \| None` | Handler that is called when the selections changes. | -| `on_change` | `Callable[[Selection], None] \| None` | Alias of `on_selection_change`. Handler that is called when the selections changes. | -| `**props` | `Any` | Any other [ListView](https://react-spectrum.adobe.com/react-spectrum/ListView.html) prop, with the exception of `items`, `dragAndDropHooks`, and `onLoadMore`. | +| Parameter | Type | Description | +|-------------------------|------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `*children` | `ListViewItem \| Table` | The options to render within the picker. | +| `key_column` | `ColumnName \| None` | Only valid if children are of type `Table`. The column of values to use as item keys. Defaults to the first column. | +| `label_column` | `ColumnName \| None` | Only valid if children are of type `Table`. The column of values to display as primary text. Defaults to the `key_column` value. | +| `description_column` | `ColumnName \| None` | Only valid if children are of type `Table`. The column of values to display as descriptions. | +| `icon_column` | `ColumnName \| None` | Only valid if children are of type `Table`. The column of values to map to icons. | +| `actions` | `ListActionGroupElement \| ListActionMenuElement \| None` | Only valid if children are of type Table. The action group or menus to render for all elements within the list view. | +| `default_selected_keys` | `Selection \| None` | The initial selected keys in the collection (uncontrolled). | +| `selected_keys` | `Selection \| None` | The currently selected keys in the collection (controlled). | +| `render_empty_state` | `Element \| None` | Sets what the `list_view` should render when there is no content to display. | +| `on_selection_change` | `Callable[[Selection], None] \| None` | Handler that is called when the selections changes. | +| `on_change` | `Callable[[Selection], None] \| None` | Alias of `on_selection_change`. Handler that is called when the selections changes. | +| `**props` | `Any` | Any other [ListView](https://react-spectrum.adobe.com/react-spectrum/ListView.html) prop, with the exception of `items`, `dragAndDropHooks`, and `onLoadMore`. | ```py @@ -1298,15 +1342,15 @@ list_view5 = ui.list_view( # Buttons can be embedded in the list view. Note key is added to the on_press handler, but is not required. -on_button_action = lambda e, key: print(f"Event {e} was emitted for list item {key}") -button = ui.action_button("Print Item", on_press=on_button_action) +on_button_action = lambda action_key, key: print(f"Action {action_key} was pressed for list item {key}") +button = ui.list_action_group("Print Item", on_action=on_button_action) list_view7 = ui.list_view( "Option 1", "Option 2", "Option 3", "Option 4", - action_buttons=button, + actions=button, ) ``` diff --git a/plugins/ui/src/deephaven/ui/components/list_action_group.py b/plugins/ui/src/deephaven/ui/components/list_action_group.py new file mode 100644 index 000000000..c7f9840db --- /dev/null +++ b/plugins/ui/src/deephaven/ui/components/list_action_group.py @@ -0,0 +1,37 @@ +from __future__ import annotations + +from typing import Callable, Any, Union + +from .item import ItemElement +from ..elements import BaseElement, Element +from .._internal.utils import create_props +from ..types import Stringable, Selection, Key, ActionKey + +ActionGroupItem = Union[Stringable, ItemElement] +ListActionGroupElement = Element + + +def list_action_group( + *children: ActionGroupItem, + on_action: Callable[[ActionKey, Key], None] | None = None, + on_selection_change: Callable[[Selection, Key], None] | None = None, + **props: Any, +) -> ListActionGroupElement: + """ + A group of action buttons that can be used to create a list of actions. + This component should be used within the actions prop of a `ListView` component. + + Args: + *children: The options to render within the list_action_group. + on_action: Handler that is called when an item is pressed. + The first argument is the key of the action, the second argument is the key of the list_view item. + on_selection_change: Handler that is called when the selection changes. + The first argument is the selection, the second argument is the key of the list_view item. + **props: Any other ActionGroup prop. + + Returns: + A ListActionGroup that can be used within the actions prop of a `ListView` component. + """ + children, props = create_props(locals()) + + return BaseElement("deephaven.ui.components.ListActionGroup", *children, **props) diff --git a/plugins/ui/src/deephaven/ui/components/list_action_menu.py b/plugins/ui/src/deephaven/ui/components/list_action_menu.py new file mode 100644 index 000000000..412b50f51 --- /dev/null +++ b/plugins/ui/src/deephaven/ui/components/list_action_menu.py @@ -0,0 +1,38 @@ +from __future__ import annotations + +from typing import Callable, Any, Union + + +from .item import ItemElement +from ..elements import BaseElement, Element +from .._internal.utils import create_props +from ..types import Stringable, Key, ActionKey + +ActionMenuItem = Union[Stringable, ItemElement] +ListActionMenuElement = Element + + +def list_action_menu( + *children: ActionMenuItem, + on_action: Callable[[ActionKey, Key], None] | None = None, + on_open_change: Callable[[bool, Key], None] | None = None, + **props: Any, +) -> ListActionMenuElement: + """ + A menu of action buttons that can be used to create a list of actions. + This component should be used within the actions prop of a `ListView` component. + + Args: + *children: The options to render within the list_action_menu. + on_action: Handler that is called when an item is selected. + The first argument is the key of the action, the second argument is the key of the list_view item. + on_open_change: Handler that is called when the menu is opened or closed. + The first argument is a boolean indicating if the menu is open, the second argument is the key of the list_view item. + **props: Any other ActionMenu prop. + + Returns: + A ListActionGroup that can be used within the actions prop of a `ListView` component. + """ + children, props = create_props(locals()) + + return BaseElement("deephaven.ui.components.ListActionMenu", *children, **props) diff --git a/plugins/ui/src/deephaven/ui/components/list_view.py b/plugins/ui/src/deephaven/ui/components/list_view.py index 83a04183b..f467ba0de 100644 --- a/plugins/ui/src/deephaven/ui/components/list_view.py +++ b/plugins/ui/src/deephaven/ui/components/list_view.py @@ -5,19 +5,15 @@ from deephaven.table import Table from .item import ItemElement +from .list_action_group import ListActionGroupElement +from .list_action_menu import ListActionMenuElement from ..elements import BaseElement, Element from .._internal.utils import create_props from ..types import ColumnName, Stringable, Selection -from .spectrum import ActionButtonElement ListViewItem = Union[Stringable, ItemElement] - ListViewElement = Element -# TODO: ActionGroupElement and ActionMenuElement are not created yet -ActionGroupElement = Element -ActionMenuElement = Element - def list_view( *children: ListViewItem | Table, @@ -25,10 +21,7 @@ def list_view( label_column: ColumnName | None = None, description_column: ColumnName | None = None, icon_column: ColumnName | None = None, - action_buttons: ActionButtonElement - | ActionGroupElement - | ActionMenuElement - | None = None, + actions: ListActionGroupElement | ListActionMenuElement | None = None, default_selected_keys: Selection | None = None, selected_keys: Selection | None = None, render_empty_state: Element | None = None, @@ -56,11 +49,9 @@ def list_view( The column of values to display as descriptions. icon_column: Only valid if children are of type Table. The column of values to map to icons. - action_buttons: - Only valid if any `ListViewItem` children do not already have embedded buttons. - The action buttons to render for all elements within the list view. - The `on_*` event handlers within the passed object will be modified - so that the second argument is the key for the `list_view` item that the buttons are embedded in. + actions: + Only valid if children are of type Table. + The action group or menus to render for all elements within the list view. default_selected_keys: The initial selected keys in the collection (uncontrolled). selected_keys: diff --git a/plugins/ui/src/deephaven/ui/types/types.py b/plugins/ui/src/deephaven/ui/types/types.py index 614858e51..90bfd8480 100644 --- a/plugins/ui/src/deephaven/ui/types/types.py +++ b/plugins/ui/src/deephaven/ui/types/types.py @@ -105,5 +105,7 @@ class RowDataValue(CellData): # Stringable is a type that is naturally convertible to a string Stringable = Union[str, int, float, bool] Key = Stringable +ActionKey = Key + Dependencies = Union[Tuple[Any], List[Any]] Selection = Sequence[Key] From 8a4c82fd35ae54c00dca0e8c18e38581df2f18ec Mon Sep 17 00:00:00 2001 From: Joe Numainville Date: Wed, 27 Mar 2024 16:43:42 -0500 Subject: [PATCH 5/7] tweaks --- plugins/ui/DESIGN.md | 9 +++++---- .../ui/src/deephaven/ui/components/list_action_menu.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/ui/DESIGN.md b/plugins/ui/DESIGN.md index ecc9d2f90..30095227a 100644 --- a/plugins/ui/DESIGN.md +++ b/plugins/ui/DESIGN.md @@ -1195,7 +1195,7 @@ This component should be used within the actions prop of a `ListView` component. ```py def list_action_group( *children: ActionGroupItem, - on_action: Callable[[ButtonKey, Key], None] | None = None, + on_action: Callable[[ActionKey, Key], None] | None = None, on_selection_change: Callable[[Selection, Key], None] | None = None, **props: Any ) -> ListActionGroupElement: @@ -1205,7 +1205,7 @@ def list_action_group( | Parameter | Type | Description | |-------------------------|------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------| | `*children` | `ActionGroupItem` | The options to render within the picker. | -| `on_action` | `Callable[[ButtonKey, Key], None] \| None` | Handler that is called when an item is pressed. The first argument is the key of the action, the second argument is the key of the list_view item. | +| `on_action` | `Callable[[ActionKey, Key], None] \| None` | Handler that is called when an item is pressed. The first argument is the key of the action, the second argument is the key of the list_view item. | | `on_selection_change` | `Callable[[Selection, Key], None] \| None` | Handler that is called when the selection changes. The first argument is the selection, the second argument is the key of the list_view item. | | `**props` | `Any` | Any other [ActionGroup](https://react-spectrum.adobe.com/react-spectrum/ActionGroup.html) prop. | @@ -1218,7 +1218,7 @@ This component should be used within the actions prop of a `ListView` component. ```py def list_action_menu( *children: ActionMenuItem, - on_action: Callable[[Key, Key], None] | None = None, + on_action: Callable[[ActionKey, Key], None] | None = None, on_open_change: Callable[[bool, Key], None] | None = None, **props: Any ) -> ListActionMenuElement: @@ -1228,7 +1228,7 @@ def list_action_menu( | Parameter | Type | Description | |-------------------------|------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------| | `*children` | `ActionMenuItem` | The options to render within the picker. | -| `on_action` | `Callable[[Key, Key], None] \| None` | Handler that is called when an item is pressed. The first argument is the key of the action, the second argument is the key of the list_view item. | +| `on_action` | `Callable[[ActionKey, Key], None] \| None` | Handler that is called when an item is pressed. The first argument is the key of the action, the second argument is the key of the list_view item. | | `on_open_change` | `Callable[[bool, Key], None] \| None` | The first argument is a boolean indicating if the menu is open, the second argument is the key of the list_view item. | | `**props` | `Any` | Any other [ActionMenu](https://react-spectrum.adobe.com/react-spectrum/ActionMenu.html) prop. | @@ -1870,6 +1870,7 @@ TransformedData = Any Stringable = str | int | float | bool PickerItem = Stringable | ItemElement Key = Stringable +ActionKey = Key Selection = Sequence[Key] ListViewItem = Stringable | ItemElement diff --git a/plugins/ui/src/deephaven/ui/components/list_action_menu.py b/plugins/ui/src/deephaven/ui/components/list_action_menu.py index 412b50f51..7a9eb0af5 100644 --- a/plugins/ui/src/deephaven/ui/components/list_action_menu.py +++ b/plugins/ui/src/deephaven/ui/components/list_action_menu.py @@ -31,7 +31,7 @@ def list_action_menu( **props: Any other ActionMenu prop. Returns: - A ListActionGroup that can be used within the actions prop of a `ListView` component. + A ListActionMenu that can be used within the actions prop of a `ListView` component. """ children, props = create_props(locals()) From 3ed89652d94b70ec579d2ddd5f5156fdfb054c7e Mon Sep 17 00:00:00 2001 From: Joe Numainville Date: Mon, 1 Apr 2024 09:00:55 -0500 Subject: [PATCH 6/7] fixed imports --- plugins/ui/src/deephaven/ui/components/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/ui/src/deephaven/ui/components/__init__.py b/plugins/ui/src/deephaven/ui/components/__init__.py index 884f4aa53..f0678f892 100644 --- a/plugins/ui/src/deephaven/ui/components/__init__.py +++ b/plugins/ui/src/deephaven/ui/components/__init__.py @@ -12,6 +12,8 @@ from .section import section from .item import item from .list_view import list_view +from .list_action_group import list_action_group +from .list_action_menu import list_action_menu from . import html @@ -36,6 +38,8 @@ "item", "illustrated_message", "list_view", + "list_action_group", + "list_action_menu", "html", "number_field", "panel", From ac218b97ae57fe8918df8f3a6b3b4a9a92d079c5 Mon Sep 17 00:00:00 2001 From: Joe Date: Wed, 3 Apr 2024 09:51:23 -0500 Subject: [PATCH 7/7] Update plugins/ui/DESIGN.md Co-authored-by: Mike Bender --- plugins/ui/DESIGN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ui/DESIGN.md b/plugins/ui/DESIGN.md index 30095227a..43e6ca30e 100644 --- a/plugins/ui/DESIGN.md +++ b/plugins/ui/DESIGN.md @@ -1204,7 +1204,7 @@ def list_action_group( ###### Parameters | Parameter | Type | Description | |-------------------------|------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------| -| `*children` | `ActionGroupItem` | The options to render within the picker. | +| `*children` | `ActionGroupItem` | The actions to render within the action group. | | `on_action` | `Callable[[ActionKey, Key], None] \| None` | Handler that is called when an item is pressed. The first argument is the key of the action, the second argument is the key of the list_view item. | | `on_selection_change` | `Callable[[Selection, Key], None] \| None` | Handler that is called when the selection changes. The first argument is the selection, the second argument is the key of the list_view item. | | `**props` | `Any` | Any other [ActionGroup](https://react-spectrum.adobe.com/react-spectrum/ActionGroup.html) prop. |