|
5 | 5 |
|
6 | 6 | <div class="po-tag-sub-container"> |
7 | 7 | <div |
8 | | - #poTag |
9 | | - class="po-tag" |
10 | | - [attr.role]="isClickable && !disabled ? 'button' : ''" |
| 8 | + #poTagWrapper |
| 9 | + class="po-tag-wrapper" |
11 | 10 | [class.po-clickable]="isClickable && !disabled && !removable" |
12 | | - [class.po-tag-inverse]="inverse && !type && !customTextColor && !removable" |
13 | | - [class.po-tag-removable]="removable" |
14 | | - [class.po-tag-disabled]="disabled && removable" |
15 | | - [ngClass]="tagColor" |
16 | | - [ngStyle]="styleTag()" |
17 | | - [tabindex]="isClickable && !removable ? 0 : -1" |
18 | | - (click)="onClick()" |
| 11 | + [attr.role]="isClickable && !disabled && !removable ? 'button' : ''" |
19 | 12 | (keydown.enter)="onKeyPressed($event)" |
20 | 13 | (keydown.space)="$event.preventDefault()" |
21 | 14 | (keyup.space)="onKeyPressed($event)" |
| 15 | + (click)="onClick()" |
| 16 | + [tabindex]="isClickable && !removable ? 0 : -1" |
22 | 17 | > |
23 | | - <po-icon |
24 | | - *ngIf="icon && !removable" |
25 | | - class="po-tag-icon" |
26 | | - [p-icon]="!type ? icon : iconFromType" |
27 | | - [ngStyle]=" |
28 | | - !tagColor && inverse && !customTextColor |
29 | | - ? { 'color': customColor } |
30 | | - : !type && customTextColor |
31 | | - ? { 'color': customTextColor } |
32 | | - : '' |
33 | | - " |
| 18 | + <div |
| 19 | + #poTag |
| 20 | + class="po-tag" |
| 21 | + [class.po-clickable]="isClickable && !disabled && !removable" |
| 22 | + [class.po-tag-inverse]="inverse && !type && !customTextColor && !removable" |
| 23 | + [class.po-tag-removable]="removable" |
| 24 | + [class.po-tag-disabled]="disabled && removable" |
| 25 | + [ngClass]="tagColor" |
| 26 | + [ngStyle]="styleTag()" |
34 | 27 | > |
35 | | - </po-icon> |
36 | | - |
37 | | - <div #tagContainer class="po-tag-value" [p-tooltip]="getWidthTag() ? value : ''" p-tooltip-position="top"> |
38 | | - <span |
| 28 | + <po-icon |
| 29 | + *ngIf="icon && !removable" |
| 30 | + class="po-tag-icon" |
| 31 | + [p-icon]="!type ? icon : iconFromType" |
39 | 32 | [ngStyle]=" |
40 | 33 | !tagColor && inverse && !customTextColor |
41 | 34 | ? { 'color': customColor } |
42 | | - : !type && customTextColor && !removable |
| 35 | + : !type && customTextColor |
43 | 36 | ? { 'color': customTextColor } |
44 | 37 | : '' |
45 | 38 | " |
46 | | - >{{ value }}</span |
47 | 39 | > |
48 | | - </div> |
| 40 | + </po-icon> |
49 | 41 |
|
50 | | - <span |
51 | | - #tagClose |
52 | | - *ngIf="removable" |
53 | | - p-tooltip-position="top" |
54 | | - [p-tooltip]="literals.remove" |
55 | | - [attr.aria-label]="setAriaLabel()" |
56 | | - class="po-tag-remove po-icon po-icon-close" |
57 | | - [class.po-clickable]="!disabled" |
58 | | - [tabindex]="!disabled ? 0 : -1" |
59 | | - [attr.role]="!disabled ? 'button' : ''" |
60 | | - (click)="onClose()" |
61 | | - (keydown.enter)="onClose('enter')" |
62 | | - > |
63 | | - </span> |
| 42 | + <div #tagContainer class="po-tag-value" [p-tooltip]="getWidthTag() ? value : ''" p-tooltip-position="top"> |
| 43 | + <span |
| 44 | + [ngStyle]=" |
| 45 | + !tagColor && inverse && !customTextColor |
| 46 | + ? { 'color': customColor } |
| 47 | + : !type && customTextColor && !removable |
| 48 | + ? { 'color': customTextColor } |
| 49 | + : '' |
| 50 | + " |
| 51 | + >{{ value }}</span |
| 52 | + > |
| 53 | + </div> |
| 54 | + |
| 55 | + <span |
| 56 | + #tagClose |
| 57 | + *ngIf="removable" |
| 58 | + p-tooltip-position="top" |
| 59 | + [p-tooltip]="literals.remove" |
| 60 | + [attr.aria-label]="setAriaLabel()" |
| 61 | + class="po-tag-remove po-icon po-icon-close" |
| 62 | + [class.po-clickable]="!disabled" |
| 63 | + [tabindex]="!disabled ? 0 : -1" |
| 64 | + [attr.role]="!disabled ? 'button' : ''" |
| 65 | + (click)="onClose()" |
| 66 | + (keydown.enter)="onClose('enter')" |
| 67 | + > |
| 68 | + </span> |
| 69 | + </div> |
64 | 70 | </div> |
65 | 71 | </div> |
66 | 72 | </div> |
0 commit comments