1
1
import {
2
2
Component ,
3
3
ViewEncapsulation ,
4
- ElementRef ,
5
4
ChangeDetectionStrategy ,
6
5
HostBinding ,
7
- Renderer2 ,
8
6
} from '@angular/core' ;
9
7
10
- import { DaffCompactableDirective } from '@daffodil/design' ;
8
+ import {
9
+ DaffColorableDirective ,
10
+ DaffCompactableDirective ,
11
+ } from '@daffodil/design' ;
11
12
import {
12
13
DaffArticleEncapsulatedDirective ,
13
- DaffColorable ,
14
- daffColorMixin ,
15
14
DaffManageContainerLayoutDirective ,
16
15
DaffTextAlignableDirective ,
17
16
} from '@daffodil/design' ;
18
17
19
- /**
20
- * An _elementRef and an instance of renderer2 are needed for the Colorable mixin
21
- */
22
- class DaffCalloutBase {
23
- constructor ( public _elementRef : ElementRef , public _renderer : Renderer2 ) { }
24
- }
25
-
26
- const _daffCalloutBase = daffColorMixin ( DaffCalloutBase ) ;
27
-
28
18
/**
29
19
* @inheritdoc
30
20
*/
@@ -33,9 +23,6 @@ const _daffCalloutBase = daffColorMixin(DaffCalloutBase);
33
23
template : '<ng-content></ng-content>' ,
34
24
styleUrls : [ './callout.component.scss' ] ,
35
25
encapsulation : ViewEncapsulation . None ,
36
- //todo(damienwebdev): remove once decorators hit stage 3 - https://github.com/microsoft/TypeScript/issues/7342
37
- // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
38
- inputs : [ 'color' ] ,
39
26
hostDirectives : [
40
27
{ directive : DaffArticleEncapsulatedDirective } ,
41
28
{ directive : DaffManageContainerLayoutDirective } ,
@@ -47,17 +34,15 @@ const _daffCalloutBase = daffColorMixin(DaffCalloutBase);
47
34
directive : DaffCompactableDirective ,
48
35
inputs : [ 'compact' ] ,
49
36
} ,
37
+ {
38
+ directive : DaffColorableDirective ,
39
+ inputs : [ 'color' ] ,
40
+ } ,
50
41
] ,
51
42
changeDetection : ChangeDetectionStrategy . OnPush ,
52
43
} )
53
- export class DaffCalloutComponent extends _daffCalloutBase implements DaffColorable {
54
- constructor (
55
- private elementRef : ElementRef ,
56
- private renderer : Renderer2 ,
57
- private textAlignable : DaffTextAlignableDirective ,
58
- ) {
59
- super ( elementRef , renderer ) ;
60
-
44
+ export class DaffCalloutComponent {
45
+ constructor ( private textAlignable : DaffTextAlignableDirective ) {
61
46
this . textAlignable . textAlignment = 'left' ;
62
47
}
63
48
0 commit comments