|
1 | | -<po-field-container |
2 | | - [p-disabled]="disabled" |
3 | | - [p-id]="id" |
4 | | - [p-label]="label" |
5 | | - [p-optional]="optional" |
6 | | - [p-required]="required" |
7 | | - [p-show-required]="showRequired" |
8 | | -> |
9 | | - <div cdkOverlayOrigin #trigger="cdkOverlayOrigin" class="po-field-container-content po-combo-container-content"> |
10 | | - <div *ngIf="icon" class="po-field-icon-container-left"> |
11 | | - <po-icon class="po-field-icon po-icon-input" [class.po-field-icon-disabled]="disabled" [p-icon]="icon"></po-icon> |
12 | | - </div> |
| 1 | +<div #outerContainer> |
| 2 | + <po-field-container |
| 3 | + [p-disabled]="disabled" |
| 4 | + [p-id]="id" |
| 5 | + [p-label]="label" |
| 6 | + [p-optional]="optional" |
| 7 | + [p-required]="required" |
| 8 | + [p-show-required]="showRequired" |
| 9 | + > |
| 10 | + <div cdkOverlayOrigin #trigger="cdkOverlayOrigin" class="po-field-container-content po-combo-container-content"> |
| 11 | + <div *ngIf="icon" class="po-field-icon-container-left"> |
| 12 | + <po-icon |
| 13 | + class="po-field-icon po-icon-input" |
| 14 | + [class.po-field-icon-disabled]="disabled" |
| 15 | + [p-icon]="icon" |
| 16 | + ></po-icon> |
| 17 | + </div> |
13 | 18 |
|
14 | | - <input |
15 | | - #inp |
16 | | - class="po-combo-input" |
17 | | - [ngClass]="clean && inp.value ? 'po-input-double-icon-right' : 'po-input-icon-right'" |
18 | | - [class.po-input-icon-left]="icon" |
19 | | - autocomplete="off" |
20 | | - type="text" |
21 | | - [attr.name]="name" |
22 | | - [disabled]="disabled" |
23 | | - [id]="id" |
24 | | - [placeholder]="disabled ? '' : placeholder" |
25 | | - [required]="required" |
26 | | - (click)="toggleComboVisibility()" |
27 | | - (keyup)="onKeyUp($event)" |
28 | | - (blur)="onBlur()" |
29 | | - (keyup)="searchOnEnterOrArrow($event, $event.target.value)" |
30 | | - (keydown)="onKeyDown($event)" |
31 | | - /> |
| 19 | + <input |
| 20 | + #inp |
| 21 | + class="po-combo-input" |
| 22 | + [ngClass]="clean && inp.value ? 'po-input-double-icon-right' : 'po-input-icon-right'" |
| 23 | + [class.po-input-icon-left]="icon" |
| 24 | + autocomplete="off" |
| 25 | + type="text" |
| 26 | + [attr.name]="name" |
| 27 | + [disabled]="disabled" |
| 28 | + [id]="id" |
| 29 | + [placeholder]="disabled ? '' : placeholder" |
| 30 | + [required]="required" |
| 31 | + (click)="toggleComboVisibility()" |
| 32 | + (keyup)="onKeyUp($event)" |
| 33 | + (blur)="onBlur()" |
| 34 | + (keyup)="searchOnEnterOrArrow($event, $event.target.value)" |
| 35 | + (keydown)="onKeyDown($event)" |
| 36 | + /> |
32 | 37 |
|
33 | | - <div class="po-field-icon-container-right"> |
34 | | - <po-clean |
35 | | - tabindex="0" |
36 | | - role="button" |
37 | | - [attr.aria-label]="literals.clean" |
38 | | - class="po-combo-clean po-icon-input" |
39 | | - *ngIf="clean && !disabled && inp.value" |
40 | | - [p-element-ref]="inputEl" |
41 | | - (p-change-event)="clear($event)" |
42 | | - (click)="clear(null); $event.preventDefault()" |
43 | | - (keydown.enter)="clearAndFocus(); $event.preventDefault()" |
44 | | - > |
45 | | - </po-clean> |
| 38 | + <div class="po-field-icon-container-right"> |
| 39 | + <po-clean |
| 40 | + tabindex="0" |
| 41 | + role="button" |
| 42 | + [attr.aria-label]="literals.clean" |
| 43 | + class="po-combo-clean po-icon-input" |
| 44 | + *ngIf="clean && !disabled && inp.value" |
| 45 | + [p-element-ref]="inputEl" |
| 46 | + (p-change-event)="clear($event)" |
| 47 | + (click)="clear(null); $event.preventDefault()" |
| 48 | + (keydown.enter)="clearAndFocus(); $event.preventDefault()" |
| 49 | + > |
| 50 | + </po-clean> |
46 | 51 |
|
47 | | - <div |
48 | | - #iconArrow |
49 | | - class="po-combo-arrow po-field-icon" |
50 | | - [class.po-field-icon-disabled]="disabled" |
51 | | - (click)="toggleComboVisibility(true)" |
52 | | - > |
53 | | - <po-icon |
54 | | - [p-icon]="comboOpen ? 'ICON_ARROW_UP po-icon-input' : 'ICON_ARROW_DOWN po-icon-input'" |
55 | | - [class.po-field-icon]="!disabled" |
56 | | - [class.po-combo-default-border]="!disabled && inp.value" |
57 | | - [class.po-combo-background-arrow-up]="!disabled && comboOpen" |
58 | | - ></po-icon> |
| 52 | + <div |
| 53 | + #iconArrow |
| 54 | + class="po-combo-arrow po-field-icon" |
| 55 | + [class.po-field-icon-disabled]="disabled" |
| 56 | + (click)="toggleComboVisibility(true)" |
| 57 | + > |
| 58 | + <po-icon |
| 59 | + [p-icon]="comboOpen ? 'ICON_ARROW_UP po-icon-input' : 'ICON_ARROW_DOWN po-icon-input'" |
| 60 | + [class.po-field-icon]="!disabled" |
| 61 | + [class.po-combo-default-border]="!disabled && inp.value" |
| 62 | + [class.po-combo-background-arrow-up]="!disabled && comboOpen" |
| 63 | + ></po-icon> |
| 64 | + </div> |
59 | 65 | </div> |
60 | 66 | </div> |
61 | | - </div> |
62 | 67 |
|
63 | | - <ng-container *ngIf="appendBox; then dropdownCDK; else dropdownDefault"> </ng-container> |
| 68 | + <ng-container *ngIf="appendBox; then dropdownCDK; else dropdownDefault"> </ng-container> |
64 | 69 |
|
65 | | - <ng-template #dropdownDefault> |
66 | | - <ng-container *ngTemplateOutlet="dropdownListbox"> </ng-container> |
67 | | - </ng-template> |
| 70 | + <ng-template #dropdownDefault> |
| 71 | + <ng-container *ngTemplateOutlet="dropdownListbox"> </ng-container> |
| 72 | + </ng-template> |
68 | 73 |
|
69 | | - <ng-template #dropdownCDK> |
70 | | - <ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]="trigger" [cdkConnectedOverlayOpen]="true"> |
71 | | - <ng-container *ngTemplateOutlet="dropdownListbox"></ng-container> |
| 74 | + <ng-template #dropdownCDK> |
| 75 | + <ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]="trigger" [cdkConnectedOverlayOpen]="true"> |
| 76 | + <ng-container *ngTemplateOutlet="dropdownListbox"></ng-container> |
| 77 | + </ng-template> |
72 | 78 | </ng-template> |
73 | | - </ng-template> |
74 | 79 |
|
75 | | - <po-field-container-bottom [p-help]="help" [p-disabled]="disabled"></po-field-container-bottom> |
76 | | -</po-field-container> |
| 80 | + <po-field-container-bottom [p-help]="help" [p-disabled]="disabled"></po-field-container-bottom> |
| 81 | + </po-field-container> |
77 | 82 |
|
78 | | -<ng-template #dropdownListbox> |
79 | | - <div #containerElement class="po-combo-container" [hidden]="!comboOpen && !isServerSearching"> |
80 | | - <po-listbox |
81 | | - #poListbox |
82 | | - #contentElement |
83 | | - p-type="option" |
84 | | - [p-items]="visibleOptions" |
85 | | - [p-field-value]="dynamicValue" |
86 | | - [p-field-label]="dynamicLabel" |
87 | | - [p-template]="comboOptionTemplate" |
88 | | - [p-search-value]="getInputValue()" |
89 | | - [p-infinite-loading]="infiniteLoading" |
90 | | - [p-infinite-scroll]="infiniteScroll" |
91 | | - [p-filtering]="isFiltering" |
92 | | - [p-cache]="cache" |
93 | | - (p-selectcombo-item)="onOptionClick($event, $event.event)" |
94 | | - [p-filter-mode]="filterMode" |
95 | | - [p-visible]="comboOpen" |
96 | | - [p-is-searching]="isServerSearching" |
97 | | - [p-should-mark-letter]="shouldMarkLetters" |
98 | | - [p-compare-cache]="compareObjects(cacheOptions, visibleOptions)" |
99 | | - [p-combo-service]="service" |
100 | | - [p-infinite-scroll-distance]="infiniteScrollDistance" |
101 | | - (p-update-infinite-scroll)="showMoreInfiniteScroll()" |
102 | | - (p-close)="onCloseCombo()" |
103 | | - ></po-listbox> |
104 | | - </div> |
105 | | -</ng-template> |
| 83 | + <ng-template #dropdownListbox> |
| 84 | + <div #containerElement class="po-combo-container" [hidden]="!comboOpen && !isServerSearching"> |
| 85 | + <po-listbox |
| 86 | + #poListbox |
| 87 | + #contentElement |
| 88 | + p-type="option" |
| 89 | + [p-items]="visibleOptions" |
| 90 | + [p-field-value]="dynamicValue" |
| 91 | + [p-field-label]="dynamicLabel" |
| 92 | + [p-template]="comboOptionTemplate" |
| 93 | + [p-search-value]="getInputValue()" |
| 94 | + [p-infinite-loading]="infiniteLoading" |
| 95 | + [p-infinite-scroll]="infiniteScroll" |
| 96 | + [p-filtering]="isFiltering" |
| 97 | + [p-cache]="cache" |
| 98 | + (p-selectcombo-item)="onOptionClick($event, $event.event)" |
| 99 | + [p-filter-mode]="filterMode" |
| 100 | + [p-visible]="comboOpen" |
| 101 | + [p-is-searching]="isServerSearching" |
| 102 | + [p-should-mark-letter]="shouldMarkLetters" |
| 103 | + [p-compare-cache]="compareObjects(cacheOptions, visibleOptions)" |
| 104 | + [p-combo-service]="service" |
| 105 | + [p-infinite-scroll-distance]="infiniteScrollDistance" |
| 106 | + (p-update-infinite-scroll)="showMoreInfiniteScroll()" |
| 107 | + (p-close)="onCloseCombo()" |
| 108 | + [p-container-width]="containerWidth" |
| 109 | + ></po-listbox> |
| 110 | + </div> |
| 111 | + </ng-template> |
| 112 | +</div> |
0 commit comments