ColumnFactory
Defined in: packages/core/src/class/ColumnFactory.ts:96
OOP column registry replacing the old fixed set of exported factory
functions. t and shared defaults are captured once; every builder method
returns a framework-agnostic ColumnConfig descriptor that @flextable/react
and @flextable/vue each translate into a real ColumnDef with their own
renderers. Unknown column kinds can be added via registerColumnType
without forking the library.
Type Parameters
Section titled “Type Parameters”TEntity
Section titled “TEntity”TEntity extends EntityLike
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ColumnFactory<
TEntity>(t,defaults?):ColumnFactory<TEntity>
Defined in: packages/core/src/class/ColumnFactory.ts:102
Parameters
Section titled “Parameters”defaults?
Section titled “defaults?”Returns
Section titled “Returns”ColumnFactory<TEntity>
Methods
Section titled “Methods”actions()
Section titled “actions()”actions(
options):ActionsColumnConfig<TEntity>
Defined in: packages/core/src/class/ColumnFactory.ts:256
Parameters
Section titled “Parameters”options
Section titled “options”ActionsColumnOptions<TEntity>
Returns
Section titled “Returns”ActionsColumnConfig<TEntity>
avatar()
Section titled “avatar()”avatar(
options):AvatarColumnConfig<TEntity>
Defined in: packages/core/src/class/ColumnFactory.ts:119
Parameters
Section titled “Parameters”options
Section titled “options”AvatarColumnOptions<TEntity>
Returns
Section titled “Returns”AvatarColumnConfig<TEntity>
badge()
Section titled “badge()”badge<
TVariant>(options):BadgeColumnConfig<TEntity>
Defined in: packages/core/src/class/ColumnFactory.ts:230
Type Parameters
Section titled “Type Parameters”TVariant
Section titled “TVariant”TVariant extends string = string
Parameters
Section titled “Parameters”options
Section titled “options”BadgeColumnOptions<TEntity, TVariant>
Returns
Section titled “Returns”BadgeColumnConfig<TEntity>
count()
Section titled “count()”count(
options):CountColumnConfig<TEntity>
Defined in: packages/core/src/class/ColumnFactory.ts:219
Parameters
Section titled “Parameters”options
Section titled “options”CountColumnOptions<TEntity>
Returns
Section titled “Returns”CountColumnConfig<TEntity>
custom()
Section titled “custom()”custom<
TResolved,TOptions>(kind,options):CustomColumnConfig<TEntity,TResolved>
Defined in: packages/core/src/class/ColumnFactory.ts:304
Type Parameters
Section titled “Type Parameters”TResolved
Section titled “TResolved”TResolved = unknown
TOptions
Section titled “TOptions”TOptions = unknown
Parameters
Section titled “Parameters”string
options
Section titled “options”TOptions
Returns
Section titled “Returns”CustomColumnConfig<TEntity, TResolved>
date()
Section titled “date()”date(
options):DateColumnConfig<TEntity>
Defined in: packages/core/src/class/ColumnFactory.ts:191
Parameters
Section titled “Parameters”options
Section titled “options”DateColumnOptions<TEntity>
Returns
Section titled “Returns”DateColumnConfig<TEntity>
expandRow()
Section titled “expandRow()”expandRow(
options?):ExpandRowColumnConfig<TEntity>
Defined in: packages/core/src/class/ColumnFactory.ts:281
Parameters
Section titled “Parameters”options?
Section titled “options?”CommonColumnOptions<TEntity> = {}
Returns
Section titled “Returns”ExpandRowColumnConfig<TEntity>
name()
Section titled “name()”name(
options):NameColumnConfig<TEntity>
Defined in: packages/core/src/class/ColumnFactory.ts:139
Parameters
Section titled “Parameters”options
Section titled “options”NameColumnOptions<TEntity>
Returns
Section titled “Returns”NameColumnConfig<TEntity>
registerColumnType()
Section titled “registerColumnType()”registerColumnType<
TOptions,TResolved>(kind,builder):void
Defined in: packages/core/src/class/ColumnFactory.ts:297
Plugin escape hatch: register a builder for a column kind this class
doesn’t ship (e.g. “currency”). builder receives t and the caller’s
options and resolves them into whatever props the framework renderer
registered for kind expects — custom() wraps the result.
Type Parameters
Section titled “Type Parameters”TOptions
Section titled “TOptions”TOptions
TResolved
Section titled “TResolved”TResolved = TOptions
Parameters
Section titled “Parameters”string
builder
Section titled “builder”ColumnTypeBuilder<TOptions, TResolved>
Returns
Section titled “Returns”void
select()
Section titled “select()”select(
options?):SelectColumnConfig<TEntity>
Defined in: packages/core/src/class/ColumnFactory.ts:108
Parameters
Section titled “Parameters”options?
Section titled “options?”CommonColumnOptions<TEntity> = {}
Returns
Section titled “Returns”SelectColumnConfig<TEntity>
text()
Section titled “text()”text(
options):TextColumnConfig<TEntity>
Defined in: packages/core/src/class/ColumnFactory.ts:169
Parameters
Section titled “Parameters”options
Section titled “options”TextColumnOptions<TEntity>
Returns
Section titled “Returns”TextColumnConfig<TEntity>
updated()
Section titled “updated()”updated(
options):DateColumnConfig<TEntity>
Defined in: packages/core/src/class/ColumnFactory.ts:205
Convenience wrapper around date() defaulting to the updatedAt accessor.
Parameters
Section titled “Parameters”options
Section titled “options”Omit<DateColumnOptions<TEntity>, "accessorKey" | "headerKey"> & object
Returns
Section titled “Returns”DateColumnConfig<TEntity>