mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
Additional changes to column defaults
This commit is contained in:
parent
6deab38c67
commit
8a48abbbc8
1 changed files with 11 additions and 8 deletions
|
|
@ -96,9 +96,10 @@ const tableColumns: { [key: string]: ColDef } = {
|
||||||
width: 200,
|
width: 200,
|
||||||
},
|
},
|
||||||
bitRate: {
|
bitRate: {
|
||||||
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'left' }),
|
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'center' }),
|
||||||
colId: TableColumn.BIT_RATE,
|
colId: TableColumn.BIT_RATE,
|
||||||
field: 'bitRate',
|
field: 'bitRate',
|
||||||
|
headerComponent: (params: IHeaderParams) => GenericTableHeader(params, { position: 'center' }),
|
||||||
suppressSizeToFit: true,
|
suppressSizeToFit: true,
|
||||||
valueFormatter: (params: ValueFormatterParams) => `${params.value} kbps`,
|
valueFormatter: (params: ValueFormatterParams) => `${params.value} kbps`,
|
||||||
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.bitRate : undefined),
|
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.bitRate : undefined),
|
||||||
|
|
@ -129,15 +130,16 @@ const tableColumns: { [key: string]: ColDef } = {
|
||||||
width: 150,
|
width: 150,
|
||||||
},
|
},
|
||||||
dateAdded: {
|
dateAdded: {
|
||||||
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'left' }),
|
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'center' }),
|
||||||
colId: TableColumn.DATE_ADDED,
|
colId: TableColumn.DATE_ADDED,
|
||||||
field: 'createdAt',
|
field: 'createdAt',
|
||||||
|
headerComponent: (params: IHeaderParams) => GenericTableHeader(params, { position: 'center' }),
|
||||||
headerName: 'Date Added',
|
headerName: 'Date Added',
|
||||||
suppressSizeToFit: true,
|
suppressSizeToFit: true,
|
||||||
valueFormatter: (params: ValueFormatterParams) =>
|
valueFormatter: (params: ValueFormatterParams) =>
|
||||||
params.value ? dayjs(params.value).format('MMM D, YYYY') : '',
|
params.value ? dayjs(params.value).format('MMM D, YYYY') : '',
|
||||||
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.createdAt : undefined),
|
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.createdAt : undefined),
|
||||||
width: 110,
|
width: 130,
|
||||||
},
|
},
|
||||||
discNumber: {
|
discNumber: {
|
||||||
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'right' }),
|
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'right' }),
|
||||||
|
|
@ -150,11 +152,11 @@ const tableColumns: { [key: string]: ColDef } = {
|
||||||
width: 60,
|
width: 60,
|
||||||
},
|
},
|
||||||
duration: {
|
duration: {
|
||||||
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'right' }),
|
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'center' }),
|
||||||
colId: TableColumn.DURATION,
|
colId: TableColumn.DURATION,
|
||||||
field: 'duration',
|
field: 'duration',
|
||||||
headerComponent: (params: IHeaderParams) =>
|
headerComponent: (params: IHeaderParams) =>
|
||||||
GenericTableHeader(params, { position: 'right', preset: 'duration' }),
|
GenericTableHeader(params, { position: 'center', preset: 'duration' }),
|
||||||
suppressSizeToFit: true,
|
suppressSizeToFit: true,
|
||||||
valueFormatter: (params: ValueFormatterParams) => formatDuration(params.value * 1000),
|
valueFormatter: (params: ValueFormatterParams) => formatDuration(params.value * 1000),
|
||||||
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.duration : undefined),
|
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.duration : undefined),
|
||||||
|
|
@ -168,7 +170,6 @@ const tableColumns: { [key: string]: ColDef } = {
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
lastPlayedAt: {
|
lastPlayedAt: {
|
||||||
cellRenderer: GenericCell,
|
|
||||||
colId: TableColumn.LAST_PLAYED,
|
colId: TableColumn.LAST_PLAYED,
|
||||||
headerName: 'Last Played',
|
headerName: 'Last Played',
|
||||||
valueFormatter: (params: ValueFormatterParams) =>
|
valueFormatter: (params: ValueFormatterParams) =>
|
||||||
|
|
@ -195,9 +196,10 @@ const tableColumns: { [key: string]: ColDef } = {
|
||||||
width: 90,
|
width: 90,
|
||||||
},
|
},
|
||||||
releaseDate: {
|
releaseDate: {
|
||||||
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'left' }),
|
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'center' }),
|
||||||
colId: TableColumn.RELEASE_DATE,
|
colId: TableColumn.RELEASE_DATE,
|
||||||
field: 'releaseDate',
|
field: 'releaseDate',
|
||||||
|
headerComponent: (params: IHeaderParams) => GenericTableHeader(params, { position: 'center' }),
|
||||||
headerName: 'Release Date',
|
headerName: 'Release Date',
|
||||||
suppressSizeToFit: true,
|
suppressSizeToFit: true,
|
||||||
valueFormatter: (params: ValueFormatterParams) =>
|
valueFormatter: (params: ValueFormatterParams) =>
|
||||||
|
|
@ -213,7 +215,7 @@ const tableColumns: { [key: string]: ColDef } = {
|
||||||
headerName: 'Year',
|
headerName: 'Year',
|
||||||
suppressSizeToFit: true,
|
suppressSizeToFit: true,
|
||||||
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.releaseYear : undefined),
|
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.releaseYear : undefined),
|
||||||
width: 60,
|
width: 80,
|
||||||
},
|
},
|
||||||
rowIndex: {
|
rowIndex: {
|
||||||
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'right' }),
|
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'right' }),
|
||||||
|
|
@ -230,6 +232,7 @@ const tableColumns: { [key: string]: ColDef } = {
|
||||||
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'center' }),
|
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'center' }),
|
||||||
colId: TableColumn.SONG_COUNT,
|
colId: TableColumn.SONG_COUNT,
|
||||||
field: 'songCount',
|
field: 'songCount',
|
||||||
|
headerComponent: (params: IHeaderParams) => GenericTableHeader(params, { position: 'center' }),
|
||||||
headerName: 'Songs',
|
headerName: 'Songs',
|
||||||
suppressSizeToFit: true,
|
suppressSizeToFit: true,
|
||||||
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.songCount : undefined),
|
valueGetter: (params: ValueGetterParams) => (params.data ? params.data.songCount : undefined),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue