Simple Table API
Full surface of oge-simple-table: its inputs and model, the page method, the four structural template slots with their typed contexts, and the config provider.
Properties Methods Events Types
OgeSimpleTable
oge-simple-tableProperties 10
Data
| Name | Type | Default | Description |
|---|---|---|---|
value | readonly T[] | [] | The rows. |
columns | readonly OgeSimpleTableColumn[] | undefined | — | Header cells and default cells. Unset: one column per own key of the first row. |
Paging
| Name | Type | Default | Description |
|---|---|---|---|
paging | boolean | false | Shows pageSize rows at a time with a previous / next pager and a {from}–{to} of {count} text (announced politely). |
pageSize | number | undefined | config ?? 10 | Rows per page with paging. |
pageIndex | number | 0 | 0-based page shown (two-way [(pageIndex)]), clamped into range. |
Presentation
| Name | Type | Default | Description |
|---|---|---|---|
compact | boolean | undefined | config ?? false | Denser rows (4px 8px cell padding instead of the token). |
caption | string | undefined | — | A visible <caption> — the table’s accessible name. |
ariaLabel | string | undefined | — | The accessible name when there is no visible caption. |
scrollable | boolean | true | Wraps the table in a focusable, labelled scroll region, so a wide table scrolls inside itself on a narrow screen instead of widening the page. |
locale | string | undefined | — | BCP 47 locale of the pager’s numbers; falls back to the config, then the application locale. |
Methods 1
| Name | Type | Description |
|---|---|---|
goToPage(index) | (index: number) => void | Shows a page, clamped into range. |
Events 1
| Name | Type | Description |
|---|---|---|
pageIndexChange | number | The banana half of [(pageIndex)]. |
Types 9
Slots
| Name | Type | Description |
|---|---|---|
OgeSimpleTableRow | [ogeSimpleTableRow] | The markup of each row — a whole <tr> with free <td>s. Bind [ogeSimpleTableRowOf] to the same array as value and let-row is typed under strictTemplates (ngTemplateContextGuard). |
OgeSimpleTableHeader | [ogeSimpleTableHeader] | Replaces the header row(s) inside <thead> — grouped headers, colspan. Give each <th> a scope. |
OgeSimpleTableFooter | [ogeSimpleTableFooter] | Rows of a <tfoot> — totals, notes; let-all="rows" is every row of value. |
OgeSimpleTableEmpty | [ogeSimpleTableEmpty] | Content of the full-width cell shown when value is empty (default: the noData message). |
OgeSimpleTableRowContext | { $implicit: T; columns: readonly OgeSimpleTableResolvedColumn[]; rowIndex: number } | Context of the row template; rowIndex counts in value, not in the page. |
OgeSimpleTableSectionContext | { $implicit: readonly OgeSimpleTableResolvedColumn[]; rows: readonly T[] } | Context of the header and footer templates. |
Vocabulary
| Name | Type | Description |
|---|---|---|
OgeSimpleTableColumn | { field?: string; caption?: string; align?: OgeSimpleTableAlign; width?: string; cssClass?: string } | One column: its header cell, and the default cell when no row template is given. field takes dot paths; caption defaults to the field, humanized; width goes on the column’s <col>. |
OgeSimpleTableAlign | 'start' | 'center' | 'end' | Alignment of a column’s header and cells (logical: end is the left edge in a right-to-left page). |
OgeSimpleTableResolvedColumn | OgeSimpleTableColumn & { caption: string; align: OgeSimpleTableAlign; cellClass: string } | A column as templates receive it. cellClass carries the alignment and cssClass: put it on a <td> of your own row to line it up with its header. |
Configuration
Properties 2
| Name | Type | Description |
|---|---|---|
provideOgeSimpleTableConfig(config) | (config: OgeSimpleTableConfigInput | (() => OgeSimpleTableConfigInput)) => Provider | Application- or component-scoped defaults for pageSize, compact, locale and the messages; a function makes them live (switching the UI language without a reload). |
OGE_SIMPLE_TABLE_CONFIG | InjectionToken<OgeSimpleTableConfig> | The token behind the provider. |
Types 5
| Name | Type | Description |
|---|---|---|
OgeSimpleTableConfig | interface | The resolved config (messages, pageSize?, compact?, locale?). |
OgeSimpleTableConfigInput | interface | The partial input both providers accept (messages merged one level deep). |
OGE_DEFAULT_SIMPLE_TABLE_CONFIG | OgeSimpleTableConfig | The resolved defaults. |
OgeSimpleTableMessages | interface | Every user-facing string: pager (the pager group’s name), previousPage, nextPage, pageInfo ({from} {to} {count}) and noData. Translated in every @oge-ui/locales pack (layout.simpleTable). |
OGE_DEFAULT_SIMPLE_TABLE_MESSAGES | OgeSimpleTableMessages | The English catalog. |