mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 01:03:35 +00:00
Move to libs
This commit is contained in:
30
libs/components/src/menu/menu.component.ts
Normal file
30
libs/components/src/menu/menu.component.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { FocusKeyManager } from "@angular/cdk/a11y";
|
||||
import {
|
||||
Component,
|
||||
Output,
|
||||
TemplateRef,
|
||||
ViewChild,
|
||||
EventEmitter,
|
||||
ContentChildren,
|
||||
QueryList,
|
||||
AfterContentInit,
|
||||
} from "@angular/core";
|
||||
|
||||
import { MenuItemDirective } from "./menu-item.directive";
|
||||
|
||||
@Component({
|
||||
selector: "bit-menu",
|
||||
templateUrl: "./menu.component.html",
|
||||
exportAs: "menuComponent",
|
||||
})
|
||||
export class MenuComponent implements AfterContentInit {
|
||||
@ViewChild(TemplateRef) templateRef: TemplateRef<any>;
|
||||
@Output() closed = new EventEmitter<void>();
|
||||
@ContentChildren(MenuItemDirective, { descendants: true })
|
||||
menuItems: QueryList<MenuItemDirective>;
|
||||
keyManager: FocusKeyManager<MenuItemDirective>;
|
||||
|
||||
ngAfterContentInit() {
|
||||
this.keyManager = new FocusKeyManager(this.menuItems).withWrap();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user