@egose/shadcn-theme-ng-tw 0.6.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -167,6 +167,12 @@ export class DemoComponent {
167
167
  }
168
168
  ```
169
169
 
170
+ ## Data table upgrade notes
171
+
172
+ - Display columns (columns without an accessor) now require `enableHiding: true` to be user-hideable. Set it on display columns that users should be able to hide and restore through the View menu, and enable `showColumnToggle` on the table.
173
+ - `resetKey` resets the dataset's table state. Bind `preservePageOnDataChange` separately to keep the client page on refreshes. A dataset reset restores `initialColumnFilters` and reports changed filters through the existing filter outputs.
174
+ - Import `provideEgDataTableLabels` from `@egose/shadcn-theme-ng/data-table` to localize table and pager controls, including accessible names and status text.
175
+
170
176
  ## Searchable multiselect
171
177
 
172
178
  `EgSearchableMultiselect` provides local, case-insensitive label search, named removable chips, and a `string[]` CVA. Import it directly from its public subpath:
@@ -140,7 +140,7 @@ class HlmCalendar {
140
140
  </tbody>
141
141
  </table>
142
142
  </div>
143
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.BrnCalendarCellButton, selector: "button[brnCalendarCellButton]", inputs: ["date"] }, { kind: "directive", type: i1.BrnCalendarGrid, selector: "[brnCalendarGrid]" }, { kind: "directive", type: i1.BrnCalendarHeader, selector: "[brnCalendarHeader]", inputs: ["id"] }, { kind: "directive", type: i1.BrnCalendarNextButton, selector: "[brnCalendarNextButton]" }, { kind: "directive", type: i1.BrnCalendarPreviousButton, selector: "[brnCalendarPreviousButton]" }, { kind: "directive", type: i1.BrnCalendarWeek, selector: "[brnCalendarWeek]" }, { kind: "directive", type: i1.BrnCalendarWeekday, selector: "[brnCalendarWeekday]" }, { kind: "directive", type: i1.BrnCalendarCell, selector: "[brnCalendarCell]" }, { kind: "directive", type: i1.BrnCalendarMonthSelect, selector: "brnSelect[brnCalendarMonthSelect],hlm-select[brnCalendarMonthSelect]" }, { kind: "directive", type: i1.BrnCalendarYearSelect, selector: "brnSelect[brnCalendarYearSelect],hlm-select[brnCalendarYearSelect]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: i2.HlmSelect, selector: "[hlmSelect],hlm-select" }, { kind: "component", type: i2.HlmSelectContent, selector: "hlm-select-content", inputs: ["showScroll"] }, { kind: "directive", type: i2.HlmSelectGroup, selector: "[hlmSelectGroup],hlm-select-group" }, { kind: "component", type: i2.HlmSelectItem, selector: "hlm-select-item" }, { kind: "directive", type: i2.HlmSelectPortal, selector: "[hlmSelectPortal]" }, { kind: "component", type: i2.HlmSelectTrigger, selector: "hlm-select-trigger", inputs: ["class", "buttonId", "ariaDescribedby", "wrapperDisabled", "size", "forceInvalid"] }, { kind: "directive", type: i2.HlmSelectValue, selector: "[hlmSelectValue],hlm-select-value" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.HlmBtn, selector: "button[hlmBtn], a[hlmBtn]", inputs: ["variant", "size", "class", "type"], exportAs: ["hlmBtn"] }], viewProviders: [provideIcons({ lucideChevronLeft, lucideChevronRight })], changeDetection: i0.ChangeDetectionStrategy.OnPush });
143
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1.BrnCalendarCellButton, selector: "button[brnCalendarCellButton]", inputs: ["date"] }, { kind: "directive", type: i1.BrnCalendarGrid, selector: "[brnCalendarGrid]" }, { kind: "directive", type: i1.BrnCalendarHeader, selector: "[brnCalendarHeader]", inputs: ["id"] }, { kind: "directive", type: i1.BrnCalendarNextButton, selector: "[brnCalendarNextButton]" }, { kind: "directive", type: i1.BrnCalendarPreviousButton, selector: "[brnCalendarPreviousButton]" }, { kind: "directive", type: i1.BrnCalendarWeek, selector: "[brnCalendarWeek]" }, { kind: "directive", type: i1.BrnCalendarWeekday, selector: "[brnCalendarWeekday]" }, { kind: "directive", type: i1.BrnCalendarCell, selector: "[brnCalendarCell]" }, { kind: "directive", type: i1.BrnCalendarMonthSelect, selector: "brnSelect[brnCalendarMonthSelect],hlm-select[brnCalendarMonthSelect]" }, { kind: "directive", type: i1.BrnCalendarYearSelect, selector: "brnSelect[brnCalendarYearSelect],hlm-select[brnCalendarYearSelect]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: i2.HlmSelect, selector: "[hlmSelect],hlm-select" }, { kind: "component", type: i2.HlmSelectContent, selector: "hlm-select-content", inputs: ["showScroll"] }, { kind: "directive", type: i2.HlmSelectGroup, selector: "[hlmSelectGroup],hlm-select-group" }, { kind: "component", type: i2.HlmSelectItem, selector: "hlm-select-item" }, { kind: "directive", type: i2.HlmSelectPortal, selector: "[hlmSelectPortal]" }, { kind: "component", type: i2.HlmSelectTrigger, selector: "hlm-select-trigger", inputs: ["class", "buttonId", "aria-labelledby", "ariaDescribedby", "wrapperDisabled", "size", "forceInvalid"] }, { kind: "directive", type: i2.HlmSelectValue, selector: "[hlmSelectValue],hlm-select-value" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.HlmBtn, selector: "button[hlmBtn], a[hlmBtn]", inputs: ["variant", "size", "class", "type"], exportAs: ["hlmBtn"] }], viewProviders: [provideIcons({ lucideChevronLeft, lucideChevronRight })], changeDetection: i0.ChangeDetectionStrategy.OnPush });
144
144
  }
145
145
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCalendar, decorators: [{
146
146
  type: Component,
@@ -390,7 +390,7 @@ class HlmCalendarMulti {
390
390
  </tbody>
391
391
  </table>
392
392
  </div>
393
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.BrnCalendarCellButton, selector: "button[brnCalendarCellButton]", inputs: ["date"] }, { kind: "directive", type: i1.BrnCalendarGrid, selector: "[brnCalendarGrid]" }, { kind: "directive", type: i1.BrnCalendarHeader, selector: "[brnCalendarHeader]", inputs: ["id"] }, { kind: "directive", type: i1.BrnCalendarNextButton, selector: "[brnCalendarNextButton]" }, { kind: "directive", type: i1.BrnCalendarPreviousButton, selector: "[brnCalendarPreviousButton]" }, { kind: "directive", type: i1.BrnCalendarWeek, selector: "[brnCalendarWeek]" }, { kind: "directive", type: i1.BrnCalendarWeekday, selector: "[brnCalendarWeekday]" }, { kind: "directive", type: i1.BrnCalendarCell, selector: "[brnCalendarCell]" }, { kind: "directive", type: i1.BrnCalendarMonthSelect, selector: "brnSelect[brnCalendarMonthSelect],hlm-select[brnCalendarMonthSelect]" }, { kind: "directive", type: i1.BrnCalendarYearSelect, selector: "brnSelect[brnCalendarYearSelect],hlm-select[brnCalendarYearSelect]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.HlmSelect, selector: "[hlmSelect],hlm-select" }, { kind: "component", type: i2.HlmSelectContent, selector: "hlm-select-content", inputs: ["showScroll"] }, { kind: "directive", type: i2.HlmSelectGroup, selector: "[hlmSelectGroup],hlm-select-group" }, { kind: "component", type: i2.HlmSelectItem, selector: "hlm-select-item" }, { kind: "directive", type: i2.HlmSelectPortal, selector: "[hlmSelectPortal]" }, { kind: "component", type: i2.HlmSelectTrigger, selector: "hlm-select-trigger", inputs: ["class", "buttonId", "ariaDescribedby", "wrapperDisabled", "size", "forceInvalid"] }, { kind: "directive", type: i2.HlmSelectValue, selector: "[hlmSelectValue],hlm-select-value" }, { kind: "directive", type: i3.HlmBtn, selector: "button[hlmBtn], a[hlmBtn]", inputs: ["variant", "size", "class", "type"], exportAs: ["hlmBtn"] }], viewProviders: [provideIcons({ lucideChevronLeft, lucideChevronRight })], changeDetection: i0.ChangeDetectionStrategy.OnPush });
393
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1.BrnCalendarCellButton, selector: "button[brnCalendarCellButton]", inputs: ["date"] }, { kind: "directive", type: i1.BrnCalendarGrid, selector: "[brnCalendarGrid]" }, { kind: "directive", type: i1.BrnCalendarHeader, selector: "[brnCalendarHeader]", inputs: ["id"] }, { kind: "directive", type: i1.BrnCalendarNextButton, selector: "[brnCalendarNextButton]" }, { kind: "directive", type: i1.BrnCalendarPreviousButton, selector: "[brnCalendarPreviousButton]" }, { kind: "directive", type: i1.BrnCalendarWeek, selector: "[brnCalendarWeek]" }, { kind: "directive", type: i1.BrnCalendarWeekday, selector: "[brnCalendarWeekday]" }, { kind: "directive", type: i1.BrnCalendarCell, selector: "[brnCalendarCell]" }, { kind: "directive", type: i1.BrnCalendarMonthSelect, selector: "brnSelect[brnCalendarMonthSelect],hlm-select[brnCalendarMonthSelect]" }, { kind: "directive", type: i1.BrnCalendarYearSelect, selector: "brnSelect[brnCalendarYearSelect],hlm-select[brnCalendarYearSelect]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.HlmSelect, selector: "[hlmSelect],hlm-select" }, { kind: "component", type: i2.HlmSelectContent, selector: "hlm-select-content", inputs: ["showScroll"] }, { kind: "directive", type: i2.HlmSelectGroup, selector: "[hlmSelectGroup],hlm-select-group" }, { kind: "component", type: i2.HlmSelectItem, selector: "hlm-select-item" }, { kind: "directive", type: i2.HlmSelectPortal, selector: "[hlmSelectPortal]" }, { kind: "component", type: i2.HlmSelectTrigger, selector: "hlm-select-trigger", inputs: ["class", "buttonId", "aria-labelledby", "ariaDescribedby", "wrapperDisabled", "size", "forceInvalid"] }, { kind: "directive", type: i2.HlmSelectValue, selector: "[hlmSelectValue],hlm-select-value" }, { kind: "directive", type: i3.HlmBtn, selector: "button[hlmBtn], a[hlmBtn]", inputs: ["variant", "size", "class", "type"], exportAs: ["hlmBtn"] }], viewProviders: [provideIcons({ lucideChevronLeft, lucideChevronRight })], changeDetection: i0.ChangeDetectionStrategy.OnPush });
394
394
  }
395
395
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCalendarMulti, decorators: [{
396
396
  type: Component,
@@ -651,7 +651,7 @@ class HlmCalendarRange {
651
651
  </tbody>
652
652
  </table>
653
653
  </div>
654
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.BrnCalendarCellButton, selector: "button[brnCalendarCellButton]", inputs: ["date"] }, { kind: "directive", type: i1.BrnCalendarGrid, selector: "[brnCalendarGrid]" }, { kind: "directive", type: i1.BrnCalendarHeader, selector: "[brnCalendarHeader]", inputs: ["id"] }, { kind: "directive", type: i1.BrnCalendarNextButton, selector: "[brnCalendarNextButton]" }, { kind: "directive", type: i1.BrnCalendarPreviousButton, selector: "[brnCalendarPreviousButton]" }, { kind: "directive", type: i1.BrnCalendarWeek, selector: "[brnCalendarWeek]" }, { kind: "directive", type: i1.BrnCalendarWeekday, selector: "[brnCalendarWeekday]" }, { kind: "directive", type: i1.BrnCalendarCell, selector: "[brnCalendarCell]" }, { kind: "directive", type: i1.BrnCalendarMonthSelect, selector: "brnSelect[brnCalendarMonthSelect],hlm-select[brnCalendarMonthSelect]" }, { kind: "directive", type: i1.BrnCalendarYearSelect, selector: "brnSelect[brnCalendarYearSelect],hlm-select[brnCalendarYearSelect]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: i2.HlmSelect, selector: "[hlmSelect],hlm-select" }, { kind: "component", type: i2.HlmSelectContent, selector: "hlm-select-content", inputs: ["showScroll"] }, { kind: "directive", type: i2.HlmSelectGroup, selector: "[hlmSelectGroup],hlm-select-group" }, { kind: "component", type: i2.HlmSelectItem, selector: "hlm-select-item" }, { kind: "directive", type: i2.HlmSelectPortal, selector: "[hlmSelectPortal]" }, { kind: "component", type: i2.HlmSelectTrigger, selector: "hlm-select-trigger", inputs: ["class", "buttonId", "ariaDescribedby", "wrapperDisabled", "size", "forceInvalid"] }, { kind: "directive", type: i2.HlmSelectValue, selector: "[hlmSelectValue],hlm-select-value" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.HlmBtn, selector: "button[hlmBtn], a[hlmBtn]", inputs: ["variant", "size", "class", "type"], exportAs: ["hlmBtn"] }], viewProviders: [provideIcons({ lucideChevronLeft, lucideChevronRight })], changeDetection: i0.ChangeDetectionStrategy.OnPush });
654
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1.BrnCalendarCellButton, selector: "button[brnCalendarCellButton]", inputs: ["date"] }, { kind: "directive", type: i1.BrnCalendarGrid, selector: "[brnCalendarGrid]" }, { kind: "directive", type: i1.BrnCalendarHeader, selector: "[brnCalendarHeader]", inputs: ["id"] }, { kind: "directive", type: i1.BrnCalendarNextButton, selector: "[brnCalendarNextButton]" }, { kind: "directive", type: i1.BrnCalendarPreviousButton, selector: "[brnCalendarPreviousButton]" }, { kind: "directive", type: i1.BrnCalendarWeek, selector: "[brnCalendarWeek]" }, { kind: "directive", type: i1.BrnCalendarWeekday, selector: "[brnCalendarWeekday]" }, { kind: "directive", type: i1.BrnCalendarCell, selector: "[brnCalendarCell]" }, { kind: "directive", type: i1.BrnCalendarMonthSelect, selector: "brnSelect[brnCalendarMonthSelect],hlm-select[brnCalendarMonthSelect]" }, { kind: "directive", type: i1.BrnCalendarYearSelect, selector: "brnSelect[brnCalendarYearSelect],hlm-select[brnCalendarYearSelect]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: i2.HlmSelect, selector: "[hlmSelect],hlm-select" }, { kind: "component", type: i2.HlmSelectContent, selector: "hlm-select-content", inputs: ["showScroll"] }, { kind: "directive", type: i2.HlmSelectGroup, selector: "[hlmSelectGroup],hlm-select-group" }, { kind: "component", type: i2.HlmSelectItem, selector: "hlm-select-item" }, { kind: "directive", type: i2.HlmSelectPortal, selector: "[hlmSelectPortal]" }, { kind: "component", type: i2.HlmSelectTrigger, selector: "hlm-select-trigger", inputs: ["class", "buttonId", "aria-labelledby", "ariaDescribedby", "wrapperDisabled", "size", "forceInvalid"] }, { kind: "directive", type: i2.HlmSelectValue, selector: "[hlmSelectValue],hlm-select-value" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.HlmBtn, selector: "button[hlmBtn], a[hlmBtn]", inputs: ["variant", "size", "class", "type"], exportAs: ["hlmBtn"] }], viewProviders: [provideIcons({ lucideChevronLeft, lucideChevronRight })], changeDetection: i0.ChangeDetectionStrategy.OnPush });
655
655
  }
656
656
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmCalendarRange, decorators: [{
657
657
  type: Component,
@@ -1,6 +1,6 @@
1
1
  # Data Table (`@egose/shadcn-theme-ng/data-table`)
2
2
 
3
- A generic, TanStack-powered data table with sorting, filtering, pagination, row selection, column visibility, and an optional card-grid layout — equivalent to combining [shadcn/ui Table](https://ui.shadcn.com/docs/components/table) with the [Spartan data-table guide](https://www.spartan.ng/components/data-table). The caller passes `columns` (and optionally `gridColumns`); the table owns its state internally and notifies via outputs.
3
+ A generic, TanStack-powered data table with sorting, filtering, pagination, row selection, column visibility, and an optional card-grid layout. The caller supplies `columns` and `data`; the table manages its interaction state unless the caller supplies controlled sorting or a server page.
4
4
 
5
5
  > **Ships as:** `@egose/shadcn-theme-ng/data-table` and `@egose/shadcn-theme-ng-tw/data-table` (the `tw:`-prefixed Tailwind variant). See the [package README](../../README.md) for install steps, peer dependencies, Tailwind setup, and testing/release guidance. Do not publish this project directory independently.
6
6
 
@@ -18,7 +18,7 @@ npm install @egose/shadcn-theme-ng-tw @tanstack/angular-table
18
18
 
19
19
  ## Imports
20
20
 
21
- All public symbols are re-exported from `projects/data-table/src/public-api.ts`:
21
+ Import the table, its standalone controls, and their configuration types from the same subpath:
22
22
 
23
23
  ```ts
24
24
  import {
@@ -32,9 +32,14 @@ import {
32
32
  EgTableHeadSelection,
33
33
  EgTableRowSelection,
34
34
  defaultEgDataTableFeatures,
35
+ provideEgDataTableLabels,
35
36
  type EgDataTableFeatures,
37
+ type EgDataTableGridSortContext,
38
+ type EgDataTableLabels,
36
39
  type EgDataTableLayout,
37
40
  type EgPaginatedResponse,
41
+ type EgUnknownTotalPage,
42
+ type EgDataTablePaginationChange,
38
43
  } from '@egose/shadcn-theme-ng/data-table';
39
44
  // tw variant: swap to '@egose/shadcn-theme-ng-tw/data-table'
40
45
  ```
@@ -74,7 +79,7 @@ export class PaymentsComponent {
74
79
 
75
80
  ## Server mode
76
81
 
77
- Pass `data` as a page slice with `manualPagination` set. The slice renders as-is — sorting and filtering are not applied client-side. Page, sort and filter interactions emit `pageChange` / `pageSizeChange` / `sortingChange` / `filterChange` (`columnFiltersChange`) so the caller can fetch the next slice:
82
+ Pass `data` as a page slice with `manualPagination` set. Sorting and filtering are applied by the server. Handle `paginationChange` once per interaction to get both `pageIndex` (zero-based) and `pageSize`. Handle `sortingChange` and choose `filterChange` for the toolbar query or `columnFiltersChange` for the full column filter state:
78
83
 
79
84
  ```ts
80
85
  @Component({
@@ -86,7 +91,9 @@ Pass `data` as a page slice with `manualPagination` set. The slice renders as-is
86
91
  [data]="page()"
87
92
  [manualPagination]="true"
88
93
  [isLoading]="loading()"
89
- (pageChange)="load($event)"
94
+ [paginationDisabled]="loading()"
95
+ [resetPageOnSizeChange]="true"
96
+ (paginationChange)="load($event.pageIndex, $event.pageSize)"
90
97
  />
91
98
  `,
92
99
  })
@@ -94,12 +101,29 @@ export class ServerPaymentsComponent {
94
101
  protected readonly page = signal<EgPaginatedResponse<Payment> | null>(null);
95
102
  protected readonly loading = signal(true);
96
103
 
97
- load(pageIndex: number) {
98
- // fetch `/api/payments?page=${pageIndex}` then `page.set(response)`
104
+ load(pageIndex: number, pageSize: number) {
105
+ // Fetch the requested page, then set `page` to the returned slice.
99
106
  }
100
107
  }
101
108
  ```
102
109
 
110
+ The server page drives the displayed page index and size until a new slice arrives. `pageChange` and `pageSizeChange` remain available; subscribe to `paginationChange` when one action must trigger a single request. Its `reason` is `page`, `pageSize`, `data` (a client-side clamp), or `reset`. `resetPageOnSizeChange` starts at page 1; the default keeps the previous top row in view. `resetPagination()` returns to page 1 without changing the size; in server mode it requests that page if it differs from the displayed page.
111
+
112
+ For a cursor API, supply an `EgUnknownTotalPage<T>` with `items`, `pageIndex`, `limit`, `hasPrevious`, and `hasNext`. The footer shows the current page with Previous/Next buttons and omits the total and the first/last buttons. Use `[showPageSize]="false"` for a fixed-size cursor API. The caller keeps the cursor history and maps page requests to its own API. Both server page types honor `hasPrevious` and `hasNext`.
113
+
114
+ Set `paginationDisabled` to disable navigation and page-size changes without hiding the pager. It defaults to `false` independently of `isLoading`, so a server table can bind it to a pending request while using `keepRowsWhileLoading` to retain its rows. The standalone pager exposes the same behavior through `disabled`.
115
+
116
+ ### Client-side pagination options
117
+
118
+ - `preservePageOnDataChange` keeps the current page on a refresh and clamps it when fewer pages remain. Sorting, column filtering, and changes to the `filterRows` function still start on page 1. These automatic adjustments emit `paginationChange` only, with reason `data` (clamp) or `reset` (query). Call `resetPagination()` for query changes applied outside the table.
119
+ - `[paginate]="false"` shows all client rows, with filtering, sorting, selection, and the footer status still available. `hideFooter` controls the footer independently.
120
+
121
+ ### Switching datasets
122
+
123
+ Bind a stable string or number to `resetKey` (for example, `[resetKey]="selectedMonth()"`). A new key restores `initialSorting` (when uncontrolled), `initialColumnFilters`, and `initialColumnVisibility`, and returns the client table to page 1 at `defaultPageSize`. The toolbar input shows the restored string for `filterColumnId`, or clears an unbound search. Selection is cleared; `initialRowSelection` seeds the first dataset only.
124
+
125
+ Set `preservePageOnDataChange` separately to retain the client page on same-key refreshes. Selection on refresh follows the normal `getRowId` rules. A key change emits `filterChange` if the toolbar query changed, `columnFiltersChange` if the column filter state changed, and `selectionChange` if selection was cleared. Controlled sorting and server pagination remain caller-owned: supply the new server dataset's first page and update any external query state when switching keys.
126
+
103
127
  ## Selection, sorting, grid layout
104
128
 
105
129
  ```ts
@@ -116,6 +140,9 @@ export class ServerPaymentsComponent {
116
140
 
117
141
  - `enableSelection` auto-prepends a checkbox column; `selectionChange` emits the selected rows.
118
142
  - Define `readonly paymentId = (payment: Payment): string => payment.id` on the host. `getRowId` is a pure callback returning a unique, stable string per entity; keep the callback reference stable.
143
+ - `gridBreakpoint="(max-width: 767px)"` automatically uses cards when the media query matches and the table otherwise. This mode reuses `columns` if `gridColumns` is omitted, and replaces the manual layout toggle. The server and first hydration render use table layout.
144
+ - `showGridSort` adds a themed sort-column picker and direction button beside the toolbar actions in card view. Both layouts use the same sorting state. Use `[(sorting)]` with a writable value, or `[sorting]` and `(sortingChange)`, to share the state with another control. `initialSorting` sets the uncontrolled default on creation and on a dataset reset.
145
+ - `meta.label` supplies the readable name used by card labels, column menus, and inline sort buttons. Set it when the header is a custom component or contains markup.
119
146
  - `[(layout)]` toggles `'table' | 'grid'` (grid requires `gridColumns`). Column `meta: { hideInTable: true }` hides a column in table layout; `meta: { thumbnail: true }` renders it as the card banner.
120
147
  - Sortable plain-string headers get an inline sort button; richer headers should use `EgDataTableColumnHeader` via `flexRenderComponent` (no type arguments needed — its `column` input accepts any TanStack column through the `EgSortableColumn` structural type):
121
148
 
@@ -124,10 +151,31 @@ import { flexRenderComponent } from '@tanstack/angular-table';
124
151
  import { EgDataTableColumnHeader } from '@egose/shadcn-theme-ng/data-table';
125
152
 
126
153
  helper.accessor('email', {
154
+ meta: { label: 'Email' },
127
155
  header: ({ column }) => flexRenderComponent(EgDataTableColumnHeader, { inputs: { column, title: 'Email' } }),
128
156
  });
129
157
  ```
130
158
 
159
+ To replace the built-in grid sort controls, pass `[gridSortTemplate]="sortControls"` with `[showGridSort]="true"`. The template receives `options` (sortable column IDs and labels), `sorting`, and `setSorting` through `EgDataTableGridSortContext`. Applying a sort through the template follows the usual `sortingChange` contract.
160
+
161
+ ```html
162
+ <ng-template #sortControls let-options="options" let-setSorting="setSorting">
163
+ @for (option of options; track option.id) {
164
+ <button type="button" (click)="setSorting([{ id: option.id, desc: false }])">
165
+ {{ option.label }}
166
+ </button>
167
+ }
168
+ </ng-template>
169
+ ```
170
+
171
+ ### Styling, semantics, and loading
172
+
173
+ - `striped` applies alternating body-row backgrounds. `wrapCells` wraps long content and top-aligns body cells. `rowClass` accepts a pure `(row, layout) => ClassValue` callback for table rows and grid cards. Like `meta.headerClass` and `meta.cellClass`, it supports strings, arrays, and conditional class objects.
174
+ - Set `meta.headerClass` and `meta.cellClass` on a column for alignment, wrapping, or width overrides. Cell classes also apply to the value in a card's label/value pair.
175
+ - `caption` adds a native table caption. `meta.rowHeader` renders a column's table body cells as `<th scope="row">`.
176
+ - `renderAsText` renders cell strings literally. Override it for a column with `meta.renderAsText`. By default string results are sanitized HTML; Angular templates and component renderers work in either mode.
177
+ - `keepRowsWhileLoading` preserves visible rows and marks the table busy while refreshing. `loadingTemplate` replaces the initial spinner; `refreshingTemplate` supplies an optional indicator while rows stay visible.
178
+
131
179
  ### Selection identity and scope
132
180
 
133
181
  - **Stable IDs:** supply `getRowId` whenever rows can be refreshed, reordered, or fetched from a server. Selection follows IDs still present in the supplied rows, and refreshes emit the current objects, not stale snapshots. Removed IDs are discarded and are not selected if they later return. Changing the callback clears selection.
@@ -136,6 +184,23 @@ helper.accessor('email', {
136
184
  - **Without `getRowId`:** existing positional `initialRowSelection` keys (`'0'`, `'1'`, etc.) remain supported for the initial rows. Replacing the source array (including a same-record refresh) or changing the `filterRows` result array clears selection rather than transferring an index to a different entity. Built-in sorting/filtering/paging with the same source array preserves it. This intentionally tightens the former unsafe positional behavior.
137
185
  - **Updates and outputs:** update row arrays/objects immutably; in-place mutations are not tracked. `initialRowSelection` seeds only IDs present on initialization; later seed changes are ignored. `selectionChange` fires once on initialization, then when the selected objects or their source order change, including removal and refreshed object references. Unchanged selections do not re-emit for sorting, layout, or other unrelated state changes. IDs must be unique and must not be reused for different entities.
138
186
 
187
+ ## Localization
188
+
189
+ Use `provideEgDataTableLabels` in app or ancestor component `providers`. It covers visible text, status formatters, and accessible names for the table and standalone controls, with English defaults for omitted labels. Explicit `emptyMessage`, `filterLabel`, `filterPlaceholder`, and selection `ariaLabel` inputs take precedence. Formatters receive numbers so they can use the app's number formatting and pluralization. `pageStatus` receives a one-based page number and an undefined page count for unknown totals.
190
+
191
+ ```ts
192
+ import { provideEgDataTableLabels } from '@egose/shadcn-theme-ng/data-table';
193
+
194
+ const tableLabels = provideEgDataTableLabels({
195
+ rowsPerPage: 'Filas por página',
196
+ nextPage: 'Siguiente',
197
+ goToNextPage: 'Ir a la página siguiente',
198
+ pageStatus: (page, count) => (count === undefined ? `Página ${page}` : `Página ${page} de ${count}`),
199
+ });
200
+
201
+ // Add tableLabels to your app or component's providers.
202
+ ```
203
+
139
204
  ## API reference
140
205
 
141
206
  | Symbol | Kind |
@@ -144,25 +209,37 @@ helper.accessor('email', {
144
209
  | `EgDataTableColumnHeader` | Sortable/hideable header component for `flexRenderComponent` usage (non-generic; takes `EgSortableColumn`) |
145
210
  | `EgSortableColumn` | Minimal structural column surface the header needs (any TanStack `Column` satisfies it) |
146
211
  | `EgDataTablePagination` | Standalone pager (`[tanStackTable]` DI) with page navigation + rows-per-page selector |
147
- | `EgDataTablePagination` | Standalone pager reading the table from `[tanStackTable]` DI |
148
212
  | `EgDataTableViewOptions` | Column-visibility dropdown reading the table from `[tanStackTable]` DI |
149
213
  | `EgTableHeadSelection` / `EgTableRowSelection` | Selection checkboxes (auto-used when `enableSelection`) |
150
214
  | `defaultEgDataTableFeatures` / `EgDataTableFeatures` | Default TanStack feature registry + type |
151
- | `EgPaginatedResponse` | Server page-slice interface |
215
+ | `EgPaginatedResponse` / `EgUnknownTotalPage` | Server page slices with and without a known total |
216
+ | `EgDataTablePaginationChange` | Zero-based page index, page size, and reason for a pagination change |
217
+ | `EgDataTableGridSortContext` | Sort options, current sorting, and setter passed to a custom grid sort template |
218
+ | `provideEgDataTableLabels` / `EgDataTableLabels` | Scoped labels and status formatters for the data table and standalone controls |
152
219
  | `EgDataTableLayout` | `'table' \| 'grid'` |
153
220
  | `EgDataTableImports` / `EgDataTableModule` | Standalone imports array / NgModule |
154
221
 
155
- Key `EgDataTable` inputs: `columns` (required), `gridColumns`, `data` (array, or page slice with `manualPagination`), `manualPagination`, `size` (`sm` / `default` / `lg` density for toolbar, table, and pagination; type scale untouched), `filterRows` (caller pre-filter for client rows, before built-in filtering/sorting/pagination; ignored in server mode), `features`, `isLoading`, `emptyMessage`, `enableSelection`, `hideFooter`, `layout` (model), `showLayoutToggle`, `showToolbar`, `filterColumnId`, `filterPlaceholder`, `showColumnToggle`, `defaultPageSize`, `showPageSize`, `pageSizes`, plus `initialSorting` / `initialColumnFilters` / `initialColumnVisibility` / `initialRowSelection` to seed state once at creation (later changes are ignored — subscribe to the corresponding `*Change` outputs instead).
222
+ | Inputs | Purpose |
223
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- |
224
+ | `columns` (required), `gridColumns`, `data`, `resetKey`, `getRowId`, `features` | Column definitions, rows or a server page, dataset and row identity, and TanStack features. |
225
+ | `manualPagination`, `paginate`, `preservePageOnDataChange`, `resetPageOnSizeChange`, `defaultPageSize`, `hideFooter`, `showPageSize`, `pageSizes`, `navMode` | Paging mode, page retention, and footer controls. |
226
+ | `paginationDisabled` | Disable pager interaction while keeping the footer visible. |
227
+ | `layout`, `gridBreakpoint`, `showLayoutToggle`, `showGridSort`, `gridSortTemplate`, `sorting` | Manual or responsive layout and shared sorting. |
228
+ | `showToolbar`, `filterColumnId`, `filterPlaceholder`, `filterLabel`, `showColumnToggle`, `toolbarActions`, `filterRows`, `enableSelection` | Filter, column visibility, toolbar content, and selection controls. |
229
+ | `isLoading`, `keepRowsWhileLoading`, `loadingTemplate`, `refreshingTemplate`, `emptyMessage`, `caption` | Loading, refresh, and empty states; table caption. |
230
+ | `size`, `class`, `striped`, `wrapCells`, `rowClass`, `renderAsText` | Density, styling, and literal cell rendering. |
231
+ | `initialSorting`, `initialColumnFilters`, `initialColumnVisibility` | Defaults on creation and on a dataset reset. |
232
+ | `initialRowSelection` | One-time seed, read at creation. |
156
233
 
157
- Outputs: `selectionChange` (also fires once on init, mirroring React's mount effect), `pageChange`, `pageSizeChange`, `rowClick`, `sortingChange`, `columnFiltersChange`, `filterChange` (toolbar input string), `columnVisibilityChange`.
234
+ Outputs: `selectionChange` (also fires once on init), `paginationChange`, `pageChange`, `pageSizeChange`, `rowClick`, `sortingChange`, `columnFiltersChange`, `filterChange` (toolbar input string), `columnVisibilityChange`.
158
235
 
159
- The toolbar (`showToolbar`) always renders the filter input: with `filterColumnId` it filters that column client-side (and `filterChange` mirrors the string); without it, keystrokes only emit `filterChange` so the caller can filter server-side. The column-visibility dropdown is opt-in via `showColumnToggle` (default `false`, requires `showToolbar`). `showColumnToggle` also enables hiding: the `Hide` item in `EgDataTableColumnHeader` only renders when it is true (TanStack `column.getCanHide()`), so a hidden column always has a way back via View; per-column `enableHiding: false` disables individual columns even then. `toolbarActions` takes an `ng-template` rendered on the right side of the toolbar row (built-ins stay left) — it renders the row even when `showToolbar` is false.
236
+ `showToolbar` enables the filter input. `filterLabel` supplies its accessible name. With `filterColumnId`, input changes filter the indicated column in client mode; without it, keystrokes only emit `filterChange`. `showColumnToggle` enables the View dropdown at all viewport widths, independently of the filter input. It also enables the `Hide` action in `EgDataTableColumnHeader`. Data columns can hide unless `enableHiding` is `false`; display columns stay fixed unless `enableHiding` is `true`. `toolbarActions` renders a custom template to the right of the built-in controls.
160
237
 
161
238
  `size` scales spatial density one step down/up (`sm`: `h-8` headers, `p-1` cells, `h-7` buttons; `lg`: `h-12` headers, `p-3` cells, `h-9` buttons; filter input, page-size trigger, and pager meta texts follow). `EgDataTableColumnHeader` (consumer-instantiated via `flexRenderComponent`) takes the same `size` — for reactive updates put every input in `bindings` (`inputBinding('size', ...)`, plus `column`/`title`, since `bindings` cannot mix with `inputs`).
162
239
 
163
240
  `rowClick` fires for table-row and grid-card clicks with the row's data. Clicks from nested interactive elements (buttons, links, inputs, checkboxes, selects) are ignored so selection checkboxes and row-action buttons keep working without also firing `rowClick`.
164
241
 
165
- The footer pager includes a rows-per-page selector (`pageSizes`, default `[10, 20, 30, 40, 50]`; the table's current size is appended when absent). In client mode the table re-paginates immediately; in server mode the change surfaces via `pageSizeChange` so the caller can refetch with the new limit. Set `showPageSize` to `false` to hide it. `navMode` switches the navigation buttons between `icons` (default), `text` (`First`/`Previous`/`Next`/`Last`), and `both`. `EgDataTablePagination` exposes the same `showStatus` / `showPageSize` / `pageSizes` / `navMode` inputs for custom compositions.
242
+ The footer pager includes a rows-per-page selector (`pageSizes`, default `[10, 20, 30, 40, 50]`; the table's current size is appended when absent). Set `showPageSize` to `false` to hide it. `navMode` switches the navigation buttons between `icons` (default), `text`, and `both`. Standalone `EgDataTablePagination` supports `showStatus`, `showPageSize`, `pageSizes`, `navMode`, `disabled`, and optional `hasPrevious`/`hasNext` limits. When composing it with your own TanStack table, set `manualPagination: true` and `pageCount: -1` for an unknown total. The pager shows the current page and Previous/Next only; bind `hasNext` to the API result because TanStack otherwise assumes another page exists.
166
243
 
167
244
  ## Related subpaths
168
245