Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jnumainville committed Apr 16, 2024
1 parent 848d15a commit 177ad93
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
32 changes: 17 additions & 15 deletions plugins/ui/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -1060,17 +1060,19 @@ def list_action_group(
*children: ActionGroupItem,
on_action: Callable[[ActionKey, Key], None] | None = None,
on_selection_change: Callable[[Selection, Key], None] | None = None,
on_change: Callable[[Selection, Key], None] | None = None,
**props: Any
) -> ListActionGroupElement:
```

###### Parameters
| Parameter | Type | Description |
|-------------------------|------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| `*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. |
| Parameter | Type | Description |
|-------------------------|------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `*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. |
| `on_change` | `Callable[[Selection, Key], None] \| None` | Alias of `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` | Any other [ActionGroup](https://react-spectrum.adobe.com/react-spectrum/ActionGroup.html) prop. |


###### ui.list_action_menu
Expand Down Expand Up @@ -1287,15 +1289,15 @@ ui.list_view(
```

###### Parameters
| Parameter | Type | Description |
|-------------------------|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `*children` | `Item \| Table \| ItemTableSource` | The options to render within the list_view. |
| `selection_mode` | `SelectionMode \| None` | Can be `MULTIPLE` to allow multiple selection, `SINGLE` to allow only single selection, or None to allow no selection. |
| `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. |
| Parameter | Type | Description |
|-------------------------|-----------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `*children` | `Item \| Table \| ItemTableSource` | The options to render within the list_view. |
| `selection_mode` | `SelectionMode \| None` | By default `"MULTIPLE"`, which allows multiple selection. May also be `"SINGLE"` to allow only single selection, or `"None"`/`None` to allow no selection. |
| `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`. |


Expand Down
4 changes: 4 additions & 0 deletions plugins/ui/src/deephaven/ui/components/list_action_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def list_action_group(
*children: ActionGroupItem,
on_action: Callable[[ActionKey, Key], None] | None = None,
on_selection_change: Callable[[Selection, Key], None] | None = None,
on_change: Callable[[Selection, Key], None] | None = None,
**props: Any,
) -> ListActionGroupElement:
"""
Expand All @@ -27,6 +28,9 @@ def list_action_group(
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.
on_change: Alias of 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:
Expand Down
4 changes: 2 additions & 2 deletions plugins/ui/src/deephaven/ui/components/list_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def list_view(
selected_keys:
The currently selected keys in the collection (controlled).
selection_mode:
Can be `MULTIPLE` to allow multiple selection, `SINGLE` to allow only single selection,
or None to allow no selection.
By default `"MULTIPLE"`, which allows multiple selection.
May also be `"SINGLE"` to allow only single selection, or `"None"`/`None` to allow no selection.
render_empty_state:
Sets what the `list_view` should render when there is no content to display.
on_selection_change:
Expand Down
2 changes: 1 addition & 1 deletion plugins/ui/src/deephaven/ui/types/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class RowDataValue(CellData):
TableData = Dict[ColumnName, ColumnData]
SearchMode = Literal["SHOW", "HIDE", "DEFAULT"]
SelectionArea = Literal["CELL", "ROW", "COLUMN"]
SelectionMode = Literal["SINGLE", "MULTIPLE"]
SelectionMode = Literal["SINGLE", "MULTIPLE", "NONE"]
Sentinel = Any
TransformedData = Any
StringSortDirection = Literal["ASC", "DESC"]
Expand Down

0 comments on commit 177ad93

Please sign in to comment.