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
130 lines (127 loc) • 3.69 kB
TypeScript
import { TemplateRef } from '@angular/core';
import { MotionOptions } from '@primeuix/motion';
import { PassThroughOption, PassThrough } from 'primeng/api';
import { ButtonPassThrough } from 'primeng/types/button';
/**
* Custom pass-through(pt) options.
* @template I Type of instance.
*
* @see {@link Panel.pt}
* @group Interface
*/
interface PanelPassThroughOptions<I = unknown> {
/**
* Used to pass attributes to the host's DOM element.
*/
host?: PassThroughOption<HTMLElement, I>;
/**
* Used to pass attributes to the root's DOM element.
*/
root?: PassThroughOption<HTMLElement, I>;
/**
* Used to pass attributes to the header's DOM element.
*/
header?: PassThroughOption<HTMLDivElement, I>;
/**
* Used to pass attributes to the title's DOM element.
*/
title?: PassThroughOption<HTMLSpanElement, I>;
/**
* Used to pass attributes to the header actions' DOM element.
*/
headerActions?: PassThroughOption<HTMLDivElement, I>;
/**
* Used to pass attributes to the toggle button button's DOM element.
* @see {@link ButtonPassThroughOptions}
*/
pcToggleButton?: ButtonPassThrough;
/**
* Used to pass attributes to the content container's DOM element.
*/
contentContainer?: PassThroughOption<HTMLDivElement, I>;
/**
* Used to pass attributes to the content wrapper DOM element.
*/
contentWrapper?: PassThroughOption<HTMLDivElement, I>;
/**
* Used to pass attributes to the content's DOM element.
*/
content?: PassThroughOption<HTMLDivElement, I>;
/**
* Used to pass attributes to the footer's DOM element.
*/
footer?: PassThroughOption<HTMLDivElement, I>;
/**
* Used to pass options to the motion component/directive.
*/
motion?: MotionOptions;
}
/**
* Defines valid pass-through options in Panel component.
* @see {@link PanelPassThroughOptions}
*
* @template I Type of instance.
*/
type PanelPassThrough<I = unknown> = PassThrough<I, PanelPassThroughOptions<I>>;
/**
* Custom panel toggle event, emits before panel toggle.
* @see {@link onBeforeToggle}
* @group Interface
*/
interface PanelBeforeToggleEvent {
/**
* Browser event.
*/
originalEvent: Event;
/**
* Collapsed state of the panel.
*/
collapsed: boolean | undefined;
}
/**
* Custom panel toggle event, emits after panel toggle.
* @see {@link onAfterToggle}
* @extends {PanelBeforeToggleEvent}
* @group Interface
*/
interface PanelAfterToggleEvent extends PanelBeforeToggleEvent {
}
/**
* Toggle icon template context.
* @param {boolean} $implicit - Collapsed state as a boolean, implicit value.
* @group Interface
*/
interface PanelHeaderIconsTemplateContext {
/**
* Collapsed state as a boolean, implicit value.
*/
$implicit: boolean;
}
/**
* Defines valid templates in Panel.
* @group Templates
*/
interface PanelTemplates {
/**
* Custom header template.
*/
header(): TemplateRef<void>;
/**
* Custom icons template.
*/
icons(): TemplateRef<void>;
/**
* Custom content template.
*/
content(): TemplateRef<void>;
/**
* Custom footer template.
*/
footer(): TemplateRef<void>;
/**
* Custom header icons template.
* @param {PanelHeaderIconsTemplateContext} context - header icons context.
*/
headericons(context: PanelHeaderIconsTemplateContext): TemplateRef<PanelHeaderIconsTemplateContext>;
}
export type { PanelAfterToggleEvent, PanelBeforeToggleEvent, PanelHeaderIconsTemplateContext, PanelPassThrough, PanelPassThroughOptions, PanelTemplates };