@@ -22,6 +22,7 @@ import { DataTableModule } from '../../datatable.module';
22
22
import { RouterTestingModule } from '@angular/router/testing' ;
23
23
import { BrowserAnimationsModule } from '@angular/platform-browser/animations' ;
24
24
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner' ;
25
+ import { mockPathInfos } from '../mocks/datatable.mock' ;
25
26
26
27
export default {
27
28
component : DataTableComponent ,
@@ -67,88 +68,63 @@ export default {
67
68
iconCol : 'folder_open' ,
68
69
dateCol : new Date ( ) ,
69
70
fileSizeCol : '536870912' ,
70
- locationCol : '/path/to/location-link' ,
71
- jsonCol : {
72
- id : 1 ,
73
- textCol : 'Text 1' ,
74
- imageCol : 'material-icons://folder_open' ,
75
- iconCol : 'folder_open' ,
76
- dateCol : new Date ( ) ,
77
- fileSizeCol : '536870912' ,
78
- locationCol : '/path/to/location-link'
79
- }
71
+ locationCol : mockPathInfos [ 0 ] ,
72
+ booleanCol : true ,
73
+ amountCol : 100.55 ,
74
+ numberCol : 10000.31 ,
75
+ jsonCol : mockPathInfos [ 0 ]
80
76
} ,
81
77
{
82
78
id : 2 ,
83
79
textCol : 'Text 2' ,
84
80
imageCol : 'material-icons://cloud_outline' ,
85
81
iconCol : 'cloud_outline' ,
86
- dateCol : new Date ( ) ,
82
+ dateCol : new Date ( ) . setDate ( new Date ( ) . getDate ( ) - 1 ) ,
87
83
fileSizeCol : '524288' ,
88
- locationCol : { name : '/path/to/location-link' } ,
89
- jsonCol : {
90
- id : 2 ,
91
- textCol : 'Text 2' ,
92
- imageCol : 'material-icons://cloud_outline' ,
93
- iconCol : 'cloud_outline' ,
94
- dateCol : new Date ( ) ,
95
- fileSizeCol : '524288' ,
96
- locationCol : '/path/to/location-link'
97
- }
84
+ locationCol : mockPathInfos [ 1 ] ,
85
+ booleanCol : false ,
86
+ amountCol : 1020.123 ,
87
+ numberCol : 240.3 ,
88
+ jsonCol : mockPathInfos [ 1 ]
98
89
} ,
99
90
{
100
91
id : 3 ,
101
92
textCol : 'Text 3' ,
102
93
imageCol : 'material-icons://save' ,
103
94
iconCol : 'save' ,
104
- dateCol : new Date ( ) ,
95
+ dateCol : new Date ( ) . setDate ( new Date ( ) . getDate ( ) - 5 ) ,
105
96
fileSizeCol : '10737418240B' ,
106
- locationCol : '/path/to/location-link' ,
107
- jsonCol : {
108
- id : 3 ,
109
- textCol : 'Text 3' ,
110
- imageCol : 'material-icons://save' ,
111
- iconCol : 'save' ,
112
- dateCol : new Date ( ) ,
113
- fileSizeCol : '10737418240B' ,
114
- locationCol : '/path/to/location-link'
115
- }
97
+ locationCol : mockPathInfos [ 1 ] ,
98
+ booleanCol : 'true' ,
99
+ amountCol : - 2020 ,
100
+ numberCol : 120 ,
101
+ jsonCol : mockPathInfos [ 1 ]
116
102
} ,
117
103
{
118
104
id : 4 ,
119
105
textCol : 'Text 4' ,
120
106
imageCol : 'material-icons://delete' ,
121
107
iconCol : 'delete' ,
122
- dateCol : new Date ( ) ,
108
+ dateCol : new Date ( ) . setDate ( new Date ( ) . getDate ( ) - 6 ) ,
123
109
fileSizeCol : '512B' ,
124
- locationCol : '/path/to/location-link' ,
125
- jsonCol : {
126
- id : 4 ,
127
- textCol : 'Text 4' ,
128
- imageCol : 'material-icons://delete' ,
129
- iconCol : 'delete' ,
130
- dateCol : new Date ( ) ,
131
- fileSizeCol : '512B' ,
132
- locationCol : '/path/to/location-link'
133
- }
110
+ locationCol : mockPathInfos [ 2 ] ,
111
+ booleanCol : 'false' ,
112
+ amountCol : 230.76 ,
113
+ numberCol : 3.032 ,
114
+ jsonCol : mockPathInfos [ 2 ]
134
115
} ,
135
116
{
136
117
id : 5 ,
137
118
textCol : 'Text 5' ,
138
119
imageCol : 'material-icons://person_outline' ,
139
120
iconCol : 'person_outline' ,
140
- dateCol : new Date ( ) ,
121
+ dateCol : new Date ( ) . setDate ( new Date ( ) . getDate ( ) - 7 ) ,
141
122
fileSizeCol : '1073741824B' ,
142
- locationCol : '/path/to/location-link' ,
143
- jsonCol : {
144
- id : 5 ,
145
- textCol : 'Text 5' ,
146
- imageCol : 'material-icons://person_outline' ,
147
- iconCol : 'person_outline' ,
148
- dateCol : new Date ( ) ,
149
- fileSizeCol : '1073741824B' ,
150
- locationCol : '/path/to/location-link'
151
- }
123
+ locationCol : mockPathInfos [ 0 ] ,
124
+ booleanCol : 'false' ,
125
+ amountCol : 0.444 ,
126
+ numberCol : 2000 ,
127
+ jsonCol : mockPathInfos [ 0 ]
152
128
}
153
129
] ,
154
130
table : {
@@ -177,8 +153,12 @@ export default {
177
153
{ type : 'image' , key : 'imageCol' , title : 'Image Column' , draggable : true , cssClass : 'adf-ellipsis-cell' } ,
178
154
{ type : 'icon' , key : 'iconCol' , title : 'Icon Column' , draggable : true , cssClass : 'adf-ellipsis-cell' } ,
179
155
{ type : 'date' , key : 'dateCol' , title : 'Date Column' , sortable : true , draggable : true , cssClass : 'adf-ellipsis-cell' } ,
156
+ { type : 'date' , key : 'dateCol' , title : 'Date Time Ago Column' , sortable : true , draggable : true , cssClass : 'adf-ellipsis-cell' , dateConfig : { format : 'timeAgo' } } ,
180
157
{ type : 'fileSize' , key : 'fileSizeCol' , title : 'File Size Column' , sortable : true , draggable : true , cssClass : 'adf-ellipsis-cell' } ,
181
- { type : 'location' , format : '/somewhere' , key : 'locationCol' , title : 'Location Column' , draggable : true , cssClass : 'adf-ellipsis-cell' } ,
158
+ { type : 'location' , format : '/files' , key : 'locationCol' , title : 'Location Column' , draggable : true , cssClass : 'adf-ellipsis-cell' } ,
159
+ { type : 'boolean' , key : 'booleanCol' , title : 'Boolean Column' , draggable : true , cssClass : 'adf-ellipsis-cell' } ,
160
+ { type : 'amount' , key : 'amountCol' , title : 'Amount Column' , draggable : true , cssClass : 'adf-ellipsis-cell' } ,
161
+ { type : 'number' , key : 'numberCol' , title : 'Number Column' , draggable : true , cssClass : 'adf-ellipsis-cell' } ,
182
162
{ type : 'json' , key : 'jsonCol' , title : 'JSON Column' , draggable : true , cssClass : 'adf-ellipsis-cell' }
183
163
] ,
184
164
table : {
@@ -383,7 +363,7 @@ export default {
383
363
table : { category : 'Actions' }
384
364
}
385
365
}
386
- } as Meta ;
366
+ } as Meta < DataTableComponent > ;
387
367
388
368
const insertContentToTemplate = ( content : string ) : string => (
389
369
`<adf-datatable
0 commit comments