-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(context-menu): add possibility to open via right click (#475)
- Loading branch information
Fabian Maschewski
authored and
GitHub Enterprise
committed
Jan 27, 2022
1 parent
709fa7c
commit c87c0b6
Showing
8 changed files
with
216 additions
and
39 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
...ation/examples/context-menu/context-menu-cursor-mode/context-menu-cursor-mode-example.css
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,10 @@ | ||
nx-card { | ||
display: block; | ||
} | ||
.card-content { | ||
width: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
gap: 16px; | ||
} |
19 changes: 19 additions & 0 deletions
19
...tion/examples/context-menu/context-menu-cursor-mode/context-menu-cursor-mode-example.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,19 @@ | ||
<nx-context-menu #menu="nxContextMenu"> | ||
<button nxContextMenuItem type="button">Settings</button> | ||
<button nxContextMenuItem type="button">Download</button> | ||
<button nxContextMenuItem type="button">Help</button> | ||
</nx-context-menu> | ||
|
||
<nx-card [nxContextMenuTriggerFor]="menu" nxContextMenuTriggerMode="cursor"> | ||
<div class="card-content"> | ||
<p nxCopytext>Right click card to open context menu.</p> | ||
<button | ||
nxIconButton="tertiary small" | ||
[nxContextMenuTriggerFor]="menu" | ||
aria-label="Open menu" | ||
type="button" | ||
> | ||
<nx-icon aria-hidden="true" name="ellipsis-h"></nx-icon> | ||
</button> | ||
</div> | ||
</nx-card> |
11 changes: 11 additions & 0 deletions
11
...tation/examples/context-menu/context-menu-cursor-mode/context-menu-cursor-mode-example.ts
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,11 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
/** | ||
* @title Cursor Mode Context Menu Example | ||
*/ | ||
@Component({ | ||
selector: 'context-menu-cursor-mode-example', | ||
templateUrl: './context-menu-cursor-mode-example.html', | ||
styleUrls: ['./context-menu-cursor-mode-example.css'], | ||
}) | ||
export class ContextMenuCursorModeExampleComponent {} |
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
Oops, something went wrong.