Menu
Menu is a small floating panel used to display a list of actions or navigational items.
DaffMenuService
import { DaffMenuService } from '@daffodil/design/menu'
@Injectable()
class DaffMenuService {
protected _overlay: OverlayRef | null
open$: Observable<boolean>
protected overlay: Overlay
protected _createOverlay(
activatorElement: ViewContainerRef
component: DaffMenuSlot
)
protected _destroyOverlay()
close()
open(
activator: ViewContainerRef
component: DaffMenuSlot
)
}
Properties
Name | Type | Description |
---|---|---|
_overlay | OverlayRef | null | |
open$ | Observable<boolean> | |
overlay | Overlay | |
_createOverlay | ||
_destroyOverlay | ||
close | ||
open |
DaffMenuActivatorDirective
import { DaffMenuActivatorDirective } from '@daffodil/design/menu'
@Directive()
class DaffMenuActivatorDirective implements OnDestroy {
@HostBinding()
get openClass()
@Input() daffMenuActivator: Type<unknown> | TemplateRef<unknown>
ngOnDestroy(): void
focus()
@HostListener() openMenu(event)
}
Selector:
'[daffMenuActivator]'
Properties
Name | Type | Description |
---|---|---|
openClass | ||
@Input() daffMenuActivator | Type<unknown> | TemplateRef<unknown> | |
ngOnDestroy | void | |
focus | ||
openMenu |
DaffMenuModule
import { DaffMenuModule } from '@daffodil/design/menu'
@NgModule()
class DaffMenuModule {}
DaffMenuComponent
import { DaffMenuComponent } from '@daffodil/design/menu'
@Component()
class DaffMenuComponent implements AfterContentInit, AfterViewInit {
@HostBinding() class: true
@HostBinding() tabindex: 0
@HostBinding() role: 'menu'
ngAfterContentInit()
ngAfterViewInit()
}
Selector:
'daff-menu'
Properties
Name | Type | Description |
---|---|---|
class | true | |
tabindex | 0 | |
role | 'menu' | |
ngAfterContentInit | ||
ngAfterViewInit |
DaffMenuItemComponent
import { DaffMenuItemComponent } from '@daffodil/design/menu'
@Component()
class DaffMenuItemComponent {}
Selector:
'a[daff-menu-item]' + ',' +
'button[daff-menu-item]'
daffMenuCreateOverlay
import { daffMenuCreateOverlay } from '@daffodil/design/menu'
function daffMenuCreateOverlay(
overlay: Overlay
element: ElementRef<any>
config: OverlayConfig = {}
)