mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-26 09:50:33 +01:00
feat(Table): add style to table and column meta (#4513)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -165,6 +165,8 @@ describe('Table', () => {
|
||||
['with loading', { props: { ...props, loading: true } }],
|
||||
...loadingColors.map((loadingColor: string) => [`with loading color ${loadingColor}`, { props: { ...props, loading: true, loadingColor } }]),
|
||||
...loadingAnimations.map((loadingAnimation: string) => [`with loading animation ${loadingAnimation}`, { props: { ...props, loading: true, loadingAnimation } }]),
|
||||
['with meta prop', { props: { ...props, meta: { class: { tr: 'custom-row-class' }, style: { tr: { backgroundColor: 'lightgray' } } } } }],
|
||||
['with meta field on columns', { props: { ...props, columns: columns.map(c => ({ ...c, meta: { class: { th: 'custom-heading-class', td: 'custom-cell-class' }, style: { th: { backgroundColor: 'black' }, td: { backgroundColor: 'lightgray' } } } })) } }],
|
||||
['with as', { props: { ...props, as: 'section' } }],
|
||||
['with class', { props: { ...props, class: 'absolute' } }],
|
||||
['with ui', { props: { ...props, ui: { base: 'table-auto' } } }],
|
||||
@@ -194,10 +196,10 @@ describe('Table', () => {
|
||||
},
|
||||
...(filter.value === 2
|
||||
? [
|
||||
{
|
||||
accessorKey: 'amount',
|
||||
header: () => h('div', { ['data-test-th']: 'amount' }, 'Amount')
|
||||
} satisfies TableColumn<typeof data[number]>
|
||||
{
|
||||
accessorKey: 'amount',
|
||||
header: () => h('div', { ['data-test-th']: 'amount' }, 'Amount')
|
||||
} satisfies TableColumn<typeof data[number]>
|
||||
]
|
||||
: [])
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user