source: trip-planner-front/node_modules/primeng/fesm2015/primeng-cascadeselect.mjs@ 59329aa

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

adding photos

  • Property mode set to 100644
File size: 35.7 KB
Line 
1import * as i0 from '@angular/core';
2import { forwardRef, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Inject, Input, Output, ViewChild, ContentChildren, NgModule } from '@angular/core';
3import * as i1 from '@angular/common';
4import { CommonModule } from '@angular/common';
5import * as i3 from 'primeng/api';
6import { PrimeTemplate, SharedModule } from 'primeng/api';
7import { ObjectUtils, ZIndexUtils } from 'primeng/utils';
8import { DomHandler, ConnectedOverlayScrollHandler } from 'primeng/dom';
9import { trigger, transition, style, animate } from '@angular/animations';
10import { NG_VALUE_ACCESSOR } from '@angular/forms';
11import * as i2 from 'primeng/ripple';
12import { RippleModule } from 'primeng/ripple';
13
14const CASCADESELECT_VALUE_ACCESSOR = {
15 provide: NG_VALUE_ACCESSOR,
16 useExisting: forwardRef(() => CascadeSelect),
17 multi: true
18};
19class CascadeSelectSub {
20 constructor(cascadeSelect, el) {
21 this.el = el;
22 this.level = 0;
23 this.onSelect = new EventEmitter();
24 this.onGroupSelect = new EventEmitter();
25 this.activeOption = null;
26 this.cascadeSelect = cascadeSelect;
27 }
28 get parentActive() {
29 return this._parentActive;
30 }
31 ;
32 set parentActive(val) {
33 if (!val) {
34 this.activeOption = null;
35 }
36 this._parentActive = val;
37 }
38 ngOnInit() {
39 if (this.selectionPath && this.options && !this.dirty) {
40 for (let option of this.options) {
41 if (this.selectionPath.includes(option)) {
42 this.activeOption = option;
43 break;
44 }
45 }
46 }
47 if (!this.root) {
48 this.position();
49 }
50 }
51 onOptionClick(event, option) {
52 if (this.isOptionGroup(option)) {
53 this.activeOption = (this.activeOption === option) ? null : option;
54 this.onGroupSelect.emit({
55 originalEvent: event,
56 value: option
57 });
58 }
59 else {
60 this.onSelect.emit({
61 originalEvent: event,
62 value: this.getOptionValue(option)
63 });
64 }
65 }
66 onOptionSelect(event) {
67 this.onSelect.emit(event);
68 }
69 onOptionGroupSelect(event) {
70 this.onGroupSelect.emit(event);
71 }
72 getOptionLabel(option) {
73 return this.optionLabel ? ObjectUtils.resolveFieldData(option, this.optionLabel) : option;
74 }
75 getOptionValue(option) {
76 return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : option;
77 }
78 getOptionGroupLabel(optionGroup) {
79 return this.optionGroupLabel ? ObjectUtils.resolveFieldData(optionGroup, this.optionGroupLabel) : null;
80 }
81 getOptionGroupChildren(optionGroup) {
82 return ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren[this.level]);
83 }
84 isOptionGroup(option) {
85 return Object.prototype.hasOwnProperty.call(option, this.optionGroupChildren[this.level]);
86 }
87 getOptionLabelToRender(option) {
88 return this.isOptionGroup(option) ? this.getOptionGroupLabel(option) : this.getOptionLabel(option);
89 }
90 getItemClass(option) {
91 return {
92 'p-cascadeselect-item': true,
93 'p-cascadeselect-item-group': this.isOptionGroup(option),
94 'p-cascadeselect-item-active p-highlight': this.isOptionActive(option)
95 };
96 }
97 isOptionActive(option) {
98 return this.activeOption === option;
99 }
100 onKeyDown(event, option, index) {
101 let listItem = event.currentTarget.parentElement;
102 switch (event.key) {
103 case 'Down':
104 case 'ArrowDown':
105 var nextItem = this.el.nativeElement.children[0].children[index + 1];
106 if (nextItem) {
107 nextItem.children[0].focus();
108 }
109 event.preventDefault();
110 break;
111 case 'Up':
112 case 'ArrowUp':
113 var prevItem = this.el.nativeElement.children[0].children[index - 1];
114 if (prevItem) {
115 prevItem.children[0].focus();
116 }
117 event.preventDefault();
118 break;
119 case 'Right':
120 case 'ArrowRight':
121 if (this.isOptionGroup(option)) {
122 if (this.isOptionActive(option)) {
123 listItem.children[1].children[0].children[0].children[0].focus();
124 }
125 else {
126 this.activeOption = option;
127 }
128 }
129 event.preventDefault();
130 break;
131 case 'Left':
132 case 'ArrowLeft':
133 this.activeOption = null;
134 var parentList = listItem.parentElement.parentElement.parentElement;
135 if (parentList) {
136 parentList.children[0].focus();
137 }
138 event.preventDefault();
139 break;
140 case 'Enter':
141 this.onOptionClick(event, option);
142 event.preventDefault();
143 break;
144 case 'Tab':
145 case 'Escape':
146 this.cascadeSelect.hide();
147 event.preventDefault();
148 break;
149 }
150 }
151 position() {
152 const parentItem = this.el.nativeElement.parentElement;
153 const containerOffset = DomHandler.getOffset(parentItem);
154 const viewport = DomHandler.getViewport();
155 const sublistWidth = this.el.nativeElement.children[0].offsetParent ? this.el.nativeElement.children[0].offsetWidth : DomHandler.getHiddenElementOuterWidth(this.el.nativeElement.children[0]);
156 const itemOuterWidth = DomHandler.getOuterWidth(parentItem.children[0]);
157 if ((parseInt(containerOffset.left, 10) + itemOuterWidth + sublistWidth) > (viewport.width - DomHandler.calculateScrollbarWidth())) {
158 this.el.nativeElement.children[0].style.left = '-200%';
159 }
160 }
161}
162CascadeSelectSub.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CascadeSelectSub, deps: [{ token: forwardRef(() => CascadeSelect) }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
163CascadeSelectSub.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: CascadeSelectSub, selector: "p-cascadeSelectSub", inputs: { selectionPath: "selectionPath", options: "options", optionGroupChildren: "optionGroupChildren", optionTemplate: "optionTemplate", level: "level", optionLabel: "optionLabel", optionValue: "optionValue", optionGroupLabel: "optionGroupLabel", dirty: "dirty", root: "root", parentActive: "parentActive" }, outputs: { onSelect: "onSelect", onGroupSelect: "onGroupSelect" }, ngImport: i0, template: `
164 <ul class="p-cascadeselect-panel p-cascadeselect-items" [ngClass]="{'p-cascadeselect-panel-root': root}" role="listbox" aria-orientation="horizontal">
165 <ng-template ngFor let-option [ngForOf]="options" let-i="index">
166 <li [ngClass]="getItemClass(option)" role="none">
167 <div class="p-cascadeselect-item-content" (click)="onOptionClick($event, option)" tabindex="0" (keydown)="onKeyDown($event, option, i)" pRipple>
168 <ng-container *ngIf="optionTemplate;else defaultOptionTemplate">
169 <ng-container *ngTemplateOutlet="optionTemplate; context: {$implicit: option}"></ng-container>
170 </ng-container>
171 <ng-template #defaultOptionTemplate>
172 <span class="p-cascadeselect-item-text">{{getOptionLabelToRender(option)}}</span>
173 </ng-template>
174 <span class="p-cascadeselect-group-icon pi pi-angle-right" *ngIf="isOptionGroup(option)"></span>
175 </div>
176 <p-cascadeSelectSub *ngIf="isOptionGroup(option) && isOptionActive(option)" class="p-cascadeselect-sublist" [selectionPath]="selectionPath" [options]="getOptionGroupChildren(option)"
177 [optionLabel]="optionLabel" [optionValue]="optionValue" [level]="level + 1" (onSelect)="onOptionSelect($event)" (onOptionGroupSelect)="onOptionGroupSelect()"
178 [optionGroupLabel]="optionGroupLabel" [optionGroupChildren]="optionGroupChildren" [parentActive]="isOptionActive(option)" [dirty]="dirty" [optionTemplate]="optionTemplate">
179 </p-cascadeSelectSub>
180 </li>
181 </ng-template>
182 </ul>
183 `, isInline: true, components: [{ type: CascadeSelectSub, selector: "p-cascadeSelectSub", inputs: ["selectionPath", "options", "optionGroupChildren", "optionTemplate", "level", "optionLabel", "optionValue", "optionGroupLabel", "dirty", "root", "parentActive"], outputs: ["onSelect", "onGroupSelect"] }], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.Ripple, selector: "[pRipple]" }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
184i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CascadeSelectSub, decorators: [{
185 type: Component,
186 args: [{
187 selector: 'p-cascadeSelectSub',
188 template: `
189 <ul class="p-cascadeselect-panel p-cascadeselect-items" [ngClass]="{'p-cascadeselect-panel-root': root}" role="listbox" aria-orientation="horizontal">
190 <ng-template ngFor let-option [ngForOf]="options" let-i="index">
191 <li [ngClass]="getItemClass(option)" role="none">
192 <div class="p-cascadeselect-item-content" (click)="onOptionClick($event, option)" tabindex="0" (keydown)="onKeyDown($event, option, i)" pRipple>
193 <ng-container *ngIf="optionTemplate;else defaultOptionTemplate">
194 <ng-container *ngTemplateOutlet="optionTemplate; context: {$implicit: option}"></ng-container>
195 </ng-container>
196 <ng-template #defaultOptionTemplate>
197 <span class="p-cascadeselect-item-text">{{getOptionLabelToRender(option)}}</span>
198 </ng-template>
199 <span class="p-cascadeselect-group-icon pi pi-angle-right" *ngIf="isOptionGroup(option)"></span>
200 </div>
201 <p-cascadeSelectSub *ngIf="isOptionGroup(option) && isOptionActive(option)" class="p-cascadeselect-sublist" [selectionPath]="selectionPath" [options]="getOptionGroupChildren(option)"
202 [optionLabel]="optionLabel" [optionValue]="optionValue" [level]="level + 1" (onSelect)="onOptionSelect($event)" (onOptionGroupSelect)="onOptionGroupSelect()"
203 [optionGroupLabel]="optionGroupLabel" [optionGroupChildren]="optionGroupChildren" [parentActive]="isOptionActive(option)" [dirty]="dirty" [optionTemplate]="optionTemplate">
204 </p-cascadeSelectSub>
205 </li>
206 </ng-template>
207 </ul>
208 `,
209 encapsulation: ViewEncapsulation.None,
210 changeDetection: ChangeDetectionStrategy.OnPush
211 }]
212 }], ctorParameters: function () {
213 return [{ type: undefined, decorators: [{
214 type: Inject,
215 args: [forwardRef(() => CascadeSelect)]
216 }] }, { type: i0.ElementRef }];
217 }, propDecorators: { selectionPath: [{
218 type: Input
219 }], options: [{
220 type: Input
221 }], optionGroupChildren: [{
222 type: Input
223 }], optionTemplate: [{
224 type: Input
225 }], level: [{
226 type: Input
227 }], optionLabel: [{
228 type: Input
229 }], optionValue: [{
230 type: Input
231 }], optionGroupLabel: [{
232 type: Input
233 }], dirty: [{
234 type: Input
235 }], root: [{
236 type: Input
237 }], onSelect: [{
238 type: Output
239 }], onGroupSelect: [{
240 type: Output
241 }], parentActive: [{
242 type: Input
243 }] } });
244class CascadeSelect {
245 constructor(el, cd, config, overlayService) {
246 this.el = el;
247 this.cd = cd;
248 this.config = config;
249 this.overlayService = overlayService;
250 this.showTransitionOptions = '.12s cubic-bezier(0, 0, 0.2, 1)';
251 this.hideTransitionOptions = '.1s linear';
252 this.onChange = new EventEmitter();
253 this.onGroupChange = new EventEmitter();
254 this.onShow = new EventEmitter();
255 this.onHide = new EventEmitter();
256 this.onBeforeShow = new EventEmitter();
257 this.onBeforeHide = new EventEmitter();
258 this.selectionPath = null;
259 this.focused = false;
260 this.filled = false;
261 this.overlayVisible = false;
262 this.dirty = false;
263 this.onModelChange = () => { };
264 this.onModelTouched = () => { };
265 }
266 ngOnInit() {
267 this.updateSelectionPath();
268 }
269 ngAfterContentInit() {
270 this.templates.forEach((item) => {
271 switch (item.getType()) {
272 case 'value':
273 this.valueTemplate = item.template;
274 break;
275 case 'option':
276 this.optionTemplate = item.template;
277 break;
278 }
279 });
280 }
281 onOptionSelect(event) {
282 this.value = event.value;
283 this.updateSelectionPath();
284 this.onModelChange(this.value);
285 this.onChange.emit(event);
286 this.hide();
287 this.focusInputEl.nativeElement.focus();
288 }
289 onOptionGroupSelect(event) {
290 this.dirty = true;
291 this.onGroupChange.emit(event);
292 }
293 getOptionLabel(option) {
294 return this.optionLabel ? ObjectUtils.resolveFieldData(option, this.optionLabel) : option;
295 }
296 getOptionValue(option) {
297 return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : option;
298 }
299 getOptionGroupChildren(optionGroup, level) {
300 return ObjectUtils.resolveFieldData(optionGroup, this.optionGroupChildren[level]);
301 }
302 isOptionGroup(option, level) {
303 return Object.prototype.hasOwnProperty.call(option, this.optionGroupChildren[level]);
304 }
305 updateSelectionPath() {
306 let path;
307 if (this.value != null && this.options) {
308 for (let option of this.options) {
309 path = this.findModelOptionInGroup(option, 0);
310 if (path) {
311 break;
312 }
313 }
314 }
315 this.selectionPath = path;
316 this.updateFilledState();
317 }
318 updateFilledState() {
319 this.filled = !(this.selectionPath == null || this.selectionPath.length == 0);
320 }
321 findModelOptionInGroup(option, level) {
322 if (this.isOptionGroup(option, level)) {
323 let selectedOption;
324 for (let childOption of this.getOptionGroupChildren(option, level)) {
325 selectedOption = this.findModelOptionInGroup(childOption, level + 1);
326 if (selectedOption) {
327 selectedOption.unshift(option);
328 return selectedOption;
329 }
330 }
331 }
332 else if ((ObjectUtils.equals(this.value, this.getOptionValue(option), this.dataKey))) {
333 return [option];
334 }
335 return null;
336 }
337 show() {
338 this.onBeforeShow.emit();
339 this.overlayVisible = true;
340 }
341 hide() {
342 this.onBeforeHide.emit();
343 this.overlayVisible = false;
344 this.cd.markForCheck();
345 }
346 onClick(event) {
347 if (this.disabled) {
348 return;
349 }
350 if (!this.overlayEl || !this.overlayEl || !this.overlayEl.contains(event.target)) {
351 if (this.overlayVisible) {
352 this.hide();
353 }
354 else {
355 this.show();
356 }
357 this.focusInputEl.nativeElement.focus();
358 }
359 }
360 onFocus() {
361 this.focused = true;
362 }
363 onBlur() {
364 this.focused = false;
365 }
366 onOverlayClick(event) {
367 this.overlayService.add({
368 originalEvent: event,
369 target: this.el.nativeElement
370 });
371 }
372 onOverlayAnimationStart(event) {
373 switch (event.toState) {
374 case 'visible':
375 this.overlayEl = event.element;
376 this.onOverlayEnter();
377 break;
378 }
379 }
380 onOverlayAnimationDone(event) {
381 switch (event.toState) {
382 case 'void':
383 this.onOverlayLeave();
384 break;
385 }
386 }
387 onOverlayEnter() {
388 ZIndexUtils.set('overlay', this.overlayEl, this.config.zIndex.overlay);
389 this.appendContainer();
390 this.alignOverlay();
391 this.bindOutsideClickListener();
392 this.bindScrollListener();
393 this.bindResizeListener();
394 this.onShow.emit();
395 }
396 onOverlayLeave() {
397 this.unbindOutsideClickListener();
398 this.unbindScrollListener();
399 this.unbindResizeListener();
400 this.onHide.emit();
401 ZIndexUtils.clear(this.overlayEl);
402 this.overlayEl = null;
403 this.dirty = false;
404 }
405 writeValue(value) {
406 this.value = value;
407 this.updateSelectionPath();
408 this.cd.markForCheck();
409 }
410 registerOnChange(fn) {
411 this.onModelChange = fn;
412 }
413 registerOnTouched(fn) {
414 this.onModelTouched = fn;
415 }
416 setDisabledState(val) {
417 this.disabled = val;
418 this.cd.markForCheck();
419 }
420 alignOverlay() {
421 if (this.appendTo) {
422 DomHandler.absolutePosition(this.overlayEl, this.containerEl.nativeElement);
423 this.overlayEl.style.minWidth = DomHandler.getOuterWidth(this.containerEl.nativeElement) + 'px';
424 }
425 else {
426 DomHandler.relativePosition(this.overlayEl, this.containerEl.nativeElement);
427 }
428 }
429 bindOutsideClickListener() {
430 if (!this.outsideClickListener) {
431 this.outsideClickListener = (event) => {
432 if (this.overlayVisible && this.overlayEl && !this.containerEl.nativeElement.contains(event.target) && !this.overlayEl.contains(event.target)) {
433 this.hide();
434 }
435 };
436 document.addEventListener('click', this.outsideClickListener);
437 }
438 }
439 unbindOutsideClickListener() {
440 if (this.outsideClickListener) {
441 document.removeEventListener('click', this.outsideClickListener);
442 this.outsideClickListener = null;
443 }
444 }
445 bindScrollListener() {
446 if (!this.scrollHandler) {
447 this.scrollHandler = new ConnectedOverlayScrollHandler(this.containerEl.nativeElement, () => {
448 if (this.overlayVisible) {
449 this.hide();
450 }
451 });
452 }
453 this.scrollHandler.bindScrollListener();
454 }
455 unbindScrollListener() {
456 if (this.scrollHandler) {
457 this.scrollHandler.unbindScrollListener();
458 }
459 }
460 bindResizeListener() {
461 if (!this.resizeListener) {
462 this.resizeListener = () => {
463 if (this.overlayVisible) {
464 this.hide();
465 }
466 };
467 window.addEventListener('resize', this.resizeListener);
468 }
469 }
470 unbindResizeListener() {
471 if (this.resizeListener) {
472 window.removeEventListener('resize', this.resizeListener);
473 this.resizeListener = null;
474 }
475 }
476 appendContainer() {
477 if (this.appendTo) {
478 if (this.appendTo === 'body')
479 document.body.appendChild(this.overlayEl);
480 else
481 document.getElementById(this.appendTo).appendChild(this.overlayEl);
482 }
483 }
484 restoreAppend() {
485 if (this.overlayEl && this.appendTo) {
486 if (this.appendTo === 'body')
487 document.body.removeChild(this.overlayEl);
488 else
489 document.getElementById(this.appendTo).removeChild(this.overlayEl);
490 }
491 }
492 label() {
493 if (this.selectionPath)
494 return this.getOptionLabel(this.selectionPath[this.selectionPath.length - 1]);
495 else
496 return this.placeholder || 'p-emptylabel';
497 }
498 onKeyDown(event) {
499 switch (event.code) {
500 case 'Down':
501 case 'ArrowDown':
502 if (this.overlayVisible) {
503 DomHandler.findSingle(this.overlayEl, '.p-cascadeselect-item').children[0].focus();
504 }
505 else if (event.altKey && this.options && this.options.length) {
506 this.show();
507 }
508 event.preventDefault();
509 break;
510 case 'Space':
511 case 'Enter':
512 if (!this.overlayVisible)
513 this.show();
514 else
515 this.hide();
516 event.preventDefault();
517 break;
518 case 'Tab':
519 case 'Escape':
520 if (this.overlayVisible) {
521 this.hide();
522 event.preventDefault();
523 }
524 break;
525 }
526 }
527 containerClass() {
528 return {
529 'p-cascadeselect p-component p-inputwrapper': true,
530 'p-disabled': this.disabled,
531 'p-focus': this.focused
532 };
533 }
534 labelClass() {
535 return {
536 'p-cascadeselect-label': true,
537 'p-placeholder': this.label() === this.placeholder,
538 'p-cascadeselect-label-empty': !this.value && (this.label() === 'p-emptylabel' || this.label().length === 0)
539 };
540 }
541 ngOnDestroy() {
542 this.restoreAppend();
543 this.unbindOutsideClickListener();
544 this.unbindResizeListener();
545 if (this.scrollHandler) {
546 this.scrollHandler.destroy();
547 this.scrollHandler = null;
548 }
549 this.overlayEl = null;
550 }
551}
552CascadeSelect.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CascadeSelect, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i3.PrimeNGConfig }, { token: i3.OverlayService }], target: i0.ɵɵFactoryTarget.Component });
553CascadeSelect.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: CascadeSelect, selector: "p-cascadeSelect", inputs: { styleClass: "styleClass", style: "style", options: "options", optionLabel: "optionLabel", optionValue: "optionValue", optionGroupLabel: "optionGroupLabel", optionGroupChildren: "optionGroupChildren", placeholder: "placeholder", value: "value", dataKey: "dataKey", inputId: "inputId", tabindex: "tabindex", ariaLabelledBy: "ariaLabelledBy", appendTo: "appendTo", disabled: "disabled", rounded: "rounded", showTransitionOptions: "showTransitionOptions", hideTransitionOptions: "hideTransitionOptions" }, outputs: { onChange: "onChange", onGroupChange: "onGroupChange", onShow: "onShow", onHide: "onHide", onBeforeShow: "onBeforeShow", onBeforeHide: "onBeforeHide" }, host: { properties: { "class.p-inputwrapper-filled": "filled", "class.p-inputwrapper-focus": "focused || overlayVisible" }, classAttribute: "p-element p-inputwrapper" }, providers: [CASCADESELECT_VALUE_ACCESSOR], queries: [{ propertyName: "templates", predicate: PrimeTemplate }], viewQueries: [{ propertyName: "focusInputEl", first: true, predicate: ["focusInput"], descendants: true }, { propertyName: "containerEl", first: true, predicate: ["container"], descendants: true }], ngImport: i0, template: `
554 <div #container [ngClass]="containerClass()" [class]="styleClass" [ngStyle]="style" (click)="onClick($event)">
555 <div class="p-hidden-accessible">
556 <input #focusInput type="text" [attr.id]="inputId" readonly [disabled]="disabled" (focus)="onFocus()" (blur)="onBlur()" (keydown)="onKeyDown($event)" [attr.tabindex]="tabindex"
557 aria-haspopup="listbox" [attr.aria-expanded]="overlayVisible" [attr.aria-labelledby]="ariaLabelledBy">
558 </div>
559 <span [ngClass]="labelClass()">
560 <ng-container *ngIf="valueTemplate;else defaultValueTemplate">
561 <ng-container *ngTemplateOutlet="valueTemplate; context: {$implicit: value, placeholder: placeholder}"></ng-container>
562 </ng-container>
563 <ng-template #defaultValueTemplate>
564 {{label()}}
565 </ng-template>
566 </span>
567 <div class="p-cascadeselect-trigger" role="button" aria-haspopup="listbox" [attr.aria-expanded]="overlayVisible">
568 <span class="p-cascadeselect-trigger-icon pi pi-chevron-down"></span>
569 </div>
570 <div class="p-cascadeselect-panel p-component" *ngIf="overlayVisible" (click)="onOverlayClick($event)"
571 [@overlayAnimation]="{value: 'visible', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}" (@overlayAnimation.start)="onOverlayAnimationStart($event)" (@overlayAnimation.done)="onOverlayAnimationDone($event)">
572 <div class="p-cascadeselect-items-wrapper">
573 <p-cascadeSelectSub [options]="options" [selectionPath]="selectionPath" class="p-cascadeselect-items"
574 [optionLabel]="optionLabel" [optionValue]="optionValue" [level]="0" [optionTemplate]="optionTemplate"
575 [optionGroupLabel]="optionGroupLabel" [optionGroupChildren]="optionGroupChildren"
576 (onSelect)="onOptionSelect($event)" (onGroupSelect)="onOptionGroupSelect($event)" [dirty]="dirty" [root]="true">
577 </p-cascadeSelectSub>
578 </div>
579 </div>
580 </div>
581 `, isInline: true, styles: [".p-cascadeselect{display:inline-flex;cursor:pointer;position:relative;-webkit-user-select:none;-ms-user-select:none;user-select:none}.p-cascadeselect-trigger{display:flex;align-items:center;justify-content:center;flex-shrink:0}.p-cascadeselect-label{display:block;white-space:nowrap;overflow:hidden;flex:1 1 auto;width:1%;text-overflow:ellipsis;cursor:pointer}.p-cascadeselect-label-empty{overflow:hidden;visibility:hidden}.p-cascadeselect .p-cascadeselect-panel{min-width:100%}.p-cascadeselect-panel{position:absolute;top:0;left:0}.p-cascadeselect-item{cursor:pointer;font-weight:normal;white-space:nowrap}.p-cascadeselect-item-content{display:flex;align-items:center;overflow:hidden;position:relative}.p-cascadeselect-group-icon{margin-left:auto}.p-cascadeselect-items{margin:0;padding:0;list-style-type:none}.p-fluid .p-cascadeselect{display:flex}.p-fluid .p-cascadeselect .p-cascadeselect-label{width:1%}.p-cascadeselect-sublist{position:absolute;min-width:100%;z-index:1;display:none}.p-cascadeselect-item-active{overflow:visible!important}.p-cascadeselect-item-active>.p-cascadeselect-sublist{display:block;left:100%;top:0}\n"], components: [{ type: CascadeSelectSub, selector: "p-cascadeSelectSub", inputs: ["selectionPath", "options", "optionGroupChildren", "optionTemplate", "level", "optionLabel", "optionValue", "optionGroupLabel", "dirty", "root", "parentActive"], outputs: ["onSelect", "onGroupSelect"] }], 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"] }], animations: [
582 trigger('overlayAnimation', [
583 transition(':enter', [
584 style({ opacity: 0, transform: 'scaleY(0.8)' }),
585 animate('{{showTransitionParams}}')
586 ]),
587 transition(':leave', [
588 animate('{{hideTransitionParams}}', style({ opacity: 0 }))
589 ])
590 ])
591 ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
592i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CascadeSelect, decorators: [{
593 type: Component,
594 args: [{ selector: 'p-cascadeSelect', template: `
595 <div #container [ngClass]="containerClass()" [class]="styleClass" [ngStyle]="style" (click)="onClick($event)">
596 <div class="p-hidden-accessible">
597 <input #focusInput type="text" [attr.id]="inputId" readonly [disabled]="disabled" (focus)="onFocus()" (blur)="onBlur()" (keydown)="onKeyDown($event)" [attr.tabindex]="tabindex"
598 aria-haspopup="listbox" [attr.aria-expanded]="overlayVisible" [attr.aria-labelledby]="ariaLabelledBy">
599 </div>
600 <span [ngClass]="labelClass()">
601 <ng-container *ngIf="valueTemplate;else defaultValueTemplate">
602 <ng-container *ngTemplateOutlet="valueTemplate; context: {$implicit: value, placeholder: placeholder}"></ng-container>
603 </ng-container>
604 <ng-template #defaultValueTemplate>
605 {{label()}}
606 </ng-template>
607 </span>
608 <div class="p-cascadeselect-trigger" role="button" aria-haspopup="listbox" [attr.aria-expanded]="overlayVisible">
609 <span class="p-cascadeselect-trigger-icon pi pi-chevron-down"></span>
610 </div>
611 <div class="p-cascadeselect-panel p-component" *ngIf="overlayVisible" (click)="onOverlayClick($event)"
612 [@overlayAnimation]="{value: 'visible', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}" (@overlayAnimation.start)="onOverlayAnimationStart($event)" (@overlayAnimation.done)="onOverlayAnimationDone($event)">
613 <div class="p-cascadeselect-items-wrapper">
614 <p-cascadeSelectSub [options]="options" [selectionPath]="selectionPath" class="p-cascadeselect-items"
615 [optionLabel]="optionLabel" [optionValue]="optionValue" [level]="0" [optionTemplate]="optionTemplate"
616 [optionGroupLabel]="optionGroupLabel" [optionGroupChildren]="optionGroupChildren"
617 (onSelect)="onOptionSelect($event)" (onGroupSelect)="onOptionGroupSelect($event)" [dirty]="dirty" [root]="true">
618 </p-cascadeSelectSub>
619 </div>
620 </div>
621 </div>
622 `, animations: [
623 trigger('overlayAnimation', [
624 transition(':enter', [
625 style({ opacity: 0, transform: 'scaleY(0.8)' }),
626 animate('{{showTransitionParams}}')
627 ]),
628 transition(':leave', [
629 animate('{{hideTransitionParams}}', style({ opacity: 0 }))
630 ])
631 ])
632 ], host: {
633 'class': 'p-element p-inputwrapper',
634 '[class.p-inputwrapper-filled]': 'filled',
635 '[class.p-inputwrapper-focus]': 'focused || overlayVisible'
636 }, providers: [CASCADESELECT_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, styles: [".p-cascadeselect{display:inline-flex;cursor:pointer;position:relative;-webkit-user-select:none;-ms-user-select:none;user-select:none}.p-cascadeselect-trigger{display:flex;align-items:center;justify-content:center;flex-shrink:0}.p-cascadeselect-label{display:block;white-space:nowrap;overflow:hidden;flex:1 1 auto;width:1%;text-overflow:ellipsis;cursor:pointer}.p-cascadeselect-label-empty{overflow:hidden;visibility:hidden}.p-cascadeselect .p-cascadeselect-panel{min-width:100%}.p-cascadeselect-panel{position:absolute;top:0;left:0}.p-cascadeselect-item{cursor:pointer;font-weight:normal;white-space:nowrap}.p-cascadeselect-item-content{display:flex;align-items:center;overflow:hidden;position:relative}.p-cascadeselect-group-icon{margin-left:auto}.p-cascadeselect-items{margin:0;padding:0;list-style-type:none}.p-fluid .p-cascadeselect{display:flex}.p-fluid .p-cascadeselect .p-cascadeselect-label{width:1%}.p-cascadeselect-sublist{position:absolute;min-width:100%;z-index:1;display:none}.p-cascadeselect-item-active{overflow:visible!important}.p-cascadeselect-item-active>.p-cascadeselect-sublist{display:block;left:100%;top:0}\n"] }]
637 }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i3.PrimeNGConfig }, { type: i3.OverlayService }]; }, propDecorators: { styleClass: [{
638 type: Input
639 }], style: [{
640 type: Input
641 }], options: [{
642 type: Input
643 }], optionLabel: [{
644 type: Input
645 }], optionValue: [{
646 type: Input
647 }], optionGroupLabel: [{
648 type: Input
649 }], optionGroupChildren: [{
650 type: Input
651 }], placeholder: [{
652 type: Input
653 }], value: [{
654 type: Input
655 }], dataKey: [{
656 type: Input
657 }], inputId: [{
658 type: Input
659 }], tabindex: [{
660 type: Input
661 }], ariaLabelledBy: [{
662 type: Input
663 }], appendTo: [{
664 type: Input
665 }], disabled: [{
666 type: Input
667 }], rounded: [{
668 type: Input
669 }], showTransitionOptions: [{
670 type: Input
671 }], hideTransitionOptions: [{
672 type: Input
673 }], focusInputEl: [{
674 type: ViewChild,
675 args: ['focusInput']
676 }], containerEl: [{
677 type: ViewChild,
678 args: ['container']
679 }], onChange: [{
680 type: Output
681 }], onGroupChange: [{
682 type: Output
683 }], onShow: [{
684 type: Output
685 }], onHide: [{
686 type: Output
687 }], onBeforeShow: [{
688 type: Output
689 }], onBeforeHide: [{
690 type: Output
691 }], templates: [{
692 type: ContentChildren,
693 args: [PrimeTemplate]
694 }] } });
695class CascadeSelectModule {
696}
697CascadeSelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CascadeSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
698CascadeSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CascadeSelectModule, declarations: [CascadeSelect, CascadeSelectSub], imports: [CommonModule, SharedModule, RippleModule], exports: [CascadeSelect, CascadeSelectSub, SharedModule] });
699CascadeSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CascadeSelectModule, imports: [[CommonModule, SharedModule, RippleModule], SharedModule] });
700i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CascadeSelectModule, decorators: [{
701 type: NgModule,
702 args: [{
703 imports: [CommonModule, SharedModule, RippleModule],
704 exports: [CascadeSelect, CascadeSelectSub, SharedModule],
705 declarations: [CascadeSelect, CascadeSelectSub]
706 }]
707 }] });
708
709/**
710 * Generated bundle index. Do not edit.
711 */
712
713export { CASCADESELECT_VALUE_ACCESSOR, CascadeSelect, CascadeSelectModule, CascadeSelectSub };
Note: See TracBrowser for help on using the repository browser.