(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('primeng/api'), require('primeng/ripple'), require('@angular/animations')) : typeof define === 'function' && define.amd ? define('primeng/panel', ['exports', '@angular/core', '@angular/common', 'primeng/api', 'primeng/ripple', '@angular/animations'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.primeng = global.primeng || {}, global.primeng.panel = {}), global.ng.core, global.ng.common, global.primeng.api, global.primeng.ripple, global.ng.animations)); }(this, (function (exports, core, common, api, ripple, animations) { 'use strict'; var idx = 0; var Panel = /** @class */ (function () { function Panel(el) { this.el = el; this.collapsed = false; this.expandIcon = 'pi pi-plus'; this.collapseIcon = 'pi pi-minus'; this.showHeader = true; this.toggler = "icon"; this.collapsedChange = new core.EventEmitter(); this.onBeforeToggle = new core.EventEmitter(); this.onAfterToggle = new core.EventEmitter(); this.transitionOptions = '400ms cubic-bezier(0.86, 0, 0.07, 1)'; this.id = "p-panel-" + idx++; } Panel.prototype.ngAfterContentInit = function () { var _this = this; this.templates.forEach(function (item) { switch (item.getType()) { case 'header': _this.headerTemplate = item.template; break; case 'content': _this.contentTemplate = item.template; break; case 'footer': _this.footerTemplate = item.template; break; case 'icons': _this.iconTemplate = item.template; break; default: _this.contentTemplate = item.template; break; } }); }; Panel.prototype.onHeaderClick = function (event) { if (this.toggler === 'header') { this.toggle(event); } }; Panel.prototype.onIconClick = function (event) { if (this.toggler === 'icon') { this.toggle(event); } }; Panel.prototype.toggle = function (event) { if (this.animating) { return false; } this.animating = true; this.onBeforeToggle.emit({ originalEvent: event, collapsed: this.collapsed }); if (this.toggleable) { if (this.collapsed) this.expand(event); else this.collapse(event); } event.preventDefault(); }; Panel.prototype.expand = function (event) { this.collapsed = false; this.collapsedChange.emit(this.collapsed); }; Panel.prototype.collapse = function (event) { this.collapsed = true; this.collapsedChange.emit(this.collapsed); }; Panel.prototype.getBlockableElement = function () { return this.el.nativeElement.children[0]; }; Panel.prototype.onToggleDone = function (event) { this.animating = false; this.onAfterToggle.emit({ originalEvent: event, collapsed: this.collapsed }); }; return Panel; }()); Panel.decorators = [ { type: core.Component, args: [{ selector: 'p-panel', template: "\n
\n
\n {{header}}\n \n \n
\n \n \n
\n
\n
\n
\n \n \n
\n \n
\n \n \n
\n
\n
\n ", animations: [ animations.trigger('panelContent', [ animations.state('hidden', animations.style({ height: '0', overflow: 'hidden' })), animations.state('void', animations.style({ height: '{{height}}' }), { params: { height: '0' } }), animations.state('visible', animations.style({ height: '*' })), animations.transition('visible <=> hidden', [animations.style({ overflow: 'hidden' }), animations.animate('{{transitionParams}}')]), animations.transition('void => hidden', animations.animate('{{transitionParams}}')), animations.transition('void => visible', animations.animate('{{transitionParams}}')) ]) ], changeDetection: core.ChangeDetectionStrategy.OnPush, encapsulation: core.ViewEncapsulation.None, styles: [".p-panel-header{-ms-flex-align:center;-ms-flex-pack:justify;align-items:center;display:-ms-flexbox;display:flex;justify-content:space-between}.p-panel-title{line-height:1}.p-panel-header-icon{-ms-flex-align:center;-ms-flex-pack:center;align-items:center;cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;justify-content:center;overflow:hidden;position:relative;text-decoration:none}"] },] } ]; Panel.ctorParameters = function () { return [ { type: core.ElementRef } ]; }; Panel.propDecorators = { toggleable: [{ type: core.Input }], header: [{ type: core.Input }], collapsed: [{ type: core.Input }], style: [{ type: core.Input }], styleClass: [{ type: core.Input }], expandIcon: [{ type: core.Input }], collapseIcon: [{ type: core.Input }], showHeader: [{ type: core.Input }], toggler: [{ type: core.Input }], collapsedChange: [{ type: core.Output }], onBeforeToggle: [{ type: core.Output }], onAfterToggle: [{ type: core.Output }], transitionOptions: [{ type: core.Input }], footerFacet: [{ type: core.ContentChild, args: [api.Footer,] }], templates: [{ type: core.ContentChildren, args: [api.PrimeTemplate,] }] }; var PanelModule = /** @class */ (function () { function PanelModule() { } return PanelModule; }()); PanelModule.decorators = [ { type: core.NgModule, args: [{ imports: [common.CommonModule, api.SharedModule, ripple.RippleModule], exports: [Panel, api.SharedModule], declarations: [Panel] },] } ]; /** * Generated bundle index. Do not edit. */ exports.Panel = Panel; exports.PanelModule = PanelModule; Object.defineProperty(exports, '__esModule', { value: true }); }))); //# sourceMappingURL=primeng-panel.umd.js.map