import * as i0 from '@angular/core';
import { AfterViewInit, QueryList, EventEmitter } from '@angular/core';
import { FocusableOption, FocusOrigin } from '@angular/cdk/a11y';
import { Router } from '@angular/router';
import * as i1 from '@angular/cdk/menu';
/**
* Type of the callback function that is called when the MenuLink is selected.
*
* ### Import
*
* ```typescript
* import { TSelectCallback } from '@talenra/ngx-base/menu';
* ```
*
* @see {@link MenuComponent}
*/
type TSelectCallback = (menuLink: MenuLinkComponent) => void;
/**
* MenuLink is a container for links in a Menu. It requires a label and can optionally have an icon on the left.
*
* MenuLink can have a router link and/or a callback. The callback will be called before the router link is navigated
* to. If there is no select callback and no router link the MenuLink will be displayed as disabled.
*
* MenuLink can have an action icon which will be displayed on the right-hand side. The action icon can be displayed as
* disabled.
*
* ```html
*
*
* ```
*
* ### Import
*
* ```typescript
* import { MenuLinkComponent } from '@talenra/ngx-base/menu';
* ```
*
* @see {@link MenuComponent}
*
* ../../#/menu
*/
declare class MenuLinkComponent implements FocusableOption {
/**
* The label of the MenuLink.
* @required
*/
label: i0.InputSignal;
/**
* The icon of the MenuLink.
* @optional
*/
icon: i0.InputSignal;
/**
* The router link of the MenuLink.
* @optional
*/
routerLink: i0.InputSignal;
/**
* The shortcut of the MenuLink.
* @optional
*
* If a shortcut is provided the actionIcon will be ignored
*/
shortcut: i0.InputSignal;
/**
* The action icon of the MenuLink.
* @optional
*
* If a shortcut is provided the actionIcon will be ignored
*/
actionIcon: i0.InputSignal;
/**
* The callback function that is called when the MenuLink is selected.
* @optional
*/
selectCallback?: TSelectCallback;
/**
* Whether the action icon is disabled.
* @optional
*/
actionIconDisabled: boolean;
/**
* Whether the MenuLink is disabled.
* @optional
*/
disabled?: boolean;
/** @internal */
router: Router;
private get pointerDisabled();
/** @internal */
focus(_origin?: FocusOrigin | undefined): void;
/** @internal */
getLabel?(): string;
private onSelect;
private onSelectByEnter;
private onClickOrSelect;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
static ngAcceptInputType_actionIconDisabled: unknown;
static ngAcceptInputType_disabled: unknown;
}
/**
* Menu is a container for a list of menu items.
*
* There are three different menu items
* - MenuLink: A clickable menu item that navigates to a different page and/or triggers a given callback
* - MenuActionItem: A non-clickable menu item that can be used as container for action items
* - MenuSeparator: A horizontal line that separates menu items
*
* ```html
*
* Home
* About
* Contact
*
*
*
*
*
*
*
*
* ### Import
*
* ```typescript
* import { MenuComponent } from '@talenra/ngx-base/menu';
* ```
*
* @see {@link MenuLinkComponent}
* @see {@link MenuActionItemComponent}
* @see {@link MenuSeparatorComponent}
* @see {@link MenuAnchorDirective}
*
* ../../#/menu
*/
declare class MenuComponent implements AfterViewInit {
/** @internal */
menuItems: QueryList;
private keyManager;
/**
* Attaches the key manager to the menu items
*
* @internal
*/
ngAfterViewInit(): void;
/**
* Handles keyboard events for menu navigation
*
* @internal
*/
onKeydown(event: KeyboardEvent): void;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
}
/**
* MenuActionItem is a container for action items in a menu.
*
* ```html
*
*
*
*
*
* ```
*
* ### Import
*
* ```typescript
* import { MenuActionItemComponent } from '@talenra/ngx-base/menu';
* ```
*
* @see {@link MenuComponent}
*
* ../../../#/menu
*/
declare class MenuActionItemComponent {
/**
* The label of the action item.
*
* @required
*/
label: i0.InputSignal;
/**
* The icon of the action item.
*
* @optional
*/
icon: i0.InputSignal;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
}
/**
* Assigned to an element, MenuAnchor triggers the associated Menu. MenuAnchor provides `triggerFor` input property. It
* will trigger the template with a matching id.
*
* ```html
* My Menu
*
*
*
* ```
*
* ### Import
*
* ```typescript
* import { MenuAnchorDirective } from '@talenra/ngx-base/menu';
* ```
*
* @see {@link MenuComponent}
*
* ../../../#/menu
*/
declare class MenuAnchorDirective implements FocusableOption, AfterViewInit {
/**
* Emits when the associated menu is opened.
*
* @internal
*/
menuOpen: EventEmitter;
/**
* Emits when the associated menu is closed.
*
* @internal
*/
menuClose: EventEmitter;
private elementRef;
private cdkMenuTrigger;
private destroyRef;
/**
* Implements the FocusableOption interface.
*
* @internal
*/
disabled?: boolean | undefined;
private handleScroll;
/** @internal */
ngAfterViewInit(): void;
/**
* Implements the FocusableOption interface.
*
* @internal
*/
focus(): void;
/** @internal */
getLabel(): string;
/**
* Opens the associated menu.
*
* This method triggers the `cdkMenuTrigger` to open the menu associated with this anchor.
* It can be used to programmatically open the menu.
*
* @internal
*/
open(): void;
/**
* Closes the associated menu.
*
* This method triggers the `cdkMenuTrigger` to close the menu associated with this anchor.
* It can be used to programmatically close the menu.
*
* @internal
*/
close(): void;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵdir: i0.ɵɵDirectiveDeclaration;
}
/**
* MenuSeparator is used to organize Menu content.
*
* ```html
*
* Home
*
* About
*
* ```
*
* ### Import
*
* ```typescript
* import { MenuSeparatorComponent } from '@talenra/ngx-base/menu';
* ```
*
* @see {@link MenuComponent}
*
* ../../#/menu
*/
declare class MenuSeparatorComponent {
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
}
/**
* MenuBar is a container for a group of related Menus.
*
* It handles closing other menus when a menu is opened and thus helps preventing a stack of open menus.
*
* ```html
*
* My Menu
* Your Menu
*
* ```
*
* ### Import
*
* ```typescript
* import { MenuBarComponent } from '@talenra/ngx-base/menu';
* ```
*
* @see {@link MenuComponent}
* @see {@link MenuAnchorDirective}
*
* ../../#/menu
*/
declare class MenuBarComponent implements AfterViewInit {
private destroyRef;
private openedMenuItem;
private lastOpenedIndex;
private numberOfMenuItems;
private keyManager;
private firstKeyboardInteraction;
/** @internal */
menuItems: QueryList;
/** @internal */
ngAfterViewInit(): void;
/** @internal */
onKeydown(event: KeyboardEvent): void;
private getMenuAnchorIndex;
private openMenuItemAtIndex;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
}
/**
* MenuTitle is used to organize menu content.
*
* It requires a label to display the title.
*
* ```html
*
* ```
*
* ### Import
*
* ```typescript
* import { MenuTitleComponent } from '@talenra/ngx-base/menu';
* ```
*
* ../../#/menu
*/
declare class MenuTitleComponent {
/**
* The label to display for the title.
*/
label: i0.InputSignal;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
}
export { MenuActionItemComponent, MenuAnchorDirective, MenuBarComponent, MenuComponent, MenuLinkComponent, MenuSeparatorComponent, MenuTitleComponent };
export type { TSelectCallback };