Mixins / foldkit-mixins-ui

TableView

interface · packages/mixins-ui/src/table.ts:198

interface TableView<Row, Message = never, Key extends string = string> {
  readonly columns: ReadonlyArray<TableColumn<Row, Key>>
  readonly rows: ReadonlyArray<Row>
  readonly caption?: string | undefined
  readonly rowKey?: ((row: Row) => string) | undefined
  readonly sort?:
    | {
        readonly by: Option.Option<TableSort<Key>>
        readonly onSort: (column: Key) => Message
      }
    | undefined
  readonly selection?: TableSelection<Row, Message> | undefined
  readonly expansion?: TableExpansion<Row, Message> | undefined
  readonly empty?: Html | undefined
  readonly style?: NamedStyle<typeof TableSlots> | undefined
  readonly mixins?: MixinList<Message> | undefined
  readonly fluid?: TableFluid | undefined
  readonly words?: Partial<TableWords> | undefined
}

A plain table in one call: columns with per-row values, the rows, an optional caption, a style for its slots, and mixins beside the style. No upstream component stands behind it.

Members

TableView.columns

property · packages/mixins-ui/src/table.ts:199

readonly columns: ReadonlyArray<TableColumn<Row, Key>>

TableView.rows

property · packages/mixins-ui/src/table.ts:200

readonly rows: ReadonlyArray<Row>

TableView.caption

property · packages/mixins-ui/src/table.ts:201

readonly caption?: string | undefined

TableView.rowKey

property · packages/mixins-ui/src/table.ts:203

readonly rowKey?: ((row: Row) => string) | undefined

Each row's key, so a sorted row keeps its element; by default its place.

TableView.sort

property · packages/mixins-ui/src/table.ts:205

readonly sort?:
  | {
      readonly by: Option.Option<TableSort<Key>>
      readonly onSort: (column: Key) => Message
    }
  | undefined

The sort the rows are drawn in, and the Message a press on a sortable heading sends.

TableView.selection

property · packages/mixins-ui/src/table.ts:212

readonly selection?: TableSelection<Row, Message> | undefined

A checkbox on every row, and one in the heading for all of them.

TableView.expansion

property · packages/mixins-ui/src/table.ts:213

readonly expansion?: TableExpansion<Row, Message> | undefined

TableView.empty

property · packages/mixins-ui/src/table.ts:215

readonly empty?: Html | undefined

Drawn across the table while there are no rows: an Empty.view, say.

TableView.style

property · packages/mixins-ui/src/table.ts:217

readonly style?: NamedStyle<typeof TableSlots> | undefined

A style of TableSlots, for the table's look.

TableView.mixins

property · packages/mixins-ui/src/table.ts:219

readonly mixins?: MixinList<Message> | undefined

Mixins beside the style.

TableView.fluid

property · packages/mixins-ui/src/table.ts:226

readonly fluid?: TableFluid | undefined

One highlight behind the body rows, following the pointer, and the lit row marked data-fluid-lit: Table.fluid. Without it the table draws none and ships none of it; its Mount sends no Message, which a Scene test would have to resolve.

TableView.words

property · packages/mixins-ui/src/table.ts:228

readonly words?: Partial<TableWords> | undefined

The table's text, over Table.words.