-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui5-menu): Initial implementation (#4742)
This is the initial implementation of and web components that allow creating of a hierarchical menu structure.
- Loading branch information
1 parent
d6a56cb
commit deac309
Showing
16 changed files
with
1,220 additions
and
4 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
command_exists () { | ||
command -v "$1" >/dev/null 2>&1 | ||
} | ||
|
||
# Windows 10, Git Bash and Yarn workaround | ||
if command_exists winpty && test -t 1; then | ||
exec < /dev/tty | ||
fi |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
. "$(dirname "$0")/common.sh" | ||
|
||
yarn husky:pre-push |
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,100 @@ | ||
<ui5-responsive-popover | ||
id="{{_id}}-menu-rp" | ||
class="ui5-menu-rp" | ||
dir={{effectiveDir}} | ||
horizontal-align="Left" | ||
placement-type={{placementType}} | ||
vertical-align={{verticalAlign}} | ||
hide-arrow | ||
allow-target-overlap | ||
?sub-menu={{_isSubMenu}} | ||
@before-close={{_beforePopoverClose}} | ||
> | ||
{{#if isPhone}} | ||
<div | ||
slot="header" | ||
class="ui5-menu-dialog-header" | ||
> | ||
{{#if isSubMenuOpened}} | ||
<ui5-button | ||
icon="nav-back" | ||
class="ui5-menu-back-button" | ||
design="Transparent" | ||
aria-label="{{labelBack}}" | ||
@click={{_navigateBack}} | ||
> | ||
</ui5-button> | ||
{{/if}} | ||
<div | ||
class="ui5-menu-dialog-title" | ||
> | ||
<div> | ||
{{menuHeaderTextPhone}} | ||
</div> | ||
</div> | ||
<ui5-button | ||
icon="decline" | ||
design="Transparent" | ||
aria-label="{{labelClose}}" | ||
@click={{close}} | ||
> | ||
</ui5-button> | ||
</div> | ||
{{/if}} | ||
<div | ||
id="{{_id}}-menu-main" | ||
> | ||
{{#if _currentItems.length}} | ||
<ui5-list | ||
id="{{_id}}-menu-list" | ||
mode="None" | ||
separators="None" | ||
accessible-role="menu" | ||
@ui5-item-click={{_itemClick}} | ||
> | ||
{{#each _currentItems}} | ||
<ui5-li | ||
.associatedItem="{{this.item}}" | ||
class="ui5-menu-item" | ||
id="{{../_id}}-menu-item-{{@index}}" | ||
icon="{{this.item.icon}}" | ||
accessible-role="menuitem" | ||
._ariaHasPopup={{this.ariaHasPopup}} | ||
?disabled={{this.item.disabled}} | ||
?starts-section={{this.item.startsSection}} | ||
?selected={{this.item.subMenuOpened}} | ||
@mouseover={{../_itemMouseOver}} | ||
@mouseout={{../_itemMouseOut}} | ||
@keydown={{../_itemKeyDown}} | ||
> | ||
{{#if this.item.hasDummyIcon}} | ||
<div | ||
class="ui5-menu-item-dummy-icon" | ||
> | ||
</div> | ||
{{/if}} | ||
{{this.item.text}} | ||
{{#if this.item.hasChildren}} | ||
<ui5-icon | ||
part="icon" | ||
name="slim-arrow-right" | ||
class="ui5-menu-item-icon-end" | ||
> | ||
</ui5-icon> | ||
{{else if this.item._siblingsWithChildren}} | ||
<div | ||
class="ui5-menu-item-no-icon-end" | ||
> | ||
</div> | ||
{{/if}} | ||
</ui5-li> | ||
{{/each}} | ||
</ui5-list> | ||
{{/if}} | ||
</div> | ||
</ui5-responsive-popover> | ||
|
||
<div | ||
class="ui5-menu-submenus" | ||
> | ||
</div> |
Oops, something went wrong.