55
66import { NgTemplateOutlet } from '@angular/common' ;
77import {
8+ booleanAttribute ,
89 ChangeDetectionStrategy ,
910 Component ,
1011 EventEmitter ,
@@ -24,10 +25,10 @@ import { NzIconModule } from 'ng-zorro-antd/icon';
2425 changeDetection : ChangeDetectionStrategy . OnPush ,
2526 template : `
2627 <ng-container *nzStringTemplateOutlet="contentTemplateOutlet; context: templateOutletContext">
27- @if (deletable ) {
28- <div class=" ant-select-selection-item-content">{{ label }} </div>
28+ @if (displayLabelInHtml ) {
29+ <div [ class. ant-select-selection-item-content]="deletable" [innerHTML]=" label"> </div>
2930 } @else {
30- {{ label }}
31+ <div [class.ant-select-selection-item-content]="deletable"> {{ label }}</div>
3132 }
3233 </ng-container>
3334 @if (deletable && !disabled) {
@@ -48,9 +49,14 @@ import { NzIconModule } from 'ng-zorro-antd/icon';
4849 imports : [ NgTemplateOutlet , NzOutletModule , NzIconModule ]
4950} )
5051export class NzSelectItemComponent {
51- @Input ( ) disabled = false ;
52+ @Input ( { transform : booleanAttribute } ) disabled = false ;
5253 @Input ( ) label : string | number | null | undefined = null ;
53- @Input ( ) deletable = false ;
54+ /**
55+ * @internal Internally used, please do not use it directly.
56+ * @description Whether the label is in HTML format.
57+ */
58+ @Input ( { transform : booleanAttribute } ) displayLabelInHtml = false ;
59+ @Input ( { transform : booleanAttribute } ) deletable = false ;
5460 @Input ( ) removeIcon : TemplateRef < NzSafeAny > | null = null ;
5561 @Input ( ) contentTemplateOutletContext : NzSafeAny | null = null ;
5662 @Input ( ) contentTemplateOutlet : string | TemplateRef < NzSafeAny > | null = null ;
0 commit comments