feat(ui5-menu): selectable menu items #10028
Open
+731
−20
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.
This PR introduces MenuItemGroup component that can hold regular MenuItem components. The MenuItemGroup has a property named
itemSelectionMode
which can have values amongNone
(default),SingleSelect
andMultiSelect
. MenuItemGroup can be slotted in a Menu or MenuItem default slot as any other regular MenuItem. Nesting of MenuItemGroups is not allowed, but any Menu or MenuItem can contain more than one MenuItemGroup components with differentitemSelectionMode
settings.When
itemSelectionMode
is:None
, the Menu acts exactly like until now.SingleSelect
means that zero or one MenuItems can be selected at a time.MultiSelect
means that zero or many MenuItems can be selected at a time.There is also new property
isSelected
introduced in MenuItem. By setting it the item is marked as selected and this is visualized as checkmark at the end of the item. This property is taken into account only when the corresponding item is a member of MenuItemGroup withSingleSelect
orMultiSelect
value ofitemSelectionMode
.It is recommended to place separators before and after each MenuItemGroup, but this is not mandatory and depends on the application developers.