UNPKG

primeng

Version:

PrimeNG is a premium UI library for Angular featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock,

111 lines (108 loc) 3.21 kB
import { TemplateRef } from '@angular/core'; import { MenuItem, PassThrough, PassThroughOption } from 'primeng/api'; import { ButtonPassThrough } from 'primeng/types/button'; /** * Defines the direction of the SpeedDial. * @group Types */ type SpeedDialDirection = 'up' | 'down' | 'left' | 'right' | 'up-left' | 'up-right' | 'down-left' | 'down-right'; /** * Defines the type of the SpeedDial. * @group Types */ type SpeedDialType = 'linear' | 'circle' | 'semi-circle' | 'quarter-circle'; /** * Custom pass-through(pt) options. * @template I Type of instance. * * @see {@link SpeedDial.pt} * @group Interface */ interface SpeedDialPassThroughOptions<I = unknown> { /** * Used to pass attributes to the root's DOM element. */ root?: PassThroughOption<HTMLDivElement, I>; /** * Used to pass attributes to the Button component. * @see {@link ButtonPassThrough} */ pcButton?: ButtonPassThrough; /** * Used to pass attributes to the list's DOM element. */ list?: PassThroughOption<HTMLUListElement, I>; /** * Used to pass attributes to the item's DOM element. */ item?: PassThroughOption<HTMLLIElement, I>; /** * Used to pass attributes to the action's Button component. * @see {@link ButtonPassThrough} */ pcAction?: ButtonPassThrough; /** * Used to pass attributes to the action icon's DOM element. */ actionIcon?: PassThroughOption<HTMLSpanElement, I>; /** * Used to pass attributes to the mask's DOM element. */ mask?: PassThroughOption<HTMLDivElement, I>; } /** * Defines valid pass-through options in SpeedDial component. * @see {@link SpeedDialPassThroughOptions} * * @template I Type of instance. */ type SpeedDialPassThrough<I = unknown> = PassThrough<I, SpeedDialPassThroughOptions<I>>; /** * Custom button template context. * @group Interface */ interface SpeedDialButtonTemplateContext { /** * Callback to toggle the speed dial visibility. */ toggleCallback: (event: MouseEvent) => void; } /** * Custom item template context. * @group Interface */ interface SpeedDialItemTemplateContext { /** * Menu item instance. */ $implicit: MenuItem; /** * Index of the item. */ index: number; /** * Callback to handle item click. */ toggleCallback: (event: Event, item: MenuItem) => void; } /** * Defines valid templates in SpeedDial. * @group Templates */ interface SpeedDialTemplates { /** * Custom button template. * @param {SpeedDialButtonTemplateContext} context - button context. */ button(context: SpeedDialButtonTemplateContext): TemplateRef<SpeedDialButtonTemplateContext>; /** * Custom icon template. */ icon(): TemplateRef<void>; /** * Custom item template. * @param {SpeedDialItemTemplateContext} context - item context. */ item(context: SpeedDialItemTemplateContext): TemplateRef<SpeedDialItemTemplateContext>; } export type { SpeedDialButtonTemplateContext, SpeedDialDirection, SpeedDialItemTemplateContext, SpeedDialPassThrough, SpeedDialPassThroughOptions, SpeedDialTemplates, SpeedDialType };