-
Notifications
You must be signed in to change notification settings - Fork 77
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
Enhancement: [calcite-tree] Support actions/menu in tree items #3127
Comments
Seems like this could adopt the action / content start / end slot paradigm to allow for these customizations, similar to a list item. |
@ellenupp |
Yeah that would be great, thanks. |
**Related Issue:** #3127 ## Summary This PR aims to enhance the `calcite-tree-item` with an `actions-end` feature to accommodate a dropdown menu. - `calcite-tree-item` now supports `actions-end` slot for adding actions to the end of the component, with a recommendation to use two or fewer actions. - Including a `calcite-dropdown` within a `calcite-tree-item` renders as expected. - Includes `icon-start` per the use case described in the issue. - Adds a story to demo the use case. - Screenshots to cover various scenarios. Thanks @macandcheese for help with styling.
Installed and assigned for verification. |
Verified in |
…6403) **Related Issue:** #6361, #3127 ## Summary Moved the `actions-end` slot outside of the `node-container` layout and placed it next to it instead, similar to `notice`. This way the padding on the `node-container` does not add to the action-ends. Expected consistent height on the `tree-item` when bringing in `actions-end` can be preserved like this (here to show designers how this can be demo-ed to end-users). s (24) tree-item: s slotted component + s action m (32) tree-item: m slotted component + m action l (48) tree-item: l slotted component + l action https://user-images.githubusercontent.com/19231036/216716464-8413540a-85f5-4183-a2b1-b67652ae1384.mov We need to follow up on clipping the action: - We’re not normally clipping actions to accommodate component heights, it’s inconsistent with how we normally handle slots. So here I’m clipping the actions for the time being and marking this internally as a known issue (Figma and implementation side) - Large clips outline: clips top and bottom, will be added to the note above.
Getting around to trying this out- it looks great, thanks! |
Description
We would like to include a menu of actions in each tree item, ex:
Including a calcite-dropdown within a calcite-tree-item does not render in a usable way as the dropdown is constrained to the current tree level. It would be great to have a slot in the tree item to accommodate such a menu.
https://codepen.io/ellupp/pen/PojWvmR?editors=1100
Acceptance Criteria
Tree items can include a menu of actions/dropdown. When opened, the menu should render on top of all tree items such that it is entirely visible.
Relevant Info
Supporting a menu is the key enhancement needed but we also need to support multiple actions in some tree items. Slotting a calcite-button into the tree item works for this at the moment. Also, in our use case we only want the actions to be visible on hover or when focus is on/within the tree item.
Which Component
calcite-tree/calcite-tree-item
Example Use Case
Please contact me for link to a custom tree implementation in dashboards that has the desired functionality.
cc @vijayendranj @julio8a
The text was updated successfully, but these errors were encountered: