feat(dropdown): add noMenu input and custom icon support (#599, #601)#682
Open
giulio-leone wants to merge 2 commits into
Open
feat(dropdown): add noMenu input and custom icon support (#599, #601)#682giulio-leone wants to merge 2 commits into
giulio-leone wants to merge 2 commits into
Conversation
…talia#601) Add three new inputs to ItDropdownComponent: - noMenu: hides the dropdown menu, rendering only the styled button - iconName/iconSize: allow customizing the dropdown toggle icon - staticIcon: disables the rotation animation on open/close When noMenu is true, data-bs-toggle and aria-haspopup are removed and the Bootstrap Dropdown plugin is not initialized. All new inputs have backward-compatible defaults (expand icon, sm size, rotation enabled, menu visible). Includes 26 new tests covering all combinations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Showcase three dropdown variants: noMenu (action button without menu), custom icon (it-settings), and combined noMenu with custom icon. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@giulio-leone is attempting to deploy a commit to the dip-trasformazione-digitale Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #599 and #601
Problem
[Feat] Possibilità di utilizzare il componente <it-dropdown> senza menù #599: The
<it-dropdown>component always renders the.dropdown-menuelement, even when no menu items are provided. This makes it impossible to use the dropdown button appearance without an attached menu (e.g. to trigger a modal on click).[Feat] Possibilità di personalizzare l'icona (e la sua dimensione) usata dal componente <it-dropdown> #601: The dropdown icon is hardcoded to
expandat sizesmwith rotation animation. Users cannot customize the icon, its size, or disable the rotation.Solution
Added four new inputs to
ItDropdownComponent:noMenubooleanfalseiconNameIconName'expand'iconSizeIconSize'sm'staticIconbooleanfalseWhen
noMenuis true:.dropdown-menudiv is not rendereddata-bs-toggle="dropdown"andaria-haspopupattributes are removedAll defaults preserve existing behavior — fully backward compatible.
Usage examples
Verification