primeng
Version:
PrimeNG is an open source UI library for Angular featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeB
103 lines (100 loc) • 3.06 kB
TypeScript
import { TemplateRef } from '@angular/core';
import { MotionOptions } from '@primeuix/motion';
import { PassThroughOption, PassThrough, MenuItem } from 'primeng/api';
/**
* Custom pass-through(pt) options.
* @template I Type of instance.
*
* @see {@link ContextMenu.pt}
* @group Interface
*/
interface ContextMenuPassThroughOptions<I = unknown> {
/**
* Used to pass attributes to the root's DOM element.
*/
root?: PassThroughOption<HTMLDivElement, I>;
/**
* Used to pass attributes to the root list's DOM element.
*/
rootList?: PassThroughOption<HTMLUListElement, I>;
/**
* Used to pass attributes to the submenu's DOM element.
*/
submenu?: PassThroughOption<HTMLUListElement, I>;
/**
* Used to pass attributes to the separator's DOM element.
*/
separator?: PassThroughOption<HTMLLIElement, I>;
/**
* Used to pass attributes to the item's DOM element.
*/
item?: PassThroughOption<HTMLLIElement, I>;
/**
* Used to pass attributes to the item content's DOM element.
*/
itemContent?: PassThroughOption<HTMLDivElement, I>;
/**
* Used to pass attributes to the item link's DOM element.
*/
itemLink?: PassThroughOption<HTMLAnchorElement, I>;
/**
* Used to pass attributes to the item icon's DOM element.
*/
itemIcon?: PassThroughOption<HTMLSpanElement, I>;
/**
* Used to pass attributes to the item label's DOM element.
*/
itemLabel?: PassThroughOption<HTMLSpanElement, I>;
/**
* Used to pass attributes to the submenu icon's DOM element.
*/
submenuIcon?: PassThroughOption<SVGElement, I>;
/**
* Used to pass options to the motion component/directive.
*/
motion?: MotionOptions;
}
/**
* Defines valid pass-through options in ContextMenu.
* @see {@link ContextMenuPassThroughOptions}
*
* @template I Type of instance.
*/
type ContextMenuPassThrough<I = unknown> = PassThrough<I, ContextMenuPassThroughOptions<I>>;
/**
* Custom item template context.
* @group Interface
*/
interface ContextMenuItemTemplateContext {
/**
* Menu item instance.
*/
$implicit: MenuItem;
}
/**
* Custom submenu icon template context.
* @group Interface
*/
interface ContextMenuSubmenuIconTemplateContext {
/**
* Style class of the submenu icon.
*/
class: string;
}
/**
* Defines valid templates in ContextMenu.
* @group Templates
*/
interface ContextMenuTemplates {
/**
* Custom item template.
* @param {Object} context - item context.
*/
item(context: ContextMenuItemTemplateContext): TemplateRef<ContextMenuItemTemplateContext>;
/**
* Custom submenu icon template.
* @param {Object} context - icon context.
*/
submenuicon(context: ContextMenuSubmenuIconTemplateContext): TemplateRef<ContextMenuSubmenuIconTemplateContext>;
}
export type { ContextMenuItemTemplateContext, ContextMenuPassThrough, ContextMenuPassThroughOptions, ContextMenuSubmenuIconTemplateContext, ContextMenuTemplates };