import { AnimationEvent } from '@angular/animations'; import { CdkAccordionItem } from '@angular/cdk/accordion'; import { UniqueSelectionDispatcher } from '@angular/cdk/collections'; import { TemplatePortal } from '@angular/cdk/portal'; import { AfterContentInit, ChangeDetectorRef, ElementRef, EventEmitter, InjectionToken, OnChanges, OnDestroy, SimpleChanges, ViewContainerRef } from '@angular/core'; import { TsDocumentService } from '@terminus/ngx-tools/browser'; import { Subject } from 'rxjs'; import { TsAccordionBase } from './accordion/accordion-base'; import { TsExpansionPanelContentDirective } from './expansion-panel-content.directive'; /** * The possible states for a {@link TsExpansionPanelComponent} */ export declare type TsExpansionPanelState = 'expanded' | 'collapsed'; /** * Object that can be used to override the default options for all of the expansion panels in a module. */ export interface TsExpansionPanelDefaultOptions { /** * Height of the trigger while the panel is expanded */ expandedHeight: string; /** * Height of the trigger while the panel is collapsed */ collapsedHeight: string; /** * Whether the toggle indicator should be hidden */ hideToggle: boolean; } /** * Injection token that can be used to configure the defalt options for the expansion panel component. */ export declare const TS_EXPANSION_PANEL_DEFAULT_OPTIONS: InjectionToken; /** * An expansion panel component to show/hide content * * @example * * * Panel trigger * * * Panel content * * * https://getterminus.github.io/ui-demos-release/components/expansion-panel */ export declare class TsExpansionPanelComponent extends CdkAccordionItem implements AfterContentInit, OnChanges, OnDestroy { protected _uniqueSelectionDispatcher: UniqueSelectionDispatcher; private _viewContainerRef; private documentService; animationMode?: string | undefined; /** * Stream of body animation done events */ bodyAnimationDone: Subject; /** * The ID for the associated trigger element. Used for a11y labelling. */ triggerId: string; /** * Portal holding the user's content */ portal: TemplatePortal | undefined; /** * Stream that emits for changes in `@Input` properties */ readonly inputChanges: Subject; /** * Optionally defined accordion the expansion panel belongs to * * NOTE: This should be `TsAccordionBase | undefined` but the underlying class doesn't define it as possibly undefined so we cannot * do so here. */ accordion: TsAccordionBase; /** * Get the current expanded state */ get currentExpandedState(): TsExpansionPanelState; /** * Determine whether the expansion panel's content contains the currently-focused element */ get contentContainsFocus(): boolean; /** * Reference to a passed in template (for lazy loading) */ lazyContent: TsExpansionPanelContentDirective; /** * The element containing the panel's user-provided content */ panelBody: ElementRef; /** * Determine if the toggle indicator should be hidden * * @param value */ set hideToggle(value: boolean); get hideToggle(): boolean; private _hideToggle; /** * Define if the panel should be disabled * * NOTE: CdkAccordionItem defines an input called `disabled`. * This alias is to conform to our existing naming convention. * * @param value */ set isDisabled(value: boolean); get isDisabled(): boolean; /** * Define if the panel should be open * * NOTE: CdkAccordionItem defines an input called `expanded`. * This alias is to conform to our existing naming convention. * * @param value */ set isExpanded(value: boolean); get isExpanded(): boolean; /** * Support for transparent mode. Default set to false * * @param value */ set transparentMode(value: boolean); get transparentMode(): boolean; private _transparentMode; /** * The event emitted after the panel body's expansion animation finishes */ readonly afterExpand: EventEmitter; /** * The event emitted after the panel body's collapse animation finishes */ readonly afterCollapse: EventEmitter; constructor(_changeDetectorRef: ChangeDetectorRef, _uniqueSelectionDispatcher: UniqueSelectionDispatcher, _viewContainerRef: ViewContainerRef, documentService: TsDocumentService, accordion: TsAccordionBase, animationMode?: string | undefined, defaultOptions?: TsExpansionPanelDefaultOptions); /** * If a lazy-loaded template exists, inject it after the panel is opened */ ngAfterContentInit(): void; /** * Send any input changes through the Subject stream * * @param changes */ ngOnChanges(changes: SimpleChanges): void; /** * Destroy the parent and finalize any subscriptions */ ngOnDestroy(): void; }