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
369 lines (368 loc) • 14.2 kB
TypeScript
import { AfterContentInit, EventEmitter, InputSignalWithTransform, OnDestroy, QueryList, TemplateRef } from '@angular/core';
import { BlockableUI, Header, PrimeTemplate } from 'primeng/api';
import { BaseComponent } from 'primeng/basecomponent';
import { Subscription } from 'rxjs';
import { AccordionStyle } from './style/accordionstyle';
import * as i0 from "@angular/core";
import * as i1 from "primeng/ripple";
import * as i2 from "primeng/api";
/**
* Custom tab open event.
* @see {@link onOpen}
* @group Interface
*/
export interface AccordionTabOpenEvent {
/**
* Browser event.
*/
originalEvent: Event;
/**
* Opened tab index.
*/
index: number;
}
/**
* Custom tab close event.
* @see {@link onClose}
* @extends {AccordionTabOpenEvent}
* @group Interface
*/
export interface AccordionTabCloseEvent extends AccordionTabOpenEvent {
}
/**
* Toggle icon template context.
* @group Interface
*/
export interface AccordionToggleIconTemplateContext {
/**
* Represents the active status of the panel.
*/
active: boolean;
}
/**
* AccordionPanel is a helper component for Accordion component.
* @group Components
*/
export declare class AccordionPanel extends BaseComponent {
pcAccordion: any;
/**
* Value of the active tab.
* @defaultValue undefined
* @group Props
*/
value: import("@angular/core").ModelSignal<string | number | string[] | number[]>;
/**
* Disables the tab when enabled.
* @defaultValue false
* @group Props
*/
disabled: InputSignalWithTransform<any, boolean>;
active: import("@angular/core").Signal<boolean>;
valueEquals(currentValue: any, value: any): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<AccordionPanel, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AccordionPanel, "p-accordion-panel, p-accordionpanel", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, ["*"], true, never>;
}
/**
* AccordionHeader is a helper component for Accordion component.
* @group Components
*/
export declare class AccordionHeader extends BaseComponent {
pcAccordion: any;
pcAccordionPanel: any;
id: import("@angular/core").Signal<string>;
active: import("@angular/core").Signal<any>;
disabled: import("@angular/core").Signal<any>;
ariaControls: import("@angular/core").Signal<string>;
/**
* Toggle icon template.
* @type {TemplateRef<AccordionToggleIconTemplateContext>} context - Context of the template
* @example
* ```html
* <ng-template #toggleicon let-active="active"> </ng-template>
* ```
* @see {@link AccordionToggleIconTemplateContext}
* @group Templates
*/
toggleicon: TemplateRef<AccordionToggleIconTemplateContext> | undefined;
onClick(event?: MouseEvent | KeyboardEvent): void;
onFocus(): void;
onKeydown(event: KeyboardEvent): void;
changeActiveValue(): void;
private findPanel;
private findHeader;
private findNextPanel;
private findPrevPanel;
private findFirstPanel;
private findLastPanel;
private changeFocusedPanel;
private arrowDownKey;
private arrowUpKey;
private onHomeKey;
private onEndKey;
private onEnterKey;
static ɵfac: i0.ɵɵFactoryDeclaration<AccordionHeader, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AccordionHeader, "p-accordion-header, p-accordionheader", never, {}, {}, ["toggleicon"], ["*"], true, [{ directive: typeof i1.Ripple; inputs: {}; outputs: {}; }]>;
}
export declare class AccordionContent extends BaseComponent {
pcAccordion: any;
pcAccordionPanel: any;
active: import("@angular/core").Signal<any>;
ariaLabelledby: import("@angular/core").Signal<string>;
id: import("@angular/core").Signal<string>;
static ɵfac: i0.ɵɵFactoryDeclaration<AccordionContent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AccordionContent, "p-accordion-content, p-accordioncontent", never, {}, {}, never, ["*"], true, never>;
}
/**
* AccordionTab is a helper component for Accordion.
* @deprecated Use AccordionPanel, AccordionHeader, AccordionContent instead.
* @group Components
*/
export declare class AccordionTab extends BaseComponent implements AfterContentInit, OnDestroy {
get hostClass(): string;
get hostStyle(): {
[klass: string]: any;
};
/**
* Current id state as a string.
* @group Props
*/
id: string | undefined;
/**
* Used to define the header of the tab.
* @group Props
*/
header: string | undefined;
/**
* Inline style of the tab header.
* @group Props
*/
headerStyle: {
[klass: string]: any;
} | null | undefined;
/**
* Inline style of the tab.
* @group Props
*/
tabStyle: {
[klass: string]: any;
} | null | undefined;
/**
* Inline style of the tab content.
* @group Props
*/
contentStyle: {
[klass: string]: any;
} | null | undefined;
/**
* Style class of the tab.
* @group Props
*/
tabStyleClass: string | undefined;
/**
* Style class of the tab header.
* @group Props
*/
headerStyleClass: string | undefined;
/**
* Style class of the tab content.
* @group Props
*/
contentStyleClass: string | undefined;
/**
* Whether the tab is disabled.
* @group Props
*/
disabled: boolean | undefined;
/**
* Whether a lazy loaded panel should avoid getting loaded again on reselection.
* @group Props
*/
cache: boolean;
/**
* Transition options of the animation.
* @group Props
*/
transitionOptions: string;
/**
* Position of the icon.
* @group Props
*/
iconPos: 'end' | 'start';
/**
* The value that returns the selection.
* @group Props
*/
get selected(): boolean;
set selected(val: boolean);
/**
* The aria-level that each accordion header will have. The default value is 2 as per W3C specifications
* @group Props
*/
headerAriaLevel: number;
/**
* Event triggered by changing the choice.
* @param {boolean} value - Boolean value indicates that the option is changed.
* @group Emits
*/
selectedChange: EventEmitter<boolean>;
headerFacet: QueryList<Header>;
private _selected;
get iconClass(): "p-accordionheader-toggle-icon icon-end" | "p-accordionheader-toggle-icon icon-start";
/**
* Content template for the content of the drawer.
* @group Templates
*/
headerTemplate: TemplateRef<any> | undefined;
/**
* Template for the header icon.
* @group Templates
*/
iconTemplate: TemplateRef<any> | undefined;
/**
* Content template for the footer of the drawer.
* @group Templates
*/
contentTemplate: TemplateRef<any> | undefined;
templates: QueryList<PrimeTemplate> | undefined;
_headerTemplate: TemplateRef<any>;
_iconTemplate: TemplateRef<any>;
_contentTemplate: TemplateRef<any>;
loaded: boolean;
accordion: Accordion;
_componentStyle: AccordionStyle;
ngOnInit(): void;
ngAfterContentInit(): void;
toggle(event?: MouseEvent | KeyboardEvent): boolean;
findTabIndex(): number;
onKeydown(event: KeyboardEvent): void;
getTabHeaderActionId(tabId: any): string;
getTabContentId(tabId: any): string;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<AccordionTab, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AccordionTab, "p-accordionTab, p-accordion-tab, p-accordiontab", never, { "id": { "alias": "id"; "required": false; }; "header": { "alias": "header"; "required": false; }; "headerStyle": { "alias": "headerStyle"; "required": false; }; "tabStyle": { "alias": "tabStyle"; "required": false; }; "contentStyle": { "alias": "contentStyle"; "required": false; }; "tabStyleClass": { "alias": "tabStyleClass"; "required": false; }; "headerStyleClass": { "alias": "headerStyleClass"; "required": false; }; "contentStyleClass": { "alias": "contentStyleClass"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "cache": { "alias": "cache"; "required": false; }; "transitionOptions": { "alias": "transitionOptions"; "required": false; }; "iconPos": { "alias": "iconPos"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "headerAriaLevel": { "alias": "headerAriaLevel"; "required": false; }; }, { "selectedChange": "selectedChange"; }, ["headerTemplate", "iconTemplate", "contentTemplate", "headerFacet", "templates"], ["p-header", "*"], true, never>;
static ngAcceptInputType_disabled: unknown;
static ngAcceptInputType_cache: unknown;
static ngAcceptInputType_headerAriaLevel: unknown;
}
/**
* Accordion groups a collection of contents in tabs.
* @group Components
*/
export declare class Accordion extends BaseComponent implements BlockableUI, AfterContentInit, OnDestroy {
get hostClass(): string;
get hostStyle(): {
[klass: string]: any;
};
/**
* Value of the active tab.
* @defaultValue undefined
* @group Props
*/
value: import("@angular/core").ModelSignal<string | number | string[] | number[]>;
/**
* When enabled, multiple tabs can be activated at the same time.
* @defaultValue false
* @group Props
*/
multiple: InputSignalWithTransform<boolean, any>;
/**
* Inline style of the tab header and content.
* @group Props
*/
style: {
[klass: string]: any;
} | null | undefined;
/**
* Class of the element.
* @group Props
*/
styleClass: string | undefined;
/**
* Icon of a collapsed tab.
* @group Props
*/
expandIcon: string | undefined;
/**
* Icon of an expanded tab.
* @group Props
*/
collapseIcon: string | undefined;
/**
* When enabled, the focused tab is activated.
* @defaultValue false
* @group Props
*/
selectOnFocus: InputSignalWithTransform<boolean, any>;
set activeIndex(val: number | number[] | null | undefined);
/**
* Transition options of the animation.
* @group Props
*/
transitionOptions: string;
/**
* Returns the active index.
* @param {number | number[]} value - New index.
* @deprecated use native valueChange emitter of the value model.
* @group Emits
*/
activeIndexChange: EventEmitter<number | number[]>;
set headerAriaLevel(val: number);
/**
* Callback to invoke when an active tab is collapsed by clicking on the header.
* @param {AccordionTabCloseEvent} event - Custom tab close event.
* @group Emits
*/
onClose: EventEmitter<AccordionTabCloseEvent>;
/**
* Callback to invoke when a tab gets expanded.
* @param {AccordionTabOpenEvent} event - Custom tab open event.
* @group Emits
*/
onOpen: EventEmitter<AccordionTabOpenEvent>;
id: import("@angular/core").WritableSignal<string>;
tabList: QueryList<AccordionTab> | undefined;
tabListSubscription: Subscription | null;
private _activeIndex;
private _headerAriaLevel;
preventActiveIndexPropagation: boolean;
tabs: AccordionTab[];
_componentStyle: AccordionStyle;
/**
* Index of the active tab or an array of indexes in multiple mode.
* @deprecated use value property with new architecture instead.
* @group Props
*/
get activeIndex(): number | number[] | null | undefined;
/**
* The aria-level that each accordion header will have. The default value is 2 as per W3C specifications
* @deprecated use AccoridonHeader component and bind attribute to the host.
* @group Props
*/
get headerAriaLevel(): number;
onKeydown(event: any): void;
onTabArrowDownKey(event: any): void;
onTabArrowUpKey(event: any): void;
onTabHomeKey(event: any): void;
changeFocusedTab(element: any): void;
findNextHeaderAction(tabElement: any, selfCheck?: boolean): any;
findPrevHeaderAction(tabElement: any, selfCheck?: boolean): any;
findFirstHeaderAction(): any;
findLastHeaderAction(): any;
onTabEndKey(event: any): void;
ngAfterContentInit(): void;
initTabs(): void;
getBlockableElement(): HTMLElement;
updateSelectionState(): void;
isTabActive(index: any): boolean;
getTabProp(tab: any, name: any): any;
updateActiveIndex(): void;
updateValue(value: string | number): void;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<Accordion, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<Accordion, "p-accordion", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; "expandIcon": { "alias": "expandIcon"; "required": false; }; "collapseIcon": { "alias": "collapseIcon"; "required": false; }; "selectOnFocus": { "alias": "selectOnFocus"; "required": false; "isSignal": true; }; "transitionOptions": { "alias": "transitionOptions"; "required": false; }; "activeIndex": { "alias": "activeIndex"; "required": false; }; "headerAriaLevel": { "alias": "headerAriaLevel"; "required": false; }; }, { "value": "valueChange"; "activeIndexChange": "activeIndexChange"; "onClose": "onClose"; "onOpen": "onOpen"; }, ["tabList"], ["*"], true, never>;
}
export declare class AccordionModule {
static ɵfac: i0.ɵɵFactoryDeclaration<AccordionModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<AccordionModule, never, [typeof Accordion, typeof AccordionTab, typeof i2.SharedModule, typeof AccordionPanel, typeof AccordionHeader, typeof AccordionContent], [typeof Accordion, typeof AccordionTab, typeof i2.SharedModule, typeof AccordionPanel, typeof AccordionHeader, typeof AccordionContent]>;
static ɵinj: i0.ɵɵInjectorDeclaration<AccordionModule>;
}