-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(multiple): switch to built-in control flow (#27987)
Reworks the component internals to use the new built-in control flow instead of `ngIf`, `ngSwitch` and `ngFor`. This has the advantage of not requiring directives to be imported and instantiated. (cherry picked from commit e2d9cfa)
- Loading branch information
Showing
49 changed files
with
670 additions
and
562 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
<ng-container *ngIf="!_isEditing"> | ||
@if (!_isEditing) { | ||
<span class="mat-mdc-chip-focus-overlay"></span> | ||
</ng-container> | ||
} | ||
|
||
<span class="mdc-evolution-chip__cell mdc-evolution-chip__cell--primary" role="gridcell" | ||
matChipAction | ||
[tabIndex]="tabIndex" | ||
[disabled]="disabled" | ||
[attr.aria-label]="ariaLabel" | ||
[attr.aria-describedby]="_ariaDescriptionId"> | ||
<span class="mdc-evolution-chip__graphic mat-mdc-chip-graphic" *ngIf="leadingIcon"> | ||
<ng-content select="mat-chip-avatar, [matChipAvatar]"></ng-content> | ||
</span> | ||
<span class="mdc-evolution-chip__text-label mat-mdc-chip-action-label" [ngSwitch]="_isEditing"> | ||
<ng-container *ngSwitchCase="false"><ng-content></ng-content></ng-container> | ||
@if (leadingIcon) { | ||
<span class="mdc-evolution-chip__graphic mat-mdc-chip-graphic"> | ||
<ng-content select="mat-chip-avatar, [matChipAvatar]"></ng-content> | ||
</span> | ||
} | ||
|
||
<ng-container *ngSwitchCase="true"> | ||
<ng-content *ngIf="contentEditInput; else defaultMatChipEditInput" | ||
select="[matChipEditInput]"></ng-content> | ||
<ng-template #defaultMatChipEditInput><span matChipEditInput></span></ng-template> | ||
</ng-container> | ||
<span class="mdc-evolution-chip__text-label mat-mdc-chip-action-label"> | ||
@if (_isEditing) { | ||
@if (contentEditInput) { | ||
<ng-content select="[matChipEditInput]"></ng-content> | ||
} @else { | ||
<span matChipEditInput></span> | ||
} | ||
} @else { | ||
<ng-content></ng-content> | ||
} | ||
|
||
<span class="mat-mdc-chip-primary-focus-indicator mat-mdc-focus-indicator" aria-hidden="true"></span> | ||
</span> | ||
</span> | ||
|
||
<span | ||
class="mdc-evolution-chip__cell mdc-evolution-chip__cell--trailing" | ||
role="gridcell" | ||
*ngIf="_hasTrailingIcon()"> | ||
<ng-content select="mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"></ng-content> | ||
</span> | ||
@if (_hasTrailingIcon()) { | ||
<span | ||
class="mdc-evolution-chip__cell mdc-evolution-chip__cell--trailing" | ||
role="gridcell"> | ||
<ng-content select="mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"></ng-content> | ||
</span> | ||
} | ||
|
||
<span class="cdk-visually-hidden" [id]="_ariaDescriptionId">{{ariaDescription}}</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.