1 | import { NgModule, Component, Input, Output, EventEmitter, ChangeDetectionStrategy, ViewEncapsulation, ContentChildren } from '@angular/core';
|
---|
2 | import { trigger, state, style, transition, animate } from '@angular/animations';
|
---|
3 | import { CommonModule } from '@angular/common';
|
---|
4 | import { SharedModule, PrimeTemplate } from 'primeng/api';
|
---|
5 | import { RippleModule } from 'primeng/ripple';
|
---|
6 | import * as i0 from "@angular/core";
|
---|
7 | import * as i1 from "@angular/common";
|
---|
8 | import * as i2 from "primeng/ripple";
|
---|
9 | let idx = 0;
|
---|
10 | export class Fieldset {
|
---|
11 | constructor(el) {
|
---|
12 | this.el = el;
|
---|
13 | this.collapsed = false;
|
---|
14 | this.collapsedChange = new EventEmitter();
|
---|
15 | this.onBeforeToggle = new EventEmitter();
|
---|
16 | this.onAfterToggle = new EventEmitter();
|
---|
17 | this.transitionOptions = '400ms cubic-bezier(0.86, 0, 0.07, 1)';
|
---|
18 | this.id = `p-fieldset-${idx++}`;
|
---|
19 | }
|
---|
20 | ngAfterContentInit() {
|
---|
21 | this.templates.forEach((item) => {
|
---|
22 | switch (item.getType()) {
|
---|
23 | case 'header':
|
---|
24 | this.headerTemplate = item.template;
|
---|
25 | break;
|
---|
26 | case 'content':
|
---|
27 | this.contentTemplate = item.template;
|
---|
28 | break;
|
---|
29 | }
|
---|
30 | });
|
---|
31 | }
|
---|
32 | toggle(event) {
|
---|
33 | if (this.animating) {
|
---|
34 | return false;
|
---|
35 | }
|
---|
36 | this.animating = true;
|
---|
37 | this.onBeforeToggle.emit({ originalEvent: event, collapsed: this.collapsed });
|
---|
38 | if (this.collapsed)
|
---|
39 | this.expand(event);
|
---|
40 | else
|
---|
41 | this.collapse(event);
|
---|
42 | this.onAfterToggle.emit({ originalEvent: event, collapsed: this.collapsed });
|
---|
43 | event.preventDefault();
|
---|
44 | }
|
---|
45 | expand(event) {
|
---|
46 | this.collapsed = false;
|
---|
47 | this.collapsedChange.emit(this.collapsed);
|
---|
48 | }
|
---|
49 | collapse(event) {
|
---|
50 | this.collapsed = true;
|
---|
51 | this.collapsedChange.emit(this.collapsed);
|
---|
52 | }
|
---|
53 | getBlockableElement() {
|
---|
54 | return this.el.nativeElement.children[0];
|
---|
55 | }
|
---|
56 | onToggleDone(event) {
|
---|
57 | this.animating = false;
|
---|
58 | }
|
---|
59 | }
|
---|
60 | Fieldset.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: Fieldset, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
---|
61 | Fieldset.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: Fieldset, selector: "p-fieldset", inputs: { legend: "legend", toggleable: "toggleable", collapsed: "collapsed", style: "style", styleClass: "styleClass", transitionOptions: "transitionOptions" }, outputs: { collapsedChange: "collapsedChange", onBeforeToggle: "onBeforeToggle", onAfterToggle: "onAfterToggle" }, host: { classAttribute: "p-element" }, queries: [{ propertyName: "templates", predicate: PrimeTemplate }], ngImport: i0, template: `
|
---|
62 | <fieldset [attr.id]="id" [ngClass]="{'p-fieldset p-component': true, 'p-fieldset-toggleable': toggleable}" [ngStyle]="style" [class]="styleClass">
|
---|
63 | <legend class="p-fieldset-legend">
|
---|
64 | <ng-container *ngIf="toggleable; else legendContent">
|
---|
65 | <a tabindex="0" (click)="toggle($event)" (keydown.enter)="toggle($event)" [attr.aria-controls]="id + '-content'" [attr.aria-expanded]="!collapsed" pRipple>
|
---|
66 | <span class="p-fieldset-toggler pi" *ngIf="toggleable" [ngClass]="{'pi-minus': !collapsed,'pi-plus':collapsed}"></span>
|
---|
67 | <ng-container *ngTemplateOutlet="legendContent"></ng-container>
|
---|
68 | </a>
|
---|
69 | </ng-container>
|
---|
70 | <ng-template #legendContent>
|
---|
71 | <span class="p-fieldset-legend-text">{{legend}}</span>
|
---|
72 | <ng-content select="p-header"></ng-content>
|
---|
73 | <ng-container *ngTemplateOutlet="headerTemplate"></ng-container>
|
---|
74 | </ng-template>
|
---|
75 | </legend>
|
---|
76 | <div [attr.id]="id + '-content'" class="p-toggleable-content" [@fieldsetContent]="collapsed ? {value: 'hidden', params: {transitionParams: transitionOptions, height: '0'}} : {value: 'visible', params: {transitionParams: animating ? transitionOptions : '0ms', height: '*'}}"
|
---|
77 | [attr.aria-labelledby]="id" [attr.aria-hidden]="collapsed"
|
---|
78 | (@fieldsetContent.done)="onToggleDone($event)" role="region">
|
---|
79 | <div class="p-fieldset-content">
|
---|
80 | <ng-content></ng-content>
|
---|
81 | <ng-container *ngTemplateOutlet="contentTemplate"></ng-container>
|
---|
82 | </div>
|
---|
83 | </div>
|
---|
84 | </fieldset>
|
---|
85 | `, isInline: true, styles: [".p-fieldset-legend>a,.p-fieldset-legend>span{display:flex;align-items:center;justify-content:center}.p-fieldset-toggleable .p-fieldset-legend a{cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;position:relative}.p-fieldset-legend-text{line-height:1}\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: i2.Ripple, selector: "[pRipple]" }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], animations: [
|
---|
86 | trigger('fieldsetContent', [
|
---|
87 | state('hidden', style({
|
---|
88 | height: '0',
|
---|
89 | overflow: 'hidden'
|
---|
90 | })),
|
---|
91 | state('visible', style({
|
---|
92 | height: '*'
|
---|
93 | })),
|
---|
94 | transition('visible <=> hidden', [style({ overflow: 'hidden' }), animate('{{transitionParams}}')]),
|
---|
95 | transition('void => *', animate(0))
|
---|
96 | ])
|
---|
97 | ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
---|
98 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: Fieldset, decorators: [{
|
---|
99 | type: Component,
|
---|
100 | args: [{ selector: 'p-fieldset', template: `
|
---|
101 | <fieldset [attr.id]="id" [ngClass]="{'p-fieldset p-component': true, 'p-fieldset-toggleable': toggleable}" [ngStyle]="style" [class]="styleClass">
|
---|
102 | <legend class="p-fieldset-legend">
|
---|
103 | <ng-container *ngIf="toggleable; else legendContent">
|
---|
104 | <a tabindex="0" (click)="toggle($event)" (keydown.enter)="toggle($event)" [attr.aria-controls]="id + '-content'" [attr.aria-expanded]="!collapsed" pRipple>
|
---|
105 | <span class="p-fieldset-toggler pi" *ngIf="toggleable" [ngClass]="{'pi-minus': !collapsed,'pi-plus':collapsed}"></span>
|
---|
106 | <ng-container *ngTemplateOutlet="legendContent"></ng-container>
|
---|
107 | </a>
|
---|
108 | </ng-container>
|
---|
109 | <ng-template #legendContent>
|
---|
110 | <span class="p-fieldset-legend-text">{{legend}}</span>
|
---|
111 | <ng-content select="p-header"></ng-content>
|
---|
112 | <ng-container *ngTemplateOutlet="headerTemplate"></ng-container>
|
---|
113 | </ng-template>
|
---|
114 | </legend>
|
---|
115 | <div [attr.id]="id + '-content'" class="p-toggleable-content" [@fieldsetContent]="collapsed ? {value: 'hidden', params: {transitionParams: transitionOptions, height: '0'}} : {value: 'visible', params: {transitionParams: animating ? transitionOptions : '0ms', height: '*'}}"
|
---|
116 | [attr.aria-labelledby]="id" [attr.aria-hidden]="collapsed"
|
---|
117 | (@fieldsetContent.done)="onToggleDone($event)" role="region">
|
---|
118 | <div class="p-fieldset-content">
|
---|
119 | <ng-content></ng-content>
|
---|
120 | <ng-container *ngTemplateOutlet="contentTemplate"></ng-container>
|
---|
121 | </div>
|
---|
122 | </div>
|
---|
123 | </fieldset>
|
---|
124 | `, animations: [
|
---|
125 | trigger('fieldsetContent', [
|
---|
126 | state('hidden', style({
|
---|
127 | height: '0',
|
---|
128 | overflow: 'hidden'
|
---|
129 | })),
|
---|
130 | state('visible', style({
|
---|
131 | height: '*'
|
---|
132 | })),
|
---|
133 | transition('visible <=> hidden', [style({ overflow: 'hidden' }), animate('{{transitionParams}}')]),
|
---|
134 | transition('void => *', animate(0))
|
---|
135 | ])
|
---|
136 | ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
---|
137 | 'class': 'p-element'
|
---|
138 | }, styles: [".p-fieldset-legend>a,.p-fieldset-legend>span{display:flex;align-items:center;justify-content:center}.p-fieldset-toggleable .p-fieldset-legend a{cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;position:relative}.p-fieldset-legend-text{line-height:1}\n"] }]
|
---|
139 | }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { legend: [{
|
---|
140 | type: Input
|
---|
141 | }], toggleable: [{
|
---|
142 | type: Input
|
---|
143 | }], collapsed: [{
|
---|
144 | type: Input
|
---|
145 | }], collapsedChange: [{
|
---|
146 | type: Output
|
---|
147 | }], onBeforeToggle: [{
|
---|
148 | type: Output
|
---|
149 | }], onAfterToggle: [{
|
---|
150 | type: Output
|
---|
151 | }], style: [{
|
---|
152 | type: Input
|
---|
153 | }], styleClass: [{
|
---|
154 | type: Input
|
---|
155 | }], transitionOptions: [{
|
---|
156 | type: Input
|
---|
157 | }], templates: [{
|
---|
158 | type: ContentChildren,
|
---|
159 | args: [PrimeTemplate]
|
---|
160 | }] } });
|
---|
161 | export class FieldsetModule {
|
---|
162 | }
|
---|
163 | FieldsetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: FieldsetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
---|
164 | FieldsetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: FieldsetModule, declarations: [Fieldset], imports: [CommonModule, RippleModule], exports: [Fieldset, SharedModule] });
|
---|
165 | FieldsetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: FieldsetModule, imports: [[CommonModule, RippleModule], SharedModule] });
|
---|
166 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: FieldsetModule, decorators: [{
|
---|
167 | type: NgModule,
|
---|
168 | args: [{
|
---|
169 | imports: [CommonModule, RippleModule],
|
---|
170 | exports: [Fieldset, SharedModule],
|
---|
171 | declarations: [Fieldset]
|
---|
172 | }]
|
---|
173 | }] });
|
---|
174 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmllbGRzZXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYXBwL2NvbXBvbmVudHMvZmllbGRzZXQvZmllbGRzZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLFFBQVEsRUFBQyxTQUFTLEVBQUMsS0FBSyxFQUFDLE1BQU0sRUFBQyxZQUFZLEVBQVksdUJBQXVCLEVBQUUsaUJBQWlCLEVBQStCLGVBQWUsRUFBYyxNQUFNLGVBQWUsQ0FBQztBQUM1TCxPQUFPLEVBQUMsT0FBTyxFQUFDLEtBQUssRUFBQyxLQUFLLEVBQUMsVUFBVSxFQUFDLE9BQU8sRUFBQyxNQUFNLHFCQUFxQixDQUFDO0FBQzNFLE9BQU8sRUFBQyxZQUFZLEVBQUMsTUFBTSxpQkFBaUIsQ0FBQztBQUM3QyxPQUFPLEVBQUMsWUFBWSxFQUFFLGFBQWEsRUFBQyxNQUFNLGFBQWEsQ0FBQztBQUV4RCxPQUFPLEVBQUMsWUFBWSxFQUFDLE1BQU0sZ0JBQWdCLENBQUM7Ozs7QUFFNUMsSUFBSSxHQUFHLEdBQVcsQ0FBQyxDQUFDO0FBaURwQixNQUFNLE9BQU8sUUFBUTtJQTRCakIsWUFBb0IsRUFBYzt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B0aW9ucywgaGVpZ2h0OiAnMCd9fSA6IHt2YWx1ZTogJ3Zpc2libGUnLCBwYXJhbXM6IHt0cmFuc2l0aW9uUGFyYW1zOiBhbmltYXRpbmcgPyB0cmFuc2l0aW9uT3B0aW9ucyA6ICcwbXMnLCBoZWlnaHQ6ICcqJ319XCJcbiAgICAgICAgICAgICAgICAgICAgICAgIFthdHRyLmFyaWEtbGFiZWxsZWRieV09XCJpZFwiIFthdHRyLmFyaWEtaGlkZGVuXT1cImNvbGxhcHNlZFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgKEBmaWVsZHNldENvbnRlbnQuZG9uZSk9XCJvblRvZ2dsZURvbmUoJGV2ZW50KVwiIHJvbGU9XCJyZWdpb25cIj5cbiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwicC1maWVsZHNldC1jb250ZW50XCI+XG4gICAgICAgICAgICAgICAgICAgIDxuZy1jb250ZW50PjwvbmctY29udGVudD5cbiAgICAgICAgICAgICAgICAgICAgPG5nLWNvbnRhaW5lciAqbmdUZW1wbGF0ZU91dGxldD1cImNvbnRlbnRUZW1wbGF0ZVwiPjwvbmctY29udGFpbmVyPlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgIDwvZmllbGRzZXQ+XG4gICAgYCxcbiAgICBhbmltYXRpb25zOiBbXG4gICAgICAgIHRyaWdnZXIoJ2ZpZWxkc2V0Q29udGVudCcsIFtcbiAgICAgICAgICAgIHN0YXRlKCdoaWRkZW4nLCBzdHlsZSh7XG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAnMCcsXG4gICAgICAgICAgICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nXG4gICAgICAgICAgICB9KSksXG4gICAgICAgICAgICBzdGF0ZSgndmlzaWJsZScsIHN0eWxlKHtcbiAgICAgICAgICAgICAgICBoZWlnaHQ6ICcqJ1xuICAgICAgICAgICAgfSkpLFxuICAgICAgICAgICAgdHJhbnNp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