Data Table
Table をベースにしたデータ駆動のテーブル。列の並べ替え、全体フィルター、ページネーション、チェックボックスによる行選択、列の表示切り替えメニュー、読み込み中と空の状態に対応します。
Angular: 対応 Vue: 対応 React: 対応 React Native: 未対応
使い方
| 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 |
<sone-data-table
[rows]="payments"
[columns]="columns"
[rowKey]="byId"
[rowLabel]="byEmail"
[pageSize]="5"
[(selected)]="selected"
filterable
selectable
columnToggle
/>インポート
import {
SoneDataTableComponent,
} from "@surface-one/angular/data-table";API リファレンス
SoneDataTableComponentコンポーネント
`<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.
| 名前 | 型 | デフォルト |
|---|---|---|
rowsEvery row; the table filters, sorts and pages them. | readonly T[] | [] |
columns | readonly SoneDataTableColumn<T>[] | [] |
rowKeyA stable key per row — what `selected` holds; default: its index in `rows`. | (row: T, index: number) => SoneDataTableKey | dataTableIndexKey |
sort双方向The sorted column, two-way; `null` keeps the order of `rows`. | SoneDataTableSort | null | null |
filter双方向The global filter text, two-way. | string | "" |
filterableShows the filter field above the table. | boolean | false |
filterPlaceholder | — | $localize`Filter…` |
page双方向The current page (1-based), two-way. | number | 1 |
pageSizeRows per page; 0 shows every row (no pagination). | number | 10 |
selectableAdds a checkbox column; the checked rows' keys are `selected`. | boolean | false |
selected双方向The keys of the selected rows, two-way. | readonly SoneDataTableKey[] | [] |
rowLabelNames a row for its checkbox (“Select INV001”); default: “Select row 3”. | ((row: T) => string) | null | null |
columnToggleShows the column visibility menu. | boolean | false |
hiddenColumns双方向The keys of the hidden columns, two-way. | readonly string[] | [] |
loadingRows are on their way: the table is busy and says so. | boolean | false |
caption | string | null | null |
emptyTextThe one row shown when nothing matches. | — | $localize`No results.` |