Manages basic data-sorting behaviors. Ascending -> Descending -> None

This plugin requires a table plugin configuration, onSort for handling how sorting happens. communicating back to the table that sorting has succeeded can be done by setting the sorts property in the table plugin configuration.

Note that this plugin doesn't actually sort the data, as data management is not the responsibility of the table, but of the surrounding context providing the data to the table. So sorting can happen client-side still, just in a component -- much the same way you'd handel sorting via API requests.

This plugin is for conveying what the current sorts are, rather than doing the sorting.

Type Parameters

  • DataType = unknown

Hierarchy

Constructors

Properties

[___Signature__]: Signature<DataType>

(secret)

Because classes are kind of like interfaces, we need "something" to help TS know what a Resource is.

This isn't a real API, but does help with type inference with the SignatureFrom utility above

meta: {
    column: typeof ColumnMeta;
    table: typeof TableMeta;
} = ...

Optional state that this plugin may or may not choose to use

columns will each have an instance of meta.column. the table will have only one instance of meta.table.

Type declaration

  • column: typeof ColumnMeta
  • table: typeof TableMeta
name: string = 'data-sorting'

Unique name for the plugin.

  • only one plugin of the same name is allowed
  • the name is used for storing preferences / serializable information
table: Table<unknown>
features?: string[]
requires?: string[]

Methods

  • Helper for specifying column-level configurations for a plugin on headlessTable's columns option

    Type Parameters

    Parameters

    • this: Constructor<T, any[]>
    • configFn: (() => ColumnOptionsFor<SignatureFrom<T>>)
        • (): ColumnOptionsFor<SignatureFrom<T>>
        • Returns ColumnOptionsFor<SignatureFrom<T>>

    Returns [Constructor<T, any[]>, (() => ColumnOptionsFor<SignatureFrom<T>>)]

  • Helper for specifying plugins on headlessTable with the plugin-level options

    Type Parameters

    Parameters

    • this: Constructor<T, any[]>
    • configFn: (() => OptionsFor<SignatureFrom<T>>)
        • (): OptionsFor<SignatureFrom<T>>
        • Returns OptionsFor<SignatureFrom<T>>

    Returns [Constructor<T, any[]>, (() => OptionsFor<SignatureFrom<T>>)]

Generated using TypeDoc