-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- ui.action_group - ui.action_menu - ui.list_action_group - ui.list_action_menu - Cleaned up some element name utils Testing - I tested action_group and action_menu in isolation - I tested list_action_group and list_action_menu in `list_view` actions prop as well as in `item_table_source` resolves #445
- Loading branch information
Showing
24 changed files
with
867 additions
and
600 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from ..elements import BaseElement | ||
|
||
|
||
# TODO: pydocs for action_group #481 | ||
def action_group(*children, **props): | ||
""" | ||
An ActionGroup is a grouping of ActionButtons that are related to one another. | ||
Args: | ||
children: A list of Item or primitive elements. | ||
**props: Any other ActionGroup prop. | ||
""" | ||
return BaseElement(f"deephaven.ui.components.ActionGroup", *children, **props) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from ..elements import BaseElement | ||
|
||
|
||
# TODO: pydocs for action_menu #482 | ||
def action_menu(*children, **props): | ||
""" | ||
ActionMenu combines an ActionButton with a Menu for simple "more actions" use cases. | ||
Args: | ||
children: A list of Item or primitive elements. | ||
**props: Any other ActionMenu prop. | ||
""" | ||
return BaseElement(f"deephaven.ui.components.ActionMenu", *children, **props) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { | ||
ActionGroup as DHActionGroup, | ||
ActionGroupProps as DHActionGroupProps, | ||
} from '@deephaven/components'; | ||
import { | ||
SerializedSelectionProps, | ||
useSelectionProps, | ||
} from './spectrum/useSelectionProps'; | ||
|
||
export type SerializedActionGroupProps<T> = Omit< | ||
DHActionGroupProps<T>, | ||
'selectionMode' | 'onChange' | 'onSelectionChange' | ||
> & | ||
SerializedSelectionProps; | ||
|
||
function ActionGroup<T>({ | ||
selectionMode: selectionModeMaybeUppercase, | ||
onChange: serializedOnChange, | ||
onSelectionChange: serializedOnSelectionChange, | ||
...props | ||
}: SerializedActionGroupProps<T>): JSX.Element { | ||
const { selectionMode, onChange, onSelectionChange } = useSelectionProps({ | ||
selectionMode: selectionModeMaybeUppercase, | ||
onChange: serializedOnChange, | ||
onSelectionChange: serializedOnSelectionChange, | ||
}); | ||
|
||
return ( | ||
<DHActionGroup | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
selectionMode={selectionMode} | ||
onChange={onChange} | ||
onSelectionChange={onSelectionChange} | ||
/> | ||
); | ||
} | ||
|
||
export default ActionGroup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.