Data Table

Tabela sterowana danymi, zbudowana na Table: sortowane kolumny, globalny filtr, paginacja, zaznaczanie wierszy polami wyboru, menu widoczności kolumn oraz stany ładowania i pusty.

Dostępny w
  • Angular: dostępny
  • Vue: dostępny
  • React: dostępny
  • React Native: jeszcze niedostępny

Użycie

Success ken99@example.com $316.00
Success abe45@example.com $242.00
Processing monserrat44@example.com $837.00
Success silas22@example.com $874.00
Failed carmella@example.com $721.00

Import

ts
import {
  SoneDataTableComponent,
} from "@surface-one/angular/data-table";

Dokumentacja API

SoneDataTableComponentKomponent

`<sone-data-table>` — a data-driven table on top of `<sone-table>` (shadcn/ui Data Table): sortable headers (`aria-sort`, ascending → descending → unsorted), an optional global filter, client pagination through `<sone-pagination>`, row selection with checkboxes (select-all with the mixed state), a column visibility menu, an empty row and a loading state. Sort, filter, page, selection and hidden columns are two-way.

Selektor
sone-data-table
Wejścia
NazwaTyp Domyślnie
rows

Every row; the table filters, sorts and pages them.

readonly T[][]
columnsreadonly SoneDataTableColumn<T>[][]
rowKey

A stable key per row — what `selected` holds; default: its index in `rows`.

(row: T, index: number) => SoneDataTableKeydataTableIndexKey
sortdwukierunkowe

The sorted column, two-way; `null` keeps the order of `rows`.

SoneDataTableSort | nullnull
filterdwukierunkowe

The global filter text, two-way.

string""
filterable

Shows the filter field above the table.

booleanfalse
filterPlaceholder—$localize`Filter…`
pagedwukierunkowe

The current page (1-based), two-way.

number1
pageSize

Rows per page; 0 shows every row (no pagination).

number10
selectable

Adds a checkbox column; the checked rows' keys are `selected`.

booleanfalse
selecteddwukierunkowe

The keys of the selected rows, two-way.

readonly SoneDataTableKey[][]
rowLabel

Names a row for its checkbox (“Select INV001”); default: “Select row 3”.

((row: T) => string) | nullnull
columnToggle

Shows the column visibility menu.

booleanfalse
hiddenColumnsdwukierunkowe

The keys of the hidden columns, two-way.

readonly string[][]
loading

Rows are on their way: the table is busy and says so.

booleanfalse
captionstring | nullnull
emptyText

The one row shown when nothing matches.

—$localize`No results.`