source: trip-planner-front/node_modules/primeng/fesm2020/primeng-panel.mjs@ 1ad8e64

Last change on this file since 1ad8e64 was 59329aa, checked in by Ema <ema_spirova@…>, 3 years ago

adding photos

  • Property mode set to 100644
File size: 12.7 KB
RevLine 
[59329aa]1import * as i0 from '@angular/core';
2import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, ContentChild, ContentChildren, NgModule } from '@angular/core';
3import * as i1 from '@angular/common';
4import { CommonModule } from '@angular/common';
5import { Footer, PrimeTemplate, SharedModule } from 'primeng/api';
6import * as i2 from 'primeng/ripple';
7import { RippleModule } from 'primeng/ripple';
8import { trigger, state, style, transition, animate } from '@angular/animations';
9
10let idx = 0;
11class Panel {
12 constructor(el) {
13 this.el = el;
14 this.collapsed = false;
15 this.expandIcon = 'pi pi-plus';
16 this.collapseIcon = 'pi pi-minus';
17 this.showHeader = true;
18 this.toggler = "icon";
19 this.collapsedChange = new EventEmitter();
20 this.onBeforeToggle = new EventEmitter();
21 this.onAfterToggle = new EventEmitter();
22 this.transitionOptions = '400ms cubic-bezier(0.86, 0, 0.07, 1)';
23 this.id = `p-panel-${idx++}`;
24 }
25 ngAfterContentInit() {
26 this.templates.forEach((item) => {
27 switch (item.getType()) {
28 case 'header':
29 this.headerTemplate = item.template;
30 break;
31 case 'content':
32 this.contentTemplate = item.template;
33 break;
34 case 'footer':
35 this.footerTemplate = item.template;
36 break;
37 case 'icons':
38 this.iconTemplate = item.template;
39 break;
40 default:
41 this.contentTemplate = item.template;
42 break;
43 }
44 });
45 }
46 onHeaderClick(event) {
47 if (this.toggler === 'header') {
48 this.toggle(event);
49 }
50 }
51 onIconClick(event) {
52 if (this.toggler === 'icon') {
53 this.toggle(event);
54 }
55 }
56 toggle(event) {
57 if (this.animating) {
58 return false;
59 }
60 this.animating = true;
61 this.onBeforeToggle.emit({ originalEvent: event, collapsed: this.collapsed });
62 if (this.toggleable) {
63 if (this.collapsed)
64 this.expand(event);
65 else
66 this.collapse(event);
67 }
68 event.preventDefault();
69 }
70 expand(event) {
71 this.collapsed = false;
72 this.collapsedChange.emit(this.collapsed);
73 }
74 collapse(event) {
75 this.collapsed = true;
76 this.collapsedChange.emit(this.collapsed);
77 }
78 getBlockableElement() {
79 return this.el.nativeElement.children[0];
80 }
81 onToggleDone(event) {
82 this.animating = false;
83 this.onAfterToggle.emit({ originalEvent: event, collapsed: this.collapsed });
84 }
85}
86Panel.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: Panel, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
87Panel.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: Panel, selector: "p-panel", inputs: { toggleable: "toggleable", header: "header", collapsed: "collapsed", style: "style", styleClass: "styleClass", expandIcon: "expandIcon", collapseIcon: "collapseIcon", showHeader: "showHeader", toggler: "toggler", transitionOptions: "transitionOptions" }, outputs: { collapsedChange: "collapsedChange", onBeforeToggle: "onBeforeToggle", onAfterToggle: "onAfterToggle" }, host: { classAttribute: "p-element" }, queries: [{ propertyName: "footerFacet", first: true, predicate: Footer, descendants: true }, { propertyName: "templates", predicate: PrimeTemplate }], ngImport: i0, template: `
88 <div [attr.id]="id" [ngClass]="{'p-panel p-component': true, 'p-panel-toggleable': toggleable}" [ngStyle]="style" [class]="styleClass">
89 <div class="p-panel-header" *ngIf="showHeader" (click)="onHeaderClick($event)" [attr.id]="id + '-titlebar'">
90 <span class="p-panel-title" *ngIf="header" [attr.id]="id + '_header'">{{header}}</span>
91 <ng-content select="p-header"></ng-content>
92 <ng-container *ngTemplateOutlet="headerTemplate"></ng-container>
93 <div class="p-panel-icons">
94 <ng-template *ngTemplateOutlet="iconTemplate"></ng-template>
95 <button *ngIf="toggleable" type="button" [attr.id]="id + '-label'" class="p-panel-header-icon p-panel-toggler p-link" pRipple
96 (click)="onIconClick($event)" (keydown.enter)="onIconClick($event)" [attr.aria-controls]="id + '-content'" role="tab" [attr.aria-expanded]="!collapsed">
97 <span [class]="collapsed ? expandIcon : collapseIcon"></span>
98 </button>
99 </div>
100 </div>
101 <div [attr.id]="id + '-content'" class="p-toggleable-content" [@panelContent]="collapsed ? {value: 'hidden', params: {transitionParams: animating ? transitionOptions : '0ms', height: '0', opacity:'0'}} : {value: 'visible', params: {transitionParams: animating ? transitionOptions : '0ms', height: '*', opacity: '1'}}" (@panelContent.done)="onToggleDone($event)"
102 role="region" [attr.aria-hidden]="collapsed" [attr.aria-labelledby]="id + '-titlebar'">
103 <div class="p-panel-content">
104 <ng-content></ng-content>
105 <ng-container *ngTemplateOutlet="contentTemplate"></ng-container>
106 </div>
107
108 <div class="p-panel-footer" *ngIf="footerFacet || footerTemplate">
109 <ng-content select="p-footer"></ng-content>
110 <ng-container *ngTemplateOutlet="footerTemplate"></ng-container>
111 </div>
112 </div>
113 </div>
114 `, isInline: true, styles: [".p-panel-header{display:flex;justify-content:space-between;align-items:center}.p-panel-title{line-height:1}.p-panel-header-icon{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;text-decoration:none;overflow:hidden;position:relative}\n"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.Ripple, selector: "[pRipple]" }], animations: [
115 trigger('panelContent', [
116 state('hidden', style({
117 height: '0',
118 overflow: 'hidden'
119 })),
120 state('void', style({
121 height: '{{height}}'
122 }), { params: { height: '0' } }),
123 state('visible', style({
124 height: '*'
125 })),
126 transition('visible <=> hidden', [style({ overflow: 'hidden' }), animate('{{transitionParams}}')]),
127 transition('void => hidden', animate('{{transitionParams}}')),
128 transition('void => visible', animate('{{transitionParams}}'))
129 ])
130 ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
131i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: Panel, decorators: [{
132 type: Component,
133 args: [{ selector: 'p-panel', template: `
134 <div [attr.id]="id" [ngClass]="{'p-panel p-component': true, 'p-panel-toggleable': toggleable}" [ngStyle]="style" [class]="styleClass">
135 <div class="p-panel-header" *ngIf="showHeader" (click)="onHeaderClick($event)" [attr.id]="id + '-titlebar'">
136 <span class="p-panel-title" *ngIf="header" [attr.id]="id + '_header'">{{header}}</span>
137 <ng-content select="p-header"></ng-content>
138 <ng-container *ngTemplateOutlet="headerTemplate"></ng-container>
139 <div class="p-panel-icons">
140 <ng-template *ngTemplateOutlet="iconTemplate"></ng-template>
141 <button *ngIf="toggleable" type="button" [attr.id]="id + '-label'" class="p-panel-header-icon p-panel-toggler p-link" pRipple
142 (click)="onIconClick($event)" (keydown.enter)="onIconClick($event)" [attr.aria-controls]="id + '-content'" role="tab" [attr.aria-expanded]="!collapsed">
143 <span [class]="collapsed ? expandIcon : collapseIcon"></span>
144 </button>
145 </div>
146 </div>
147 <div [attr.id]="id + '-content'" class="p-toggleable-content" [@panelContent]="collapsed ? {value: 'hidden', params: {transitionParams: animating ? transitionOptions : '0ms', height: '0', opacity:'0'}} : {value: 'visible', params: {transitionParams: animating ? transitionOptions : '0ms', height: '*', opacity: '1'}}" (@panelContent.done)="onToggleDone($event)"
148 role="region" [attr.aria-hidden]="collapsed" [attr.aria-labelledby]="id + '-titlebar'">
149 <div class="p-panel-content">
150 <ng-content></ng-content>
151 <ng-container *ngTemplateOutlet="contentTemplate"></ng-container>
152 </div>
153
154 <div class="p-panel-footer" *ngIf="footerFacet || footerTemplate">
155 <ng-content select="p-footer"></ng-content>
156 <ng-container *ngTemplateOutlet="footerTemplate"></ng-container>
157 </div>
158 </div>
159 </div>
160 `, animations: [
161 trigger('panelContent', [
162 state('hidden', style({
163 height: '0',
164 overflow: 'hidden'
165 })),
166 state('void', style({
167 height: '{{height}}'
168 }), { params: { height: '0' } }),
169 state('visible', style({
170 height: '*'
171 })),
172 transition('visible <=> hidden', [style({ overflow: 'hidden' }), animate('{{transitionParams}}')]),
173 transition('void => hidden', animate('{{transitionParams}}')),
174 transition('void => visible', animate('{{transitionParams}}'))
175 ])
176 ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
177 'class': 'p-element'
178 }, styles: [".p-panel-header{display:flex;justify-content:space-between;align-items:center}.p-panel-title{line-height:1}.p-panel-header-icon{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;text-decoration:none;overflow:hidden;position:relative}\n"] }]
179 }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { toggleable: [{
180 type: Input
181 }], header: [{
182 type: Input
183 }], collapsed: [{
184 type: Input
185 }], style: [{
186 type: Input
187 }], styleClass: [{
188 type: Input
189 }], expandIcon: [{
190 type: Input
191 }], collapseIcon: [{
192 type: Input
193 }], showHeader: [{
194 type: Input
195 }], toggler: [{
196 type: Input
197 }], collapsedChange: [{
198 type: Output
199 }], onBeforeToggle: [{
200 type: Output
201 }], onAfterToggle: [{
202 type: Output
203 }], transitionOptions: [{
204 type: Input
205 }], footerFacet: [{
206 type: ContentChild,
207 args: [Footer]
208 }], templates: [{
209 type: ContentChildren,
210 args: [PrimeTemplate]
211 }] } });
212class PanelModule {
213}
214PanelModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: PanelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
215PanelModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: PanelModule, declarations: [Panel], imports: [CommonModule, SharedModule, RippleModule], exports: [Panel, SharedModule] });
216PanelModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: PanelModule, imports: [[CommonModule, SharedModule, RippleModule], SharedModule] });
217i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: PanelModule, decorators: [{
218 type: NgModule,
219 args: [{
220 imports: [CommonModule, SharedModule, RippleModule],
221 exports: [Panel, SharedModule],
222 declarations: [Panel]
223 }]
224 }] });
225
226/**
227 * Generated bundle index. Do not edit.
228 */
229
230export { Panel, PanelModule };
Note: See TracBrowser for help on using the repository browser.