Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 08a9bbb

Browse files
committed
feat(BTable): updated table field formatter to a reusable type
1 parent 0f2bb6b commit 08a9bbb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/bootstrap-vue-next/src/types/TableFieldObject.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ import type {ClassValue} from './ClassValue'
33
import type {LiteralUnion} from './LiteralUnion'
44
import type {ColorVariant} from './ColorVariant'
55

6+
export type TableFieldObjectFormatter<T = any> =
7+
| string
8+
| ((value: unknown, key?: string, item?: T) => string)
9+
610
export interface TableFieldObject<T = Record<string, unknown>> {
711
key: LiteralUnion<keyof T>
812
label?: string
913
headerTitle?: string
1014
headerAbbr?: string
1115
class?: ClassValue
12-
formatter?: string | ((value: unknown, key?: string, item?: T) => string)
16+
formatter?: TableFieldObjectFormatter<T>
1317
sortable?: boolean
1418
sortKey?: string
1519
sortDirection?: string

0 commit comments

Comments
 (0)