@@ -16,58 +16,69 @@ import {
16
16
} from '@angular/core' ;
17
17
18
18
@Component ( {
19
- selector : 'aui-table-cell[expand ]' ,
19
+ selector : 'aui-table-cell[auiExpandButton ]' ,
20
20
template : `
21
- <ng-container *ngIf="!template">
22
- <button
23
- type="button"
24
- (click)="expandChange.next()"
25
- class="aui-table__cell-expand-button"
26
- [class.expanded]="expand"
27
- [class.collapsed]="!expand"
28
- [disabled]="disabled"
29
- aui-button="primary"
30
- size="mini"
31
- [square]="true"
32
- [round]="true"
33
- >
34
- <aui-icon [icon]="expand ? 'angle_down' : 'angle_right'"></aui-icon>
35
- </button>
36
- </ng-container>
21
+ <button
22
+ type="button"
23
+ class="aui-expand-button"
24
+ [class.isExpanded]="expand"
25
+ [disabled]="disabled"
26
+ (click)="expandChange.next()"
27
+ >
28
+ <aui-icon icon="angle_right"></aui-icon>
29
+ </button>
30
+ ` ,
31
+ changeDetection : ChangeDetectionStrategy . OnPush ,
32
+ encapsulation : ViewEncapsulation . None ,
33
+ preserveWhitespaces : false ,
34
+ } )
35
+ export class TableExpandButtonCellComponent extends CdkCell {
36
+ @Input ( )
37
+ expand = false ;
38
+
39
+ @Input ( )
40
+ disabled = false ;
41
+
42
+ @Output ( )
43
+ expandChange = new EventEmitter ( ) ;
37
44
38
- <ng-container *ngIf="expand && template">
39
- <div class="aui-table__cell-expand-detail" [@expand]="expanded">
45
+ get expanded ( ) {
46
+ return this . expand ? 'expanded' : null ;
47
+ }
48
+ }
49
+ @Component ( {
50
+ selector : 'aui-table-cell[auiExpandPanel]' ,
51
+ template : `
52
+ <div
53
+ *ngIf="expand"
54
+ class="aui-table__cell-expand-panel"
55
+ [@expand]="expanded"
56
+ >
57
+ <div
58
+ class="aui-table__cell-expand-panel-content"
59
+ [class.hasBackground]="background"
60
+ >
40
61
<ng-content></ng-content>
41
62
</div>
42
- </ng-container >
63
+ </div >
43
64
` ,
44
65
changeDetection : ChangeDetectionStrategy . OnPush ,
45
66
encapsulation : ViewEncapsulation . None ,
46
- exportAs : 'auiTableCell' ,
47
67
preserveWhitespaces : false ,
48
68
animations : [
49
69
trigger ( 'expand' , [
50
- state ( '*' , style ( { height : 0 , padding : '0 16px' } ) ) ,
51
- state (
52
- 'expanded' ,
53
- style ( { height : '*' , 'margin-bottom' : '15px' , padding : '16px' } ) ,
54
- ) ,
55
- transition ( '* <=> expanded' , [ animate ( 250 ) ] ) ,
70
+ state ( '*' , style ( { height : 0 } ) ) ,
71
+ state ( 'expanded' , style ( { height : '*' , 'margin-bottom' : '16px' } ) ) ,
72
+ transition ( '* <=> expanded' , [ animate ( '0.1s ease-in-out' ) ] ) ,
56
73
] ) ,
57
74
] ,
58
75
} )
59
- export class TableCellComponent extends CdkCell {
76
+ export class TableExpandPanelCellComponent extends CdkCell {
60
77
@Input ( )
61
78
expand = false ;
62
79
63
80
@Input ( )
64
- disabled = false ;
65
-
66
- @Input ( )
67
- template : boolean ;
68
-
69
- @Output ( )
70
- expandChange = new EventEmitter ( ) ;
81
+ background = true ;
71
82
72
83
get expanded ( ) {
73
84
return this . expand ? 'expanded' : null ;
0 commit comments