11import {
2+ booleanAttribute ,
23 ChangeDetectorRef ,
34 Component ,
45 ElementRef ,
56 EventEmitter ,
67 HostBinding ,
78 HostListener ,
89 Input ,
10+ numberAttribute ,
911 OnDestroy ,
1012 OnInit ,
1113 Output ,
1214 Renderer2
1315} from '@angular/core' ;
1416
1517import { animate , state , style , transition , trigger } from '@angular/animations' ;
16- import { BooleanInput , coerceBooleanProperty } from '@angular/cdk/coercion' ;
1718
1819import { Colors } from '../../coreui.types' ;
1920import { ToasterService } from '../toaster/toaster.service' ;
@@ -23,7 +24,7 @@ type AnimateType = ('hide' | 'show');
2324
2425@Component ( {
2526 selector : 'c-toast' ,
26- template : '<ng-content></ng-content >' ,
27+ template : '<ng-content / >' ,
2728 styleUrls : [ './toast.component.scss' ] ,
2829 exportAs : 'cToast' ,
2930 standalone : true ,
@@ -51,8 +52,6 @@ type AnimateType = ('hide' | 'show');
5152} )
5253export class ToastComponent implements OnInit , OnDestroy {
5354
54- static ngAcceptInputType_visible : BooleanInput ;
55-
5655 public dynamic ! : boolean ;
5756 public placement ! : TToasterPlacement ;
5857
@@ -79,7 +78,7 @@ export class ToastComponent implements OnInit, OnDestroy {
7978 * Delay hiding the toast (ms).
8079 * @type number
8180 */
82- @Input ( ) delay : number = 5000 ;
81+ @Input ( { transform : numberAttribute } ) delay : number = 5000 ;
8382
8483 /**
8584 * Apply fade transition to the toast.
@@ -91,9 +90,9 @@ export class ToastComponent implements OnInit, OnDestroy {
9190 * Toggle the visibility of component.
9291 * @type boolean
9392 */
94- @Input ( )
93+ @Input ( { transform : booleanAttribute } )
9594 set visible ( value : boolean ) {
96- const newValue = coerceBooleanProperty ( value ) ;
95+ const newValue = value ;
9796 if ( this . _visible !== newValue ) {
9897 this . _visible = newValue ;
9998 newValue ? this . setTimer ( ) : this . clearTimer ( ) ;
@@ -111,7 +110,7 @@ export class ToastComponent implements OnInit, OnDestroy {
111110 /**
112111 * @ignore
113112 */
114- @Input ( ) index ?: number ;
113+ @Input ( { transform : numberAttribute } ) index ?: number ;
115114
116115 /**
117116 * Event emitted on visibility change. [docs]
0 commit comments