-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ListView actions #448
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
08915e4
Cleaned up element type names (#445)
bmingles 6f74f16
Mapped ActionGroup and ListActionGroup (#445)
bmingles 7796c3b
action_menu and list_action_menu Python components (#445)
bmingles 70253ea
action_menu init (#445)
bmingles 171c3d7
Mapped ActionMenu and ListActionMenu (#445)
bmingles c11bb1c
ActionGroup wrapper (#445)
bmingles 8f603db
Upgraded DHC to ^0.78.0 and @deephaven/jsapi-types to ^1.0.0-dev0.34.…
bmingles ad7cb5e
Comment (#445)
bmingles 4f7272c
Comment (#445)
bmingles 056a4f2
Renamed params (#445)
bmingles 75691dc
comment (#445)
bmingles 6881f0f
Added list_view actions examples (#445)
bmingles 0c3ee53
Fixed naming convention in examples (#445)
bmingles f83ab39
Removed redundant "prefix" from names (#445)
bmingles 9937ba9
Fixed tests (#445)
bmingles c1efd29
Added TODO follow up comments (#445)
bmingles File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a follow-up TODO to explicitly add/document the props for this. @AkshatJawne could take that on, get him exposed to updating some Python code in a plugin.
@AkshatJawne as a precursor to what I mean, it would be similar to this change: https://github.com/deephaven/deephaven-plugins/pull/306/files
Right now this code accepts any keyword argument, but we want to explicitly add any prop that can be used and document it. They would generally map to the same props that are available on the UI component this maps to (in this case, the Spectrum ActionGroup).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, will take a look and get started!