-
Notifications
You must be signed in to change notification settings - Fork 254
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(ui5-menu-item): add endContent slot #9077
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2f812c9
feat(ui5-menu-item): add endContent slot
NHristov-sap e6432e3
feat(ui5-menu-item): fix lint errors
NHristov-sap 8970d59
feat(ui5-menu-item): fix menu closing on click over components in end…
NHristov-sap 1ae8a38
feat(ui5-menu-item): remove redundant import
NHristov-sap 7d56ec1
feat(ui5-menu-item): fix endContent slot JsDoc
NHristov-sap 5f5bb19
feat(ui5-menu-item): fix tests
NHristov-sap 86fdc38
feat(ui5-menu-item): fix comment
NHristov-sap 06871e6
feat(ui5-menu-item): fix comments
NHristov-sap 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
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
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
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
4 changes: 4 additions & 0 deletions
4
packages/website/docs/_samples/main/Menu/MenuEndContent/MenuEndContent.md
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,4 @@ | ||
import html from '!!raw-loader!./sample.html'; | ||
import js from '!!raw-loader!./main.js'; | ||
|
||
<Editor html={html} js={js} /> |
36 changes: 36 additions & 0 deletions
36
packages/website/docs/_samples/main/Menu/MenuEndContent/main.js
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,36 @@ | ||
import "@ui5/webcomponents/dist/Menu.js"; | ||
import "@ui5/webcomponents/dist/MenuItem.js"; | ||
import "@ui5/webcomponents/dist/Button.js"; | ||
|
||
import "@ui5/webcomponents-icons/dist/add-document.js"; | ||
import "@ui5/webcomponents-icons/dist/add-folder.js"; | ||
import "@ui5/webcomponents-icons/dist/open-folder.js"; | ||
import "@ui5/webcomponents-icons/dist/action-settings.js"; | ||
import "@ui5/webcomponents-icons/dist/journey-arrive.js"; | ||
import "@ui5/webcomponents-icons/dist/slim-arrow-down.js"; | ||
import "@ui5/webcomponents-icons/dist/add.js"; | ||
import "@ui5/webcomponents-icons/dist/hint.js"; | ||
import "@ui5/webcomponents-icons/dist/favorite.js"; | ||
|
||
const btnOpenEndContent = document.getElementById("btnOpenEndContent"); | ||
const menuEndContent = document.getElementById("menuEndContent"); | ||
const btnNewAdd = document.getElementById("newAdd"); | ||
const btnNewHint = document.getElementById("newHint"); | ||
const btnNewFavorite = document.getElementById("newFavorite"); | ||
|
||
btnOpenEndContent.addEventListener("click", function(event) { | ||
menuEndContent.opener = btnOpenEndContent; | ||
menuEndContent.open = !menuEndContent.open; | ||
}); | ||
|
||
btnNewAdd.addEventListener("click", function(event) { | ||
alert("Add button pressed"); | ||
}); | ||
|
||
btnNewHint.addEventListener("click", function(event) { | ||
alert("Hint button pressed"); | ||
}); | ||
|
||
btnNewFavorite.addEventListener("click", function(event) { | ||
alert("Favorite button pressed"); | ||
}); |
41 changes: 41 additions & 0 deletions
41
packages/website/docs/_samples/main/Menu/MenuEndContent/sample.html
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,41 @@ | ||
<!-- playground-fold --> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Sample</title> | ||
</head> | ||
|
||
<body style="background-color: var(--sapBackgroundColor); height: 350px"> | ||
<!-- playground-fold-end --> | ||
|
||
<ui5-button id="btnOpenEndContent">Open Menu</ui5-button> | ||
|
||
<ui5-menu id="menuEndContent" header-text="My ui5-menu"> | ||
<ui5-menu-item text="New File" accessible-name="Opens a file explorer" additional-text="Ctrl+Alt+Shift+N" tooltip="Select a file - prevent default" icon="add-document"> | ||
<ui5-button id="newAdd" slot="endContent" icon="add" design="Transparent"></ui5-button> | ||
<ui5-button id="newHint" slot="endContent" icon="hint" design="Transparent"></ui5-button> | ||
<ui5-button id="newFavorite" slot="endContent" icon="favorite" design="Transparent"></ui5-button> | ||
</ui5-menu-item> | ||
<ui5-menu-item text="New Folder" additional-text="Ctrl+F" icon="add-folder"></ui5-menu-item> | ||
<ui5-menu-item text="Open" icon="open-folder" accessible-name="Choose platform" starts-section> | ||
<ui5-menu-item text="Open Locally" icon="open-folder" additional-text="Ctrl+K"></ui5-menu-item> | ||
<ui5-menu-item text="Open from SAP Cloud" additional-text="Ctrl+L"></ui5-menu-item> | ||
</ui5-menu-item> | ||
<ui5-menu-item text="Save with very long title for a menu item text inside" icon="save"> | ||
<ui5-menu-item text="Save Locally" icon="save"></ui5-menu-item> | ||
<ui5-menu-item text="Save on Cloud" icon="upload-to-cloud"></ui5-menu-item> | ||
</ui5-menu-item> | ||
<ui5-menu-item text="Close" additional-text="Ctrl+W"></ui5-menu-item> | ||
<ui5-menu-item text="Preferences" icon="action-settings" starts-section></ui5-menu-item> | ||
<ui5-menu-item text="Exit" icon="journey-arrive"></ui5-menu-item> | ||
</ui5-menu> | ||
|
||
<!-- playground-fold --> | ||
<script type="module" src="main.js"></script> | ||
</body> | ||
|
||
</html> | ||
<!-- playground-fold-end --> |
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.
From the list item's side, the changes look fine to me.