|
1 | | -<ng-container *ngIf="!_isEditing"> |
| 1 | +@if (!_isEditing) { |
2 | 2 | <span class="mat-mdc-chip-focus-overlay"></span> |
3 | | -</ng-container> |
| 3 | +} |
4 | 4 |
|
5 | 5 | <span class="mdc-evolution-chip__cell mdc-evolution-chip__cell--primary" role="gridcell" |
6 | 6 | matChipAction |
7 | 7 | [tabIndex]="tabIndex" |
8 | 8 | [disabled]="disabled" |
9 | 9 | [attr.aria-label]="ariaLabel" |
10 | 10 | [attr.aria-describedby]="_ariaDescriptionId"> |
11 | | - <span class="mdc-evolution-chip__graphic mat-mdc-chip-graphic" *ngIf="leadingIcon"> |
12 | | - <ng-content select="mat-chip-avatar, [matChipAvatar]"></ng-content> |
13 | | - </span> |
14 | | - <span class="mdc-evolution-chip__text-label mat-mdc-chip-action-label" [ngSwitch]="_isEditing"> |
15 | | - <ng-container *ngSwitchCase="false"><ng-content></ng-content></ng-container> |
| 11 | + @if (leadingIcon) { |
| 12 | + <span class="mdc-evolution-chip__graphic mat-mdc-chip-graphic"> |
| 13 | + <ng-content select="mat-chip-avatar, [matChipAvatar]"></ng-content> |
| 14 | + </span> |
| 15 | + } |
16 | 16 |
|
17 | | - <ng-container *ngSwitchCase="true"> |
18 | | - <ng-content *ngIf="contentEditInput; else defaultMatChipEditInput" |
19 | | - select="[matChipEditInput]"></ng-content> |
20 | | - <ng-template #defaultMatChipEditInput><span matChipEditInput></span></ng-template> |
21 | | - </ng-container> |
| 17 | + <span class="mdc-evolution-chip__text-label mat-mdc-chip-action-label"> |
| 18 | + @if (_isEditing) { |
| 19 | + @if (contentEditInput) { |
| 20 | + <ng-content select="[matChipEditInput]"></ng-content> |
| 21 | + } @else { |
| 22 | + <span matChipEditInput></span> |
| 23 | + } |
| 24 | + } @else { |
| 25 | + <ng-content></ng-content> |
| 26 | + } |
22 | 27 |
|
23 | 28 | <span class="mat-mdc-chip-primary-focus-indicator mat-mdc-focus-indicator" aria-hidden="true"></span> |
24 | 29 | </span> |
25 | 30 | </span> |
26 | 31 |
|
27 | | -<span |
28 | | - class="mdc-evolution-chip__cell mdc-evolution-chip__cell--trailing" |
29 | | - role="gridcell" |
30 | | - *ngIf="_hasTrailingIcon()"> |
31 | | - <ng-content select="mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"></ng-content> |
32 | | -</span> |
| 32 | +@if (_hasTrailingIcon()) { |
| 33 | + <span |
| 34 | + class="mdc-evolution-chip__cell mdc-evolution-chip__cell--trailing" |
| 35 | + role="gridcell"> |
| 36 | + <ng-content select="mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"></ng-content> |
| 37 | + </span> |
| 38 | +} |
33 | 39 |
|
34 | 40 | <span class="cdk-visually-hidden" [id]="_ariaDescriptionId">{{ariaDescription}}</span> |
0 commit comments