@entifix/react-controls 0.22.1 → 0.22.3
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/dist/ui/organisms/entity-table/entity-table.d.ts +1 -1
- package/dist/ui/organisms/entity-table/entity-table.d.ts.map +1 -1
- package/dist/ui/organisms/entity-table/entity-table.js +73 -37
- package/dist/ui/organisms/entity-table/entity-table.js.map +1 -1
- package/dist/ui/organisms/entity-table/entity-table.types.d.ts +7 -0
- package/dist/ui/organisms/entity-table/entity-table.types.d.ts.map +1 -1
- package/dist/ui/organisms/entity-table/entity-table.types.js.map +1 -1
- package/dist/ui/organisms/entity-table/use-entity-table-columns.d.ts +4 -3
- package/dist/ui/organisms/entity-table/use-entity-table-columns.d.ts.map +1 -1
- package/dist/ui/organisms/entity-table/use-entity-table-columns.js +13 -5
- package/dist/ui/organisms/entity-table/use-entity-table-columns.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Entity } from '@entifix/core';
|
|
2
2
|
import type { EntityTableProps } from './entity-table.types.js';
|
|
3
|
-
export declare function EntityTable<TEntity extends Entity>({ entityConstructor, isLoading, skeleton, error, items, totalItems, currentPage, pageSize, onPageChange, onPageSizeChange, hrefFor, newHref, renderLink, onSelect, preferencesKey, hiddenColumns, showControls, pivotBreakpoint, filtering, sorting, onFilteringChange, onSortingChange, facets, selection, onSelectionChange, metadata, isMetadataLoading, onBulkUseCase, onUseCase, onRetry, bulkOutcomes, onBulkDismiss, onBulkRetry, isBulkRunning, children, }: EntityTableProps<TEntity>): import("react").JSX.Element;
|
|
3
|
+
export declare function EntityTable<TEntity extends Entity>({ entityConstructor, isLoading, skeleton, error, items, totalItems, currentPage, pageSize, onPageChange, onPageSizeChange, hrefFor, newHref, renderLink, onSelect, preferencesKey, hiddenColumns, showKey, showControls, pivotBreakpoint, filtering, sorting, onFilteringChange, onSortingChange, facets, selection, onSelectionChange, metadata, isMetadataLoading, onBulkUseCase, onUseCase, onRetry, bulkOutcomes, onBulkDismiss, onBulkRetry, isBulkRunning, children, }: EntityTableProps<TEntity>): import("react").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=entity-table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-table.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-table/entity-table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"entity-table.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-table/entity-table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,MAAM,EAcZ,MAAM,eAAe,CAAC;AAsDvB,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AA4DjC,wBAAgB,WAAW,CAAC,OAAO,SAAS,MAAM,EAAE,EAClD,iBAAiB,EACjB,SAAS,EACT,QAAe,EACf,KAAK,EACL,KAAK,EACL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,UAAyB,EACzB,QAAQ,EACR,cAAc,EACd,aAAa,EACb,OAAe,EACf,YAAmB,EACnB,eAAe,EACf,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,MAAM,EACN,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,iBAAyB,EACzB,aAAa,EACb,SAAS,EACT,OAAO,EACP,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAqB,EACrB,QAAQ,GACT,EAAE,gBAAgB,CAAC,OAAO,CAAC,+BAwhC3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { canNameRecord, emptySelection, extractMetaEntity, hierarchyOf, isSelected, queryPropertyFor, recordLabel, selectionSize, toggleSelected } from '@entifix/core';
|
|
3
|
+
import { canNameRecord, emptySelection, extractMetaEntity, hierarchyOf, isSelected, isTextMember, queryPropertyFor, recordLabel, selectionSize, toggleSelected } from '@entifix/core';
|
|
4
4
|
import { Fragment, useId, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import { useEntityNoun, useLocale, useT, useTranslateKey } from '../../../i18n/index.js';
|
|
6
6
|
import { availableUseCases, renderAnchor, useCasesForSurface } from '../../actions/index.js';
|
|
@@ -40,8 +40,12 @@ import { useResultAnnouncement } from './use-result-announcement.js';
|
|
|
40
40
|
* content that arrives below the fold anyway.
|
|
41
41
|
*/ const SKELETON_ROW_CAP = 5;
|
|
42
42
|
/** How many members a card shows as meta when none declares a `card` role. */ const UNDECLARED_META_CAP = 3;
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
/**
|
|
44
|
+
* The name of the leading column a table adds when nothing on screen names a
|
|
45
|
+
* row. Not a member name an entity can declare, so it never collides.
|
|
46
|
+
*/ const RECORD_COLUMN = '$record';
|
|
47
|
+
export function EntityTable({ entityConstructor, isLoading, skeleton = true, error, items, totalItems, currentPage, pageSize, onPageChange, onPageSizeChange, hrefFor, newHref, renderLink = renderAnchor, onSelect, preferencesKey, hiddenColumns, showKey = false, showControls = true, pivotBreakpoint, filtering, sorting, onFilteringChange, onSortingChange, facets, selection, onSelectionChange, metadata, isMetadataLoading = false, onBulkUseCase, onUseCase, onRetry, bulkOutcomes, onBulkDismiss, onBulkRetry, isBulkRunning = false, children }) {
|
|
48
|
+
var _ref, _ref1;
|
|
45
49
|
const t = useT();
|
|
46
50
|
// A descriptor's label is a runtime catalog key — the typed gate cannot see
|
|
47
51
|
// it, which is why a host's catalog check is what catches a typo.
|
|
@@ -50,7 +54,55 @@ export function EntityTable({ entityConstructor, isLoading, skeleton = true, err
|
|
|
50
54
|
const metaEntity = extractMetaEntity(entityConstructor);
|
|
51
55
|
const slots = readEntityTableSlots(children);
|
|
52
56
|
const [panel, setPanel] = useState('none');
|
|
53
|
-
const { columns, visibleColumns, hidden, setPersonalization } = useEntityTableColumns(entityConstructor, slots.columns, items[0], `entity-table:${(_ref = preferencesKey != null ? preferencesKey : metaEntity.key) != null ? _ref : metaEntity.name}`, hiddenColumns);
|
|
57
|
+
const { columns, visibleColumns: resolvedColumns, hidden, setPersonalization } = useEntityTableColumns(entityConstructor, slots.columns, items[0], `entity-table:${(_ref = preferencesKey != null ? preferencesKey : metaEntity.key) != null ? _ref : metaEntity.name}`, hiddenColumns, showKey);
|
|
58
|
+
const nameOf = useRecordLabel();
|
|
59
|
+
/**
|
|
60
|
+
* How a row names itself — to a screen reader on its checkbox, in a confirm
|
|
61
|
+
* dialog, a bulk result, a tree toggle: what the reader reads the row *as*
|
|
62
|
+
* ("Seleccionar Acme", never "Seleccionar fila 3" and never a whole id),
|
|
63
|
+
* through the one derivation every surface shares.
|
|
64
|
+
*/ const rowLabel = (item)=>nameOf(entityConstructor, item);
|
|
65
|
+
/**
|
|
66
|
+
* The column every row reads as — the entity's `labelMember`, else its
|
|
67
|
+
* declared card title, else the first **text** member that is not a key. A
|
|
68
|
+
* status, a quantity or a date is a value the record holds, never what it is
|
|
69
|
+
* called, which is the rule `recordLabel()` names a record by.
|
|
70
|
+
*/ const titleOf = (candidates)=>{
|
|
71
|
+
var _ref, _candidates_find;
|
|
72
|
+
return (_ref = (_candidates_find = candidates.find((column)=>column.name === metaEntity.labelMember)) != null ? _candidates_find : candidates.find((column)=>column.card === 'title')) != null ? _ref : candidates.find((column)=>canNameRecord(column) && isTextMember(column));
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* A record nothing on screen names — an order, a movement, a payout, or a
|
|
76
|
+
* row whose naming column the reader has hidden — gets a leading column of
|
|
77
|
+
* its own that reads as the record: its noun and short id, as every other
|
|
78
|
+
* surface names it. Without it the grid's link landed on a number or an
|
|
79
|
+
* enum, or on no cell at all.
|
|
80
|
+
*/ const namedTitle = titleOf(resolvedColumns);
|
|
81
|
+
/**
|
|
82
|
+
* The title column, held in view at the inline start while a grid wider than
|
|
83
|
+
* its container scrolls — the naming column, or the record column above.
|
|
84
|
+
*/ const stickyTitle = namedTitle != null ? namedTitle : {
|
|
85
|
+
name: RECORD_COLUMN,
|
|
86
|
+
key: RECORD_COLUMN,
|
|
87
|
+
label: entityNoun(metaEntity),
|
|
88
|
+
type: 'string',
|
|
89
|
+
sortable: false,
|
|
90
|
+
filterable: false,
|
|
91
|
+
order: -1,
|
|
92
|
+
readonly: false,
|
|
93
|
+
required: false,
|
|
94
|
+
linkLabelProperty: 'name',
|
|
95
|
+
linkSearchProperty: 'name',
|
|
96
|
+
linkSerialization: 'id',
|
|
97
|
+
resetOnClone: false,
|
|
98
|
+
card: 'title',
|
|
99
|
+
render: rowLabel,
|
|
100
|
+
virtual: true
|
|
101
|
+
};
|
|
102
|
+
const visibleColumns = namedTitle === undefined ? [
|
|
103
|
+
stickyTitle,
|
|
104
|
+
...resolvedColumns
|
|
105
|
+
] : resolvedColumns;
|
|
54
106
|
// A picker's table is choosing *one* value; a multi-selection there would
|
|
55
107
|
// offer a set to a form member that holds a single reference, and the two
|
|
56
108
|
// controls would fight over the same row. This is a wiring mistake rather
|
|
@@ -95,12 +147,7 @@ export function EntityTable({ entityConstructor, isLoading, skeleton = true, err
|
|
|
95
147
|
* table's own box picks one — at the width its visible columns need. A
|
|
96
148
|
* viewport breakpoint was wrong inside a split view, a drawer or a wizard
|
|
97
149
|
* step, and a JS measurement would guess during SSR and correct after mount.
|
|
98
|
-
*/
|
|
99
|
-
* The column every row reads as — the entity's `labelMember`, else its
|
|
100
|
-
* declared card title, else the first that can name a record — held in view
|
|
101
|
-
* at the inline start while a grid wider than its container scrolls.
|
|
102
|
-
*/ const stickyTitle = (_ref1 = (_visibleColumns_find = visibleColumns.find((column)=>column.name === metaEntity.labelMember)) != null ? _visibleColumns_find : visibleColumns.find((column)=>column.card === 'title')) != null ? _ref1 : visibleColumns.find(canNameRecord);
|
|
103
|
-
const widths = pivotWidths({
|
|
150
|
+
*/ const widths = pivotWidths({
|
|
104
151
|
columns: visibleColumns,
|
|
105
152
|
title: stickyTitle,
|
|
106
153
|
roleOf: cardRoles(visibleColumns),
|
|
@@ -129,21 +176,22 @@ export function EntityTable({ entityConstructor, isLoading, skeleton = true, err
|
|
|
129
176
|
* dimming them through opacity took the text under the contrast a reader
|
|
130
177
|
* needs, on every page change.
|
|
131
178
|
*/ const busy = isLoading || undefined;
|
|
132
|
-
const nameOf = useRecordLabel();
|
|
133
179
|
/**
|
|
134
180
|
* The column a row reads *as*: the member `recordLabel()` names it by, when
|
|
135
181
|
* the reader has not hidden that column; else one declared `card: 'title'`;
|
|
136
|
-
* else the first visible one it filled in that is not a key
|
|
137
|
-
*
|
|
182
|
+
* else the first visible text one it filled in that is not a key; else the
|
|
183
|
+
* table's title column, whose empty cell then reads as the record's label.
|
|
184
|
+
* So every row has exactly one open link, and it is never a number or an
|
|
185
|
+
* enum.
|
|
138
186
|
*/ const declaredTitle = visibleColumns.find((column)=>column.card === 'title');
|
|
139
187
|
const linkColumn = (item)=>{
|
|
140
|
-
var _ref;
|
|
188
|
+
var _ref, _ref1;
|
|
141
189
|
const label = recordLabel(entityConstructor, item);
|
|
142
190
|
const named = label.kind === 'fallback' ? undefined : visibleColumns.find((column)=>column.name === label.member.name);
|
|
143
|
-
return (_ref = named != null ? named : declaredTitle) != null ?
|
|
191
|
+
return (_ref = (_ref1 = named != null ? named : declaredTitle) != null ? _ref1 : visibleColumns.find((column)=>{
|
|
144
192
|
const value = item[column.name];
|
|
145
|
-
return canNameRecord(column) && value != null && String(value) !== '';
|
|
146
|
-
});
|
|
193
|
+
return canNameRecord(column) && isTextMember(column) && value != null && String(value) !== '';
|
|
194
|
+
})) != null ? _ref : stickyTitle;
|
|
147
195
|
};
|
|
148
196
|
/**
|
|
149
197
|
* What a record's card shows, by each member's declared `card` role or the
|
|
@@ -179,10 +227,12 @@ export function EntityTable({ entityConstructor, isLoading, skeleton = true, err
|
|
|
179
227
|
* down it heard "Open" once per row; the title says which record it opens.
|
|
180
228
|
* A picker's rows are chosen, not opened, so they stay plain.
|
|
181
229
|
*/ const renderCell = (column, item)=>{
|
|
182
|
-
|
|
183
|
-
|
|
230
|
+
if (linkColumn(item).name !== column.name) return renderValue(column, item);
|
|
231
|
+
// The row's title cell left empty still reads as the record.
|
|
232
|
+
const raw = item[column.name];
|
|
233
|
+
const blank = column.render === undefined && (raw == null || raw === '');
|
|
234
|
+
const value = blank ? rowLabel(item) : renderValue(column, item);
|
|
184
235
|
if (hrefFor === undefined || onSelect !== undefined) return value;
|
|
185
|
-
if (((_linkColumn = linkColumn(item)) == null ? void 0 : _linkColumn.name) !== column.name) return value;
|
|
186
236
|
return renderLink({
|
|
187
237
|
href: hrefFor(item.id),
|
|
188
238
|
className: linkClassName,
|
|
@@ -256,12 +306,6 @@ export function EntityTable({ entityConstructor, isLoading, skeleton = true, err
|
|
|
256
306
|
anchorIndex.current = undefined;
|
|
257
307
|
setSelection(next);
|
|
258
308
|
};
|
|
259
|
-
/**
|
|
260
|
-
* How a row names itself — to a screen reader on its checkbox, in a confirm
|
|
261
|
-
* dialog, a bulk result, a tree toggle: what the reader reads the row *as*
|
|
262
|
-
* ("Seleccionar Acme", never "Seleccionar fila 3" and never a whole id),
|
|
263
|
-
* through the one derivation every surface shares.
|
|
264
|
-
*/ const rowLabel = (item)=>nameOf(entityConstructor, item);
|
|
265
309
|
const selectionCell = (item, index, // Passed in rather than closed over: this is only ever called under
|
|
266
310
|
// `selectable`, which already proves the selection exists, and reading the
|
|
267
311
|
// optional prop here would add a fallback arm that nothing can reach.
|
|
@@ -378,7 +422,7 @@ export function EntityTable({ entityConstructor, isLoading, skeleton = true, err
|
|
|
378
422
|
const locale = useLocale();
|
|
379
423
|
const panelId = useId();
|
|
380
424
|
const keys = sortKeys(sorting, columns);
|
|
381
|
-
const activeFilters = (
|
|
425
|
+
const activeFilters = (_ref1 = filtering == null ? void 0 : filtering.values.length) != null ? _ref1 : 0;
|
|
382
426
|
const results = t('table.results', {
|
|
383
427
|
count: totalItems
|
|
384
428
|
});
|
|
@@ -587,7 +631,7 @@ export function EntityTable({ entityConstructor, isLoading, skeleton = true, err
|
|
|
587
631
|
},
|
|
588
632
|
// A focused cell scrolled sideways is never left under the
|
|
589
633
|
// sticky title column (WCAG 2.4.11).
|
|
590
|
-
containerStyle:
|
|
634
|
+
containerStyle: {
|
|
591
635
|
scrollPaddingInlineStart: `${columnWidth(stickyTitle)}rem`
|
|
592
636
|
},
|
|
593
637
|
children: [
|
|
@@ -713,15 +757,7 @@ export function EntityTable({ entityConstructor, isLoading, skeleton = true, err
|
|
|
713
757
|
},
|
|
714
758
|
children: /*#__PURE__*/ _jsx(EntityRecordCard, {
|
|
715
759
|
// The same renderers as the grid, so the two layouts agree.
|
|
716
|
-
title: parts.title
|
|
717
|
-
href: hrefFor(item.id),
|
|
718
|
-
className: linkClassName,
|
|
719
|
-
children: rowLabel(item),
|
|
720
|
-
intent: {
|
|
721
|
-
kind: 'open',
|
|
722
|
-
id: item.id
|
|
723
|
-
}
|
|
724
|
-
}) : renderCell(parts.title, item),
|
|
760
|
+
title: renderCell(parts.title, item),
|
|
725
761
|
subtitle: parts.subtitle === undefined ? undefined : renderCell(parts.subtitle, item),
|
|
726
762
|
badges: parts.badges.map((column)=>({
|
|
727
763
|
key: column.name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ui/organisms/entity-table/entity-table.tsx"],"sourcesContent":["'use client';\n\nimport {\n canNameRecord,\n emptySelection,\n type Entity,\n type EntityId,\n type EntitySelection,\n type EntitySorting,\n extractMetaEntity,\n type FilterGroup,\n hierarchyOf,\n isSelected,\n queryPropertyFor,\n recordLabel,\n selectionSize,\n toggleSelected,\n type UseCaseDescriptor,\n} from '@entifix/core';\nimport {\n Fragment,\n type ReactNode,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport {\n useEntityNoun,\n useLocale,\n useT,\n useTranslateKey,\n} from '../../../i18n/index.js';\nimport {\n availableUseCases,\n renderAnchor,\n useCasesForSurface,\n} from '../../actions/index.js';\nimport { useVerbInvoker } from '../../actions/use-verb-invoker.js';\nimport { Button, button } from '../../atoms/button/index.js';\nimport { CellValue, useRecordLabel } from '../../atoms/cell-value/index.js';\nimport { Checkbox } from '../../atoms/field/index.js';\nimport { Skeleton } from '../../atoms/skeleton/index.js';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeaderCell,\n TableMessageRow,\n TableRow,\n} from '../../atoms/table/index.js';\nimport { linkClassName } from '../../atoms/text/index.js';\nimport {\n ActionBar,\n type ActionBarItem,\n itemsForUseCases,\n} from '../../molecules/action-bar/index.js';\nimport { BulkActionBar } from '../../molecules/bulk-action-bar/index.js';\nimport { BulkResult } from '../../molecules/bulk-result/index.js';\nimport { ColumnSettings } from '../../molecules/column-settings/index.js';\nimport { EntityRecordCard } from '../../molecules/entity-record-card/index.js';\nimport { FilterBuilder } from '../../molecules/filter-builder/index.js';\nimport { FilterChips } from '../../molecules/filter-chips/index.js';\nimport { LoadingBoundary } from '../../molecules/loading-boundary/index.js';\nimport { Pagination } from '../../molecules/pagination/index.js';\nimport { RegionState } from '../../molecules/region-state/index.js';\nimport { SortBuilder } from '../../molecules/sort-builder/index.js';\nimport { TableToolbar } from '../../molecules/table-toolbar/index.js';\nimport { useFocusOnLoss } from '../../utils/use-focus-on-arrival.js';\nimport { cardRoles } from './card-roles.js';\nimport type {\n EntityTableColumn,\n EntityTableProps,\n} from './entity-table.types.js';\nimport { readEntityTableSlots } from './entity-table-slots.js';\nimport { shownTreeRows, TreeCell, treeRows } from './entity-table-tree.js';\nimport { nextHeaderSorting, sortKeys } from './header-sort.js';\nimport {\n ACTIONS_WIDTH,\n columnWidth,\n pivotClasses,\n pivotWidths,\n SELECTION_WIDTH,\n} from './pivot.js';\nimport { useEntityTableColumns } from './use-entity-table-columns.js';\nimport { useResultAnnouncement } from './use-result-announcement.js';\n\ntype Panel = 'none' | 'filters' | 'sorting';\n\n/**\n * How many placeholder rows the built-in skeleton draws.\n *\n * The column count is taken from the real geometry, because that is the axis a\n * mismatch shifts; the row count is capped instead of tracking `pageSize`, since\n * a fifty-row page would otherwise paint fifty shimmer rows to stand in for\n * content that arrives below the fold anyway.\n */\nconst SKELETON_ROW_CAP = 5;\n\n/** How many members a card shows as meta when none declares a `card` role. */\nconst UNDECLARED_META_CAP = 3;\n\n/**\n * A table that builds itself from an entity's metadata: columns, labels, value\n * formatting and the filter/sort controls all come from `@accessor()`\n * declarations, so listing a new entity needs no bespoke table.\n *\n * Three things layer on top of that default:\n * - **personalization** — column order and visibility, persisted through the\n * UI-preferences port (so it survives reloads and can later move server-side);\n * - **responsiveness** — below `pivotBreakpoint` rows pivot into label/value\n * cards instead of scrolling sideways;\n * - **slots** — `<EntityColumn>` / `<EntityTableHeader>` / `<EntityTableRow>` /\n * `<EntityTableToolbar>` children override any part of the default rendering.\n */\n/**\n * What a pending verb will act on once it is confirmed.\n *\n * A form has one record; a table has a row or a selection, and those reach two\n * different handlers with two different payloads. Carrying the selection itself\n * rather than reading it back at confirm time also removes a branch that could\n * not happen: the bulk bar only renders inside a truthy selection.\n */\ntype PendingTarget<TEntity extends Entity> =\n | { kind: 'row'; item: TEntity }\n | { kind: 'selection'; selection: EntitySelection<TEntity> };\n\nexport function EntityTable<TEntity extends Entity>({\n entityConstructor,\n isLoading,\n skeleton = true,\n error,\n items,\n totalItems,\n currentPage,\n pageSize,\n onPageChange,\n onPageSizeChange,\n hrefFor,\n newHref,\n renderLink = renderAnchor,\n onSelect,\n preferencesKey,\n hiddenColumns,\n showControls = true,\n pivotBreakpoint,\n filtering,\n sorting,\n onFilteringChange,\n onSortingChange,\n facets,\n selection,\n onSelectionChange,\n metadata,\n isMetadataLoading = false,\n onBulkUseCase,\n onUseCase,\n onRetry,\n bulkOutcomes,\n onBulkDismiss,\n onBulkRetry,\n isBulkRunning = false,\n children,\n}: EntityTableProps<TEntity>) {\n const t = useT();\n // A descriptor's label is a runtime catalog key — the typed gate cannot see\n // it, which is why a host's catalog check is what catches a typo.\n const translateKey = useTranslateKey();\n const entityNoun = useEntityNoun();\n const metaEntity = extractMetaEntity(entityConstructor);\n const slots = readEntityTableSlots<TEntity>(children);\n const [panel, setPanel] = useState<Panel>('none');\n\n const { columns, visibleColumns, hidden, setPersonalization } =\n useEntityTableColumns<TEntity>(\n entityConstructor,\n slots.columns,\n items[0],\n `entity-table:${preferencesKey ?? metaEntity.key ?? metaEntity.name}`,\n hiddenColumns,\n );\n\n // A picker's table is choosing *one* value; a multi-selection there would\n // offer a set to a form member that holds a single reference, and the two\n // controls would fight over the same row. This is a wiring mistake rather\n // than a state, so it costs the render — the same call `EntityForm` makes\n // for a link source aimed at a member no picker can edit.\n if (onSelect !== undefined && selection !== undefined) {\n throw new Error(\n 'EntityTable was given both `onSelect` and `selection`. A picker picks one ' +\n 'row and a selection accumulates many, so the row control cannot be both. ' +\n 'Drop `selection` inside a picker, or drop `onSelect` outside one.',\n );\n }\n\n /**\n * The selection, or `undefined` when the table is not selectable at all.\n *\n * One value rather than a `selection` prop beside a `selectable` boolean:\n * two of them means every render site has to re-test both, and the second\n * test is unreachable — which reads as a defensive check and is really dead\n * code the coverage gate then cannot close.\n */\n const selectionState =\n selection !== undefined && onSelectionChange !== undefined\n ? selection\n : undefined;\n const selectable = selectionState !== undefined;\n const rowUseCases = useCasesForSurface('row-menu', metadata?.useCases);\n const bulkUseCases = useCasesForSurface('bulk-bar', metadata?.useCases);\n const toolbarUseCases = useCasesForSurface(\n 'table-toolbar',\n metadata?.useCases,\n );\n const hasRowMenu = rowUseCases.length > 0 && onUseCase !== undefined;\n\n /**\n * What a `context-independent` collection verb acts on: everything the\n * current filter matches.\n *\n * Not an empty `ids` selection, which would say \"no rows\" — the verb is\n * available *without* a selection precisely because its subject is the\n * collection, so the honest payload is the same filter the listing is\n * showing, and the same one a \"select all matching\" escalation would send.\n */\n const everythingMatching: EntitySelection<TEntity> = {\n mode: 'matching',\n filtering,\n total: totalItems,\n excluded: new Set<EntityId>(),\n };\n\n // Opening a record is its title's link, so a row needs an actions column\n // only to pick it or to run a verb on it.\n const hasRowAction = onSelect !== undefined || hasRowMenu;\n const columnCount =\n visibleColumns.length + (hasRowAction ? 1 : 0) + (selectable ? 1 : 0);\n\n /**\n * The grid and the cards are both rendered, and a container query on the\n * table's own box picks one — at the width its visible columns need. A\n * viewport breakpoint was wrong inside a split view, a drawer or a wizard\n * step, and a JS measurement would guess during SSR and correct after mount.\n */\n /**\n * The column every row reads as — the entity's `labelMember`, else its\n * declared card title, else the first that can name a record — held in view\n * at the inline start while a grid wider than its container scrolls.\n */\n const stickyTitle =\n visibleColumns.find(column => column.name === metaEntity.labelMember) ??\n visibleColumns.find(column => column.card === 'title') ??\n visibleColumns.find(canNameRecord);\n const widths = pivotWidths({\n columns: visibleColumns,\n title: stickyTitle,\n roleOf: cardRoles(visibleColumns),\n extra:\n (selectable ? SELECTION_WIDTH : 0) + (hasRowAction ? ACTIONS_WIDTH : 0),\n breakpoint: pivotBreakpoint,\n });\n const pivot = pivotClasses(widths.essential);\n /**\n * The sticky title's cells: opaque, so the columns scrolling under it never\n * show through — a header cell on the header's surface, a row's on the\n * row's, following its hover.\n */\n const stickyClass = (\n column: EntityTableColumn<TEntity>,\n part: 'header' | 'body',\n ) =>\n column !== stickyTitle\n ? undefined\n : part === 'header'\n ? 'sticky start-0 z-2 bg-surface'\n : 'sticky start-0 z-1 bg-surface-elevated group-hover/row:bg-surface';\n /**\n * The first load has nothing to show and is held with a skeleton; a refetch\n * already has rows, so it keeps them and only marks the region busy. Splitting\n * the two is what stops every pagination click flashing grey.\n */\n const isFirstLoad = isLoading && items.length === 0;\n /** Loaded, nothing came back, and nothing failed: there are no rows to lay out. */\n const settledEmpty = items.length === 0 && !isLoading && error === undefined;\n\n /** `true`/omitted → the built-in default; a node → that node; `false` → none. */\n const customSkeleton = typeof skeleton === 'boolean' ? undefined : skeleton;\n const showSkeleton = isFirstLoad && skeleton !== false;\n const skeletonRows = Array.from(\n { length: Math.min(pageSize, SKELETON_ROW_CAP) },\n (_, index) => index,\n );\n\n /**\n * A refetch keeps its rows at full contrast and marks them `aria-busy`:\n * dimming them through opacity took the text under the contrast a reader\n * needs, on every page change.\n */\n const busy = isLoading || undefined;\n\n const nameOf = useRecordLabel();\n\n /**\n * The column a row reads *as*: the member `recordLabel()` names it by, when\n * the reader has not hidden that column; else one declared `card: 'title'`;\n * else the first visible one it filled in that is not a key — an id, a\n * reference or a link names a row no better than its position does.\n */\n const declaredTitle = visibleColumns.find(column => column.card === 'title');\n const linkColumn = (item: TEntity) => {\n const label = recordLabel(entityConstructor, item);\n const named =\n label.kind === 'fallback'\n ? undefined\n : visibleColumns.find(column => column.name === label.member.name);\n return (\n named ??\n declaredTitle ??\n visibleColumns.find(column => {\n const value = (item as Record<string, unknown>)[column.name];\n return canNameRecord(column) && value != null && String(value) !== '';\n })\n );\n };\n\n /**\n * What a record's card shows, by each member's declared `card` role or the\n * default: an id is hidden, the first enum is the badge, and up to\n * {@link UNDECLARED_META_CAP} more members are meta — a card is a summary,\n * and the grid holds the rest.\n */\n const roleOf = cardRoles(visibleColumns);\n const cardParts = (item: TEntity) => {\n const title = linkColumn(item);\n const rest = visibleColumns.filter(column => column !== title);\n let undeclared = 0;\n return {\n title,\n subtitle: rest.find(column => roleOf(column) === 'subtitle'),\n badges: rest.filter(column => roleOf(column) === 'badge'),\n meta: rest.filter(column => {\n if (roleOf(column) !== 'meta') return false;\n if (column.card !== undefined) return true;\n undeclared += 1;\n return undeclared <= UNDECLARED_META_CAP;\n }),\n };\n };\n\n const renderValue = (\n column: EntityTableColumn<TEntity>,\n item: TEntity,\n ): ReactNode =>\n column.render ? (\n column.render(item)\n ) : (\n <CellValue\n value={(item as Record<string, unknown>)[column.name]}\n descriptor={column}\n record={item as Record<string, unknown>}\n />\n );\n\n /**\n * A cell, and the row's title cell is the record's link\n * ([ADR 0026](../../../../../../../docs/adr/0026-actions-hierarchy-overflow-and-destructive-verbs.md)).\n * A column of identical \"Open\" links named nothing, and a reader tabbing\n * down it heard \"Open\" once per row; the title says which record it opens.\n * A picker's rows are chosen, not opened, so they stay plain.\n */\n const renderCell = (\n column: EntityTableColumn<TEntity>,\n item: TEntity,\n ): ReactNode => {\n const value = renderValue(column, item);\n if (hrefFor === undefined || onSelect !== undefined) return value;\n if (linkColumn(item)?.name !== column.name) return value;\n return renderLink({\n href: hrefFor(item.id),\n className: linkClassName,\n children: value,\n intent: { kind: 'open', id: item.id },\n });\n };\n\n /**\n * The row a shift-click ranges *from* — the last box the user actually\n * toggled. Held in a ref rather than state because it changes nothing on\n * screen, and re-rendering the whole table on every click to remember an\n * anchor is a cost with no visible return.\n */\n const anchorIndex = useRef<number | undefined>(undefined);\n\n /**\n * An entity that declares a parent renders as a tree: the page arranged\n * depth first, its first column indented, and a subtree hidden while its\n * record is collapsed. Collapsing is view state, so it lives here and is\n * forgotten with the table, like the shift-click anchor above.\n */\n const treeKeys = useMemo(\n () => hierarchyOf(entityConstructor),\n [entityConstructor],\n );\n const [collapsed, setCollapsed] = useState<ReadonlySet<string>>(\n () => new Set(),\n );\n const rows = useMemo(() => treeRows(items, treeKeys), [items, treeKeys]);\n const shown = shownTreeRows(rows, collapsed);\n const shownItems = shown.map(row => row.item);\n const toggleCollapsed = (key: string) =>\n setCollapsed(current => {\n const next = new Set(current);\n if (next.has(key)) next.delete(key);\n else next.add(key);\n return next;\n });\n\n const setSelection = (next: EntitySelection<TEntity>) =>\n onSelectionChange?.(next);\n\n const toggleRow = (\n index: number,\n checked: boolean,\n shiftKey: boolean,\n current: EntitySelection<TEntity>,\n ) => {\n // A shift-click extends the last toggle across the rows *on this page*, in\n // the direction the user dragged, and applies the new state to all of them.\n const from = shiftKey ? (anchorIndex.current ?? index) : index;\n const [start, end] = from <= index ? [from, index] : [index, from];\n\n let next = current;\n // The rows as shown: in a tree the order on screen is not the load's.\n for (const row of shownItems.slice(start, end + 1)) {\n next = toggleSelected(next, row.id, checked);\n }\n\n anchorIndex.current = index;\n setSelection(next);\n };\n\n /**\n * The header box, and it has three states rather than two: none of this\n * page's rows selected, all of them, or some. Without the third the box\n * reads as \"nothing is selected\" while a bulk bar sits below it saying\n * otherwise.\n */\n const pageIds = items.map(item => item.id);\n const selectedOnPage = selectionState\n ? pageIds.filter(id => isSelected(selectionState, id)).length\n : 0;\n const allOnPageSelected =\n pageIds.length > 0 && selectedOnPage === pageIds.length;\n const someOnPageSelected = selectedOnPage > 0 && !allOnPageSelected;\n\n const toggleAllOnPage = (\n checked: boolean,\n current: EntitySelection<TEntity>,\n ) => {\n let next = current;\n for (const id of pageIds) next = toggleSelected(next, id, checked);\n anchorIndex.current = undefined;\n setSelection(next);\n };\n\n /**\n * How a row names itself — to a screen reader on its checkbox, in a confirm\n * dialog, a bulk result, a tree toggle: what the reader reads the row *as*\n * (\"Seleccionar Acme\", never \"Seleccionar fila 3\" and never a whole id),\n * through the one derivation every surface shares.\n */\n const rowLabel = (item: TEntity): string => nameOf(entityConstructor, item);\n\n const selectionCell = (\n item: TEntity,\n index: number,\n // Passed in rather than closed over: this is only ever called under\n // `selectable`, which already proves the selection exists, and reading the\n // optional prop here would add a fallback arm that nothing can reach.\n current: EntitySelection<TEntity>,\n ) => (\n <Checkbox\n // Deliberately no `id`: both pivots are always in the DOM, so an id here\n // would be emitted twice per row. `aria-label` names the control instead,\n // and it names the *record* rather than the position.\n aria-label={t('table.selectRow', { record: rowLabel(item) })}\n checked={isSelected(current, item.id)}\n disabled={isBulkRunning}\n onChange={event =>\n toggleRow(\n index,\n event.currentTarget.checked,\n (event.nativeEvent as MouseEvent).shiftKey === true,\n current,\n )\n }\n />\n );\n\n const runTarget = (key: string, target: PendingTarget<TEntity>) => {\n if (target.kind === 'row') onUseCase?.(key, target.item);\n else onBulkUseCase?.(key, target.selection);\n };\n\n /**\n * Every verb on the table goes through here — the row menu, the bulk bar and\n * the toolbar — so none reaches a destructive verb around its confirmation,\n * its typed check or its Undo.\n */\n const verbs = useVerbInvoker<PendingTarget<TEntity>>({\n run: runTarget,\n busy: isBulkRunning,\n served: metadata?.useCases,\n });\n\n // The row a verb last ran on. Its menu trigger unmounts when the verb moved\n // the record out of every state a row verb applies to, and focus then goes\n // to that row's own link or control rather than `<body>`.\n const rowScope = useId();\n const [lastRow, setLastRow] = useState<string | undefined>(undefined);\n useFocusOnLoss(\n () =>\n lastRow === undefined ? undefined : focusableIn(`${rowScope}${lastRow}`),\n shown\n .map(({ item }) =>\n availableUseCases(rowUseCases, item)\n .map(({ key }) => key)\n .join(','),\n )\n .join(' '),\n );\n\n const invoke = (\n useCase: UseCaseDescriptor,\n target: PendingTarget<TEntity>,\n ) => {\n if (target.kind === 'row') {\n setLastRow(String(target.item.id));\n verbs.invoke({\n descriptor: useCase,\n target,\n object: rowLabel(target.item),\n count: 1,\n });\n return;\n }\n const count = selectionSize(target.selection);\n verbs.invoke({\n descriptor: useCase,\n target,\n object: t('confirm.selection', {\n count,\n label: entityNoun(metaEntity),\n plural: entityNoun(metaEntity, 'plural'),\n }),\n count,\n matching: target.selection.mode === 'matching',\n });\n };\n\n const rowMenu = (item: TEntity) =>\n hasRowMenu ? (\n <ActionBar\n surface=\"row-menu\"\n menuLabel={t('actions.forRecord', { record: rowLabel(item) })}\n items={itemsForUseCases(\n availableUseCases(rowUseCases, item),\n translateKey,\n useCase => invoke(useCase, { kind: 'row', item }),\n )}\n />\n ) : undefined;\n\n /**\n * A picker's Select, then the row's verbs. Opening the record is not here:\n * it is the title's link.\n */\n const recordAction = (item: TEntity) => {\n const pick = onSelect ? (\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n onClick={() => onSelect(item)}\n >\n {t('table.select')}\n </Button>\n ) : undefined;\n\n const menu = rowMenu(item);\n if (!menu) return pick;\n\n return (\n <span className=\"flex items-center gap-2xs\">\n {pick}\n {menu}\n </span>\n );\n };\n\n /**\n * \"New\" is the list's primary, and only where something can be created\n * here: the entity is not one only a flow writes (`creatable: false`), and\n * the caller may write it. A list that offered \"New\" to a reader who could\n * never save opened a form with no Save on it.\n */\n const mayCreate =\n newHref !== undefined &&\n metaEntity.creatable &&\n (metadata === undefined || metadata.actions.includes('write'));\n const toolbarItems: ActionBarItem[] = itemsForUseCases(\n toolbarUseCases,\n translateKey,\n useCase =>\n invoke(useCase, { kind: 'selection', selection: everythingMatching }),\n isBulkRunning,\n );\n const declaresToolbarPrimary = toolbarItems.some(\n item => item.emphasis === 'primary',\n );\n const toolbarActions: ActionBarItem[] = [\n ...(mayCreate\n ? [\n {\n key: 'new',\n label: t('table.new'),\n emphasis: declaresToolbarPrimary\n ? ('default' as const)\n : ('primary' as const),\n href: newHref,\n intent: { kind: 'new' as const },\n },\n ]\n : []),\n ...toolbarItems,\n ];\n\n const locale = useLocale();\n const panelId = useId();\n const keys = sortKeys(sorting, columns);\n const activeFilters = filtering?.values.length ?? 0;\n const results = t('table.results', { count: totalItems });\n\n /**\n * What the status region says once a filter, a sort or a page has settled —\n * debounced, and silent on the first load.\n */\n const announcement = useResultAnnouncement(\n !isLoading,\n totalItems === 0 && activeFilters > 0\n ? t('table.noResultsFiltered')\n : results,\n JSON.stringify([filtering, sorting, currentPage, pageSize]),\n );\n\n /** The caption: what the table holds, how many, and in what order. */\n const primaryKey = keys[0];\n const primaryColumn =\n primaryKey === undefined\n ? undefined\n : columns.find(column => column.name === primaryKey.member);\n const caption =\n primaryKey === undefined || primaryColumn === undefined\n ? t('table.caption', {\n entity: entityNoun(metaEntity, 'plural'),\n results,\n })\n : t('table.captionSorted', {\n entity: entityNoun(metaEntity, 'plural'),\n results,\n column: primaryColumn.label,\n direction: t(\n primaryKey.type === 'asc' ? 'sort.ascending' : 'sort.descending',\n ),\n });\n\n /**\n * A column's header: its name, and — for a sortable one — a button that\n * cycles it ascending → descending → unsorted, with Shift adding it as the\n * next key. Only the primary key carries `aria-sort`.\n */\n const headerCell = (column: EntityTableColumn<TEntity>) => {\n const label = column.header ?? column.label;\n if (!column.sortable || onSortingChange === undefined)\n return (\n <TableHeaderCell\n key={column.name}\n className={stickyClass(column, 'header')}\n >\n {label}\n </TableHeaderCell>\n );\n const position = keys.findIndex(key => key.member === column.name);\n const type = keys[position]?.type;\n return (\n <TableHeaderCell\n key={column.name}\n className={stickyClass(column, 'header')}\n aria-sort={\n position === 0\n ? type === 'asc'\n ? 'ascending'\n : 'descending'\n : undefined\n }\n >\n <button\n type=\"button\"\n className=\"inline-flex min-h-(--target-min) items-center gap-3xs rounded-sm focus-ring hover:text-content\"\n onClick={event =>\n onSortingChange(\n nextHeaderSorting<TEntity>(\n keys,\n {\n member: column.name,\n property: queryPropertyFor(column, locale),\n },\n event.shiftKey,\n ),\n )\n }\n >\n {label}\n <span aria-hidden=\"true\">\n {type === 'asc' ? '▲' : type === 'desc' ? '▼' : '↕'}\n </span>\n {keys.length > 1 && position >= 0 && (\n <span aria-hidden=\"true\" className=\"text-step-sm\">\n {position + 1}\n </span>\n )}\n </button>\n </TableHeaderCell>\n );\n };\n\n /** A panel toggle: its state said by `aria-expanded`, and its count shown. */\n const panelToggle = (which: Exclude<Panel, 'none'>, count: number) => (\n <Button\n type=\"button\"\n id={`${panelId}-${which}`}\n variant={panel === which ? 'primary' : 'secondary'}\n size=\"sm\"\n aria-expanded={panel === which}\n aria-controls={panelId}\n onClick={() => setPanel(current => (current === which ? 'none' : which))}\n >\n {t(which === 'filters' ? 'table.filters' : 'table.sorting')}\n {count > 0 && (\n // Its name stays \"Filters\": the chips say which filters, and a count\n // in the name would change it under the reader with every filter.\n <span\n aria-hidden=\"true\"\n className=\"ms-3xs rounded-full bg-surface px-3xs text-step-sm text-content\"\n >\n {count}\n </span>\n )}\n </Button>\n );\n\n return (\n <div className=\"@container/entity-table flex flex-col gap-s\">\n {/*\n One announcement for the whole table, not one per layout. Both the grid\n and the card list are always in the DOM — CSS picks which is visible —\n so a live region inside each meant assistive tech was told twice that\n the table was loading. The shimmer itself is aria-hidden, so this is the\n only thing that carries the news.\n */}\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {isFirstLoad ? t('table.loading') : announcement}\n </span>\n\n {showControls && (\n <TableToolbar\n start={\n <>\n {/* \"New\" and the collection-bound verbs that need no\n selection. They sit here rather than in the bulk bar,\n because the bulk bar only exists while rows are ticked and\n these are always available. */}\n <LoadingBoundary isLoading={isMetadataLoading} lines={0}>\n <>\n {toolbarActions.length > 0 && (\n <ActionBar\n surface=\"table-toolbar\"\n items={toolbarActions}\n renderLink={renderLink}\n />\n )}\n </>\n </LoadingBoundary>\n {slots.toolbar}\n </>\n }\n end={\n <>\n {panelToggle('filters', activeFilters)}\n {panelToggle('sorting', keys.length)}\n <ColumnSettings\n columns={columns}\n hidden={hidden}\n onChange={setPersonalization}\n />\n </>\n }\n panelId={panelId}\n panel={\n panel === 'filters' ? (\n <FilterBuilder<TEntity>\n // Remounted when the filtering changes from outside — a chip\n // removed — so its rows show what is in effect.\n key={JSON.stringify(filtering ?? null)}\n descriptors={columns.filter(column => column.filterable)}\n facets={facets}\n value={filtering}\n onChange={(applied: FilterGroup<TEntity>) =>\n onFilteringChange?.(applied)\n }\n />\n ) : panel === 'sorting' ? (\n <SortBuilder<TEntity>\n descriptors={columns.filter(column => column.sortable)}\n value={sorting}\n onChange={(applied: EntitySorting<TEntity>) =>\n onSortingChange?.(applied)\n }\n />\n ) : undefined\n }\n />\n )}\n\n {showControls && onFilteringChange !== undefined && (\n <FilterChips<TEntity>\n descriptors={columns.filter(column => column.filterable)}\n value={filtering}\n onChange={onFilteringChange}\n />\n )}\n\n {/*\n The bar appears when there is something selected and something to do\n with it. It sits above the rows rather than floating over them: a fixed\n overlay covers the last row of a short page, which is the row the user\n most likely just ticked.\n */}\n {selectionState && selectionSize(selectionState) > 0 && (\n <BulkActionBar\n count={selectionSize(selectionState)}\n useCases={bulkUseCases}\n busy={isBulkRunning}\n // Offered only when this page is fully ticked and the store holds\n // more than the page — the escalation has somewhere to escalate to.\n matchingTotal={\n selectionState.mode === 'ids' &&\n allOnPageSelected &&\n totalItems > items.length\n ? totalItems\n : undefined\n }\n onSelectAllMatching={() => setSelection(everythingMatching)}\n onClear={() => setSelection(emptySelection<TEntity>())}\n onUseCase={useCase =>\n invoke(useCase, { kind: 'selection', selection: selectionState })\n }\n />\n )}\n\n {verbs.dialog}\n\n {bulkOutcomes && bulkOutcomes.length > 0 && onBulkDismiss && (\n <BulkResult\n outcomes={bulkOutcomes}\n busy={isBulkRunning}\n labelFor={id => {\n const row = items.find(item => item.id === id);\n return row ? rowLabel(row) : undefined;\n }}\n onRetryFailed={onBulkRetry}\n onDismiss={onBulkDismiss}\n />\n )}\n\n {/*\n Rendered once, outside both layouts, and independently of whether there\n are rows: a refetch that fails leaves the previous page on screen, and\n without this the user would read stale data as current.\n */}\n {/*\n One state for the region, outside both layouts (ADR 0028): a failed\n load with Retry — and the rows from before it marked as possibly out of\n date — or an empty answer, which says whether a filter emptied it.\n */}\n <RegionState\n plural={entityNoun(metaEntity, 'plural')}\n isLoading={isLoading}\n error={error}\n onRetry={onRetry}\n hasStaleData={items.length > 0}\n isEmpty={items.length === 0}\n isFiltered={activeFilters > 0}\n onClearFilters={\n onFilteringChange === undefined\n ? undefined\n : () => {\n // The button goes with the empty state it sits in, so focus\n // moves first to the control that filters — still there, and\n // where a reader would go next — never to `<body>`.\n document.getElementById(`${panelId}-filters`)?.focus();\n onFilteringChange({\n // Only offered under a filter, so there is one to keep the\n // logic of.\n operator: (filtering as FilterGroup<TEntity>).operator,\n values: [],\n });\n }\n }\n emptyAction={\n mayCreate\n ? renderLink({\n href: newHref as string,\n className: button({ variant: 'primary' }),\n children: t('table.new'),\n intent: { kind: 'new' },\n })\n : undefined\n }\n />\n\n {/*\n A settled empty answer is the region's state alone: a grid's header\n over no rows, announced after \"nothing here\", told the reader there\n was a table to read (ADR 0028). Loading keeps the skeleton's geometry,\n and a failure keeps whatever rows it had, so nothing already on screen\n moves.\n */}\n {!settledEmpty && (\n <>\n {/* Wide viewports: a grid. */}\n <div className={pivot.grid} aria-busy={busy}>\n {/* Held to most of the viewport so the header can stick above the\n rows; the scroll padding keeps a focused row out from under it. */}\n <Table\n caption={caption}\n containerClassName=\"max-h-(--table-max-block) scroll-pt-12\"\n // Never narrower than its columns side by side: between the\n // essential width and that, the grid scrolls rather than crushing\n // every column into an unreadable sliver.\n style={{ minWidth: `${widths.full}rem` }}\n // A focused cell scrolled sideways is never left under the\n // sticky title column (WCAG 2.4.11).\n containerStyle={\n stickyTitle === undefined\n ? undefined\n : {\n scrollPaddingInlineStart: `${columnWidth(stickyTitle)}rem`,\n }\n }\n >\n <TableHead>\n {slots.header ? (\n slots.header.render(visibleColumns)\n ) : (\n <tr>\n {selectable && (\n <TableHeaderCell>\n <Checkbox\n aria-label={t('table.selectAllOnPage')}\n checked={allOnPageSelected}\n indeterminate={someOnPageSelected}\n disabled={isBulkRunning || items.length === 0}\n onChange={event =>\n toggleAllOnPage(\n event.currentTarget.checked,\n selectionState,\n )\n }\n />\n </TableHeaderCell>\n )}\n {visibleColumns.map(headerCell)}\n {hasRowAction && (\n <TableHeaderCell>{t('table.actions')}</TableHeaderCell>\n )}\n </tr>\n )}\n </TableHead>\n <TableBody>\n {/* Skeleton rows rather than the word \"Loading\", and one per column\n rather than a single full-width blob: the placeholder occupies\n the real grid, so the swap to rows shifts nothing sideways.\n `TableMessageRow` is deliberately bypassed — it is one centred\n full-span cell and cannot express the geometry. */}\n {showSkeleton &&\n (customSkeleton ? (\n <TableMessageRow colSpan={columnCount}>\n {customSkeleton}\n </TableMessageRow>\n ) : (\n skeletonRows.map(row => (\n <TableRow key={row}>\n {selectable && (\n <TableCell>\n <Skeleton shape=\"line\" className=\"w-4\" />\n </TableCell>\n )}\n {visibleColumns.map(column => (\n <TableCell key={column.name}>\n <Skeleton shape=\"line\" className=\"w-full\" />\n </TableCell>\n ))}\n {hasRowAction && (\n <TableCell>\n <Skeleton shape=\"line\" className=\"w-16\" />\n </TableCell>\n )}\n </TableRow>\n ))\n ))}\n {shown.map(({ item, depth, hasChildren }, index) =>\n slots.row ? (\n // A Fragment carries the key without wrapping the custom row in\n // an element `<tbody>` would reject.\n <Fragment key={String(item.id ?? index)}>\n {slots.row.render(item, visibleColumns)}\n </Fragment>\n ) : (\n <TableRow\n key={String(item.id ?? index)}\n data-record-id={`${rowScope}${String(item.id)}`}\n className=\"group/row\"\n >\n {selectionState && (\n <TableCell>\n {selectionCell(item, index, selectionState)}\n </TableCell>\n )}\n {visibleColumns.map((column, columnIndex) => (\n <TableCell\n key={column.name}\n className={stickyClass(column, 'body')}\n >\n {treeKeys !== undefined && columnIndex === 0 ? (\n <TreeCell\n depth={depth}\n hasChildren={hasChildren}\n expanded={!collapsed.has(treeKeys.idOf(item))}\n label={t(\n collapsed.has(treeKeys.idOf(item))\n ? 'table.expandRow'\n : 'table.collapseRow',\n { record: rowLabel(item) },\n )}\n onToggle={() =>\n toggleCollapsed(treeKeys.idOf(item))\n }\n >\n {renderCell(column, item)}\n </TreeCell>\n ) : (\n renderCell(column, item)\n )}\n </TableCell>\n ))}\n {hasRowAction && (\n <TableCell>{recordAction(item)}</TableCell>\n )}\n </TableRow>\n ),\n )}\n </TableBody>\n </Table>\n </div>\n\n {/* Narrow containers: the same columns pivoted into a list of cards. */}\n <div className={pivot.cards} aria-busy={busy}>\n {/* The card pivot gets card-shaped placeholders, not a bare shimmer\n block: the border, radius and padding are the geometry here. */}\n {showSkeleton &&\n (customSkeleton ?? (\n <ul\n role=\"list\"\n className=\"m-0 p-0 flex list-none flex-col gap-2xs\"\n >\n {skeletonRows.map(row => (\n <li key={row}>\n <EntityRecordCard\n title={<Skeleton shape=\"line\" className=\"w-32\" />}\n meta={visibleColumns.slice(1).map(column => ({\n key: column.name,\n label: column.label,\n value: <Skeleton shape=\"line\" className=\"w-24\" />,\n }))}\n />\n </li>\n ))}\n </ul>\n ))}\n {shown.length > 0 && (\n <ul\n role=\"list\"\n className=\"m-0 p-0 flex list-none flex-col gap-2xs\"\n >\n {shown.map(({ item, depth }, index) => {\n const parts = cardParts(item);\n return (\n <li\n key={String(item.id ?? index)}\n data-record-id={`${rowScope}${String(item.id)}`}\n // A tree's card says how deep it sits, as its row does.\n aria-level={\n treeKeys === undefined ? undefined : depth + 1\n }\n style={\n treeKeys === undefined\n ? undefined\n : { marginInlineStart: `${depth * 1.5}rem` }\n }\n >\n <EntityRecordCard\n // The same renderers as the grid, so the two layouts agree.\n title={\n parts.title === undefined\n ? hrefFor === undefined || onSelect !== undefined\n ? rowLabel(item)\n : renderLink({\n href: hrefFor(item.id),\n className: linkClassName,\n children: rowLabel(item),\n intent: { kind: 'open', id: item.id },\n })\n : renderCell(parts.title, item)\n }\n subtitle={\n parts.subtitle === undefined\n ? undefined\n : renderCell(parts.subtitle, item)\n }\n badges={parts.badges.map(column => ({\n key: column.name,\n value: renderCell(column, item),\n }))}\n meta={parts.meta.map(column => ({\n key: column.name,\n label: column.header ?? column.label,\n value: renderCell(column, item),\n }))}\n leading={\n selectionState\n ? selectionCell(item, index, selectionState)\n : undefined\n }\n actions={recordAction(item)}\n />\n </li>\n );\n })}\n </ul>\n )}\n </div>\n </>\n )}\n\n <Pagination\n currentPage={currentPage}\n pageSize={pageSize}\n totalItems={totalItems}\n onPageChange={onPageChange}\n onPageSizeChange={onPageSizeChange}\n />\n\n {slots.rest}\n </div>\n );\n}\n\n/**\n * The first control in a record's row or card that the reader can see. Both\n * layouts are in the DOM and CSS shows one, so a control inside the hidden\n * one is skipped. `scoped` is the record's id under this table's own prefix,\n * so a second table on the page holding the same record is never reached.\n */\nfunction focusableIn(scoped: string): HTMLElement | undefined {\n return [\n ...document.querySelectorAll<HTMLElement>(\n `[data-record-id=\"${CSS.escape(scoped)}\"] :is(a[href], button)`,\n ),\n ].find(\n control =>\n // `checkVisibility` is recent; a browser without it is asked for the\n // boxes the control lays out, which a `display: none` layout has none of.\n control.checkVisibility?.() ?? control.getClientRects().length > 0,\n );\n}\n"],"names":["canNameRecord","emptySelection","extractMetaEntity","hierarchyOf","isSelected","queryPropertyFor","recordLabel","selectionSize","toggleSelected","Fragment","useId","useMemo","useRef","useState","useEntityNoun","useLocale","useT","useTranslateKey","availableUseCases","renderAnchor","useCasesForSurface","useVerbInvoker","Button","button","CellValue","useRecordLabel","Checkbox","Skeleton","Table","TableBody","TableCell","TableHead","TableHeaderCell","TableMessageRow","TableRow","linkClassName","ActionBar","itemsForUseCases","BulkActionBar","BulkResult","ColumnSettings","EntityRecordCard","FilterBuilder","FilterChips","LoadingBoundary","Pagination","RegionState","SortBuilder","TableToolbar","useFocusOnLoss","cardRoles","readEntityTableSlots","shownTreeRows","TreeCell","treeRows","nextHeaderSorting","sortKeys","ACTIONS_WIDTH","columnWidth","pivotClasses","pivotWidths","SELECTION_WIDTH","useEntityTableColumns","useResultAnnouncement","SKELETON_ROW_CAP","UNDECLARED_META_CAP","EntityTable","entityConstructor","isLoading","skeleton","error","items","totalItems","currentPage","pageSize","onPageChange","onPageSizeChange","hrefFor","newHref","renderLink","onSelect","preferencesKey","hiddenColumns","showControls","pivotBreakpoint","filtering","sorting","onFilteringChange","onSortingChange","facets","selection","onSelectionChange","metadata","isMetadataLoading","onBulkUseCase","onUseCase","onRetry","bulkOutcomes","onBulkDismiss","onBulkRetry","isBulkRunning","children","visibleColumns","t","translateKey","entityNoun","metaEntity","slots","panel","setPanel","columns","hidden","setPersonalization","key","name","undefined","Error","selectionState","selectable","rowUseCases","useCases","bulkUseCases","toolbarUseCases","hasRowMenu","length","everythingMatching","mode","total","excluded","Set","hasRowAction","columnCount","stickyTitle","find","column","labelMember","card","widths","title","roleOf","extra","breakpoint","pivot","essential","stickyClass","part","isFirstLoad","settledEmpty","customSkeleton","showSkeleton","skeletonRows","Array","from","Math","min","_","index","busy","nameOf","declaredTitle","linkColumn","item","named","label","kind","member","value","String","cardParts","rest","filter","undeclared","subtitle","badges","meta","renderValue","render","descriptor","record","renderCell","href","id","className","intent","anchorIndex","treeKeys","collapsed","setCollapsed","rows","shown","shownItems","map","row","toggleCollapsed","current","next","has","delete","add","setSelection","toggleRow","checked","shiftKey","start","end","slice","pageIds","selectedOnPage","allOnPageSelected","someOnPageSelected","toggleAllOnPage","rowLabel","selectionCell","aria-label","disabled","onChange","event","currentTarget","nativeEvent","runTarget","target","verbs","run","served","rowScope","lastRow","setLastRow","focusableIn","join","invoke","useCase","object","count","plural","matching","rowMenu","surface","menuLabel","recordAction","pick","type","variant","size","onClick","menu","span","mayCreate","creatable","actions","includes","toolbarItems","declaresToolbarPrimary","some","emphasis","toolbarActions","locale","panelId","keys","activeFilters","values","results","announcement","JSON","stringify","primaryKey","primaryColumn","caption","entity","direction","headerCell","header","sortable","position","findIndex","aria-sort","property","aria-hidden","panelToggle","which","aria-expanded","aria-controls","div","role","aria-live","lines","toolbar","descriptors","filterable","applied","matchingTotal","onSelectAllMatching","onClear","dialog","outcomes","labelFor","onRetryFailed","onDismiss","hasStaleData","isEmpty","isFiltered","onClearFilters","document","getElementById","focus","operator","emptyAction","grid","aria-busy","containerClassName","style","minWidth","full","containerStyle","scrollPaddingInlineStart","tr","indeterminate","colSpan","shape","depth","hasChildren","data-record-id","columnIndex","expanded","idOf","onToggle","cards","ul","li","parts","aria-level","marginInlineStart","leading","scoped","querySelectorAll","CSS","escape","control","checkVisibility","getClientRects"],"mappings":"AAAA;;AAEA,SACEA,aAAa,EACbC,cAAc,EAKdC,iBAAiB,EAEjBC,WAAW,EACXC,UAAU,EACVC,gBAAgB,EAChBC,WAAW,EACXC,aAAa,EACbC,cAAc,QAET,gBAAgB;AACvB,SACEC,QAAQ,EAERC,KAAK,EACLC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,QAAQ;AAEf,SACEC,aAAa,EACbC,SAAS,EACTC,IAAI,EACJC,eAAe,QACV,yBAAyB;AAChC,SACEC,iBAAiB,EACjBC,YAAY,EACZC,kBAAkB,QACb,yBAAyB;AAChC,SAASC,cAAc,QAAQ,oCAAoC;AACnE,SAASC,MAAM,EAAEC,MAAM,QAAQ,8BAA8B;AAC7D,SAASC,SAAS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A,OAAO6B,KAAK;oDACpCG,OAAOa,WAAW7C,QAAQ2B;gDAC5B;;4CACA0K,SACEtN,iBACI+F,cAAcnD,MAAML,OAAOvC,kBAC3BF;4CAENqI,SAASV,aAAa7E;;uCA7CnBM,QAAON,WAAAA,KAAKoB,EAAE,YAAPpB,WAAWL;gCAiD7B;;;;;;0BAOV,KAAC/G;gBACC4B,aAAaA;gBACbC,UAAUA;gBACVF,YAAYA;gBACZG,cAAcA;gBACdC,kBAAkBA;;YAGnB+B,MAAM8D,IAAI;;;AAGjB;AAEA;;;;;CAKC,GACD,SAAS0D,YAAYyG,MAAc;IACjC,OAAO;WACF/B,SAASgC,gBAAgB,CAC1B,CAAC,iBAAiB,EAAEC,IAAIC,MAAM,CAACH,QAAQ,uBAAuB,CAAC;KAElE,CAACvM,IAAI,CACJ2M,CAAAA;;uBACE,qEAAqE;QACrE,0EAA0E;QAC1EA,QAAQC,eAAe,oBAAvBD,QAAQC,eAAe,MAAvBD,2BAA+BA,QAAQE,cAAc,GAAGtN,MAAM,GAAG;;AAEvE"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/organisms/entity-table/entity-table.tsx"],"sourcesContent":["'use client';\n\nimport {\n canNameRecord,\n emptySelection,\n type Entity,\n type EntityId,\n type EntitySelection,\n type EntitySorting,\n extractMetaEntity,\n type FilterGroup,\n hierarchyOf,\n isSelected,\n isTextMember,\n queryPropertyFor,\n recordLabel,\n selectionSize,\n toggleSelected,\n type UseCaseDescriptor,\n} from '@entifix/core';\nimport {\n Fragment,\n type ReactNode,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport {\n useEntityNoun,\n useLocale,\n useT,\n useTranslateKey,\n} from '../../../i18n/index.js';\nimport {\n availableUseCases,\n renderAnchor,\n useCasesForSurface,\n} from '../../actions/index.js';\nimport { useVerbInvoker } from '../../actions/use-verb-invoker.js';\nimport { Button, button } from '../../atoms/button/index.js';\nimport { CellValue, useRecordLabel } from '../../atoms/cell-value/index.js';\nimport { Checkbox } from '../../atoms/field/index.js';\nimport { Skeleton } from '../../atoms/skeleton/index.js';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeaderCell,\n TableMessageRow,\n TableRow,\n} from '../../atoms/table/index.js';\nimport { linkClassName } from '../../atoms/text/index.js';\nimport {\n ActionBar,\n type ActionBarItem,\n itemsForUseCases,\n} from '../../molecules/action-bar/index.js';\nimport { BulkActionBar } from '../../molecules/bulk-action-bar/index.js';\nimport { BulkResult } from '../../molecules/bulk-result/index.js';\nimport { ColumnSettings } from '../../molecules/column-settings/index.js';\nimport { EntityRecordCard } from '../../molecules/entity-record-card/index.js';\nimport { FilterBuilder } from '../../molecules/filter-builder/index.js';\nimport { FilterChips } from '../../molecules/filter-chips/index.js';\nimport { LoadingBoundary } from '../../molecules/loading-boundary/index.js';\nimport { Pagination } from '../../molecules/pagination/index.js';\nimport { RegionState } from '../../molecules/region-state/index.js';\nimport { SortBuilder } from '../../molecules/sort-builder/index.js';\nimport { TableToolbar } from '../../molecules/table-toolbar/index.js';\nimport { useFocusOnLoss } from '../../utils/use-focus-on-arrival.js';\nimport { cardRoles } from './card-roles.js';\nimport type {\n EntityTableColumn,\n EntityTableProps,\n} from './entity-table.types.js';\nimport { readEntityTableSlots } from './entity-table-slots.js';\nimport { shownTreeRows, TreeCell, treeRows } from './entity-table-tree.js';\nimport { nextHeaderSorting, sortKeys } from './header-sort.js';\nimport {\n ACTIONS_WIDTH,\n columnWidth,\n pivotClasses,\n pivotWidths,\n SELECTION_WIDTH,\n} from './pivot.js';\nimport { useEntityTableColumns } from './use-entity-table-columns.js';\nimport { useResultAnnouncement } from './use-result-announcement.js';\n\ntype Panel = 'none' | 'filters' | 'sorting';\n\n/**\n * How many placeholder rows the built-in skeleton draws.\n *\n * The column count is taken from the real geometry, because that is the axis a\n * mismatch shifts; the row count is capped instead of tracking `pageSize`, since\n * a fifty-row page would otherwise paint fifty shimmer rows to stand in for\n * content that arrives below the fold anyway.\n */\nconst SKELETON_ROW_CAP = 5;\n\n/** How many members a card shows as meta when none declares a `card` role. */\nconst UNDECLARED_META_CAP = 3;\n\n/**\n * The name of the leading column a table adds when nothing on screen names a\n * row. Not a member name an entity can declare, so it never collides.\n */\nconst RECORD_COLUMN = '$record';\n\n/**\n * A table that builds itself from an entity's metadata: columns, labels, value\n * formatting and the filter/sort controls all come from `@accessor()`\n * declarations, so listing a new entity needs no bespoke table.\n *\n * Three things layer on top of that default:\n * - **personalization** — column order and visibility, persisted through the\n * UI-preferences port (so it survives reloads and can later move server-side);\n * - **responsiveness** — below `pivotBreakpoint` rows pivot into label/value\n * cards instead of scrolling sideways;\n * - **slots** — `<EntityColumn>` / `<EntityTableHeader>` / `<EntityTableRow>` /\n * `<EntityTableToolbar>` children override any part of the default rendering.\n */\n/**\n * What a pending verb will act on once it is confirmed.\n *\n * A form has one record; a table has a row or a selection, and those reach two\n * different handlers with two different payloads. Carrying the selection itself\n * rather than reading it back at confirm time also removes a branch that could\n * not happen: the bulk bar only renders inside a truthy selection.\n */\ntype PendingTarget<TEntity extends Entity> =\n | { kind: 'row'; item: TEntity }\n | { kind: 'selection'; selection: EntitySelection<TEntity> };\n\nexport function EntityTable<TEntity extends Entity>({\n entityConstructor,\n isLoading,\n skeleton = true,\n error,\n items,\n totalItems,\n currentPage,\n pageSize,\n onPageChange,\n onPageSizeChange,\n hrefFor,\n newHref,\n renderLink = renderAnchor,\n onSelect,\n preferencesKey,\n hiddenColumns,\n showKey = false,\n showControls = true,\n pivotBreakpoint,\n filtering,\n sorting,\n onFilteringChange,\n onSortingChange,\n facets,\n selection,\n onSelectionChange,\n metadata,\n isMetadataLoading = false,\n onBulkUseCase,\n onUseCase,\n onRetry,\n bulkOutcomes,\n onBulkDismiss,\n onBulkRetry,\n isBulkRunning = false,\n children,\n}: EntityTableProps<TEntity>) {\n const t = useT();\n // A descriptor's label is a runtime catalog key — the typed gate cannot see\n // it, which is why a host's catalog check is what catches a typo.\n const translateKey = useTranslateKey();\n const entityNoun = useEntityNoun();\n const metaEntity = extractMetaEntity(entityConstructor);\n const slots = readEntityTableSlots<TEntity>(children);\n const [panel, setPanel] = useState<Panel>('none');\n\n const {\n columns,\n visibleColumns: resolvedColumns,\n hidden,\n setPersonalization,\n } = useEntityTableColumns<TEntity>(\n entityConstructor,\n slots.columns,\n items[0],\n `entity-table:${preferencesKey ?? metaEntity.key ?? metaEntity.name}`,\n hiddenColumns,\n showKey,\n );\n const nameOf = useRecordLabel();\n /**\n * How a row names itself — to a screen reader on its checkbox, in a confirm\n * dialog, a bulk result, a tree toggle: what the reader reads the row *as*\n * (\"Seleccionar Acme\", never \"Seleccionar fila 3\" and never a whole id),\n * through the one derivation every surface shares.\n */\n const rowLabel = (item: TEntity): string => nameOf(entityConstructor, item);\n\n /**\n * The column every row reads as — the entity's `labelMember`, else its\n * declared card title, else the first **text** member that is not a key. A\n * status, a quantity or a date is a value the record holds, never what it is\n * called, which is the rule `recordLabel()` names a record by.\n */\n const titleOf = (candidates: Array<EntityTableColumn<TEntity>>) =>\n candidates.find(column => column.name === metaEntity.labelMember) ??\n candidates.find(column => column.card === 'title') ??\n candidates.find(column => canNameRecord(column) && isTextMember(column));\n /**\n * A record nothing on screen names — an order, a movement, a payout, or a\n * row whose naming column the reader has hidden — gets a leading column of\n * its own that reads as the record: its noun and short id, as every other\n * surface names it. Without it the grid's link landed on a number or an\n * enum, or on no cell at all.\n */\n const namedTitle = titleOf(resolvedColumns);\n /**\n * The title column, held in view at the inline start while a grid wider than\n * its container scrolls — the naming column, or the record column above.\n */\n const stickyTitle: EntityTableColumn<TEntity> = namedTitle ?? {\n name: RECORD_COLUMN,\n key: RECORD_COLUMN,\n label: entityNoun(metaEntity),\n type: 'string',\n sortable: false,\n filterable: false,\n order: -1,\n readonly: false,\n required: false,\n linkLabelProperty: 'name',\n linkSearchProperty: 'name',\n linkSerialization: 'id',\n resetOnClone: false,\n card: 'title',\n render: rowLabel,\n virtual: true,\n };\n const visibleColumns =\n namedTitle === undefined\n ? [stickyTitle, ...resolvedColumns]\n : resolvedColumns;\n\n // A picker's table is choosing *one* value; a multi-selection there would\n // offer a set to a form member that holds a single reference, and the two\n // controls would fight over the same row. This is a wiring mistake rather\n // than a state, so it costs the render — the same call `EntityForm` makes\n // for a link source aimed at a member no picker can edit.\n if (onSelect !== undefined && selection !== undefined) {\n throw new Error(\n 'EntityTable was given both `onSelect` and `selection`. A picker picks one ' +\n 'row and a selection accumulates many, so the row control cannot be both. ' +\n 'Drop `selection` inside a picker, or drop `onSelect` outside one.',\n );\n }\n\n /**\n * The selection, or `undefined` when the table is not selectable at all.\n *\n * One value rather than a `selection` prop beside a `selectable` boolean:\n * two of them means every render site has to re-test both, and the second\n * test is unreachable — which reads as a defensive check and is really dead\n * code the coverage gate then cannot close.\n */\n const selectionState =\n selection !== undefined && onSelectionChange !== undefined\n ? selection\n : undefined;\n const selectable = selectionState !== undefined;\n const rowUseCases = useCasesForSurface('row-menu', metadata?.useCases);\n const bulkUseCases = useCasesForSurface('bulk-bar', metadata?.useCases);\n const toolbarUseCases = useCasesForSurface(\n 'table-toolbar',\n metadata?.useCases,\n );\n const hasRowMenu = rowUseCases.length > 0 && onUseCase !== undefined;\n\n /**\n * What a `context-independent` collection verb acts on: everything the\n * current filter matches.\n *\n * Not an empty `ids` selection, which would say \"no rows\" — the verb is\n * available *without* a selection precisely because its subject is the\n * collection, so the honest payload is the same filter the listing is\n * showing, and the same one a \"select all matching\" escalation would send.\n */\n const everythingMatching: EntitySelection<TEntity> = {\n mode: 'matching',\n filtering,\n total: totalItems,\n excluded: new Set<EntityId>(),\n };\n\n // Opening a record is its title's link, so a row needs an actions column\n // only to pick it or to run a verb on it.\n const hasRowAction = onSelect !== undefined || hasRowMenu;\n const columnCount =\n visibleColumns.length + (hasRowAction ? 1 : 0) + (selectable ? 1 : 0);\n\n /**\n * The grid and the cards are both rendered, and a container query on the\n * table's own box picks one — at the width its visible columns need. A\n * viewport breakpoint was wrong inside a split view, a drawer or a wizard\n * step, and a JS measurement would guess during SSR and correct after mount.\n */\n const widths = pivotWidths({\n columns: visibleColumns,\n title: stickyTitle,\n roleOf: cardRoles(visibleColumns),\n extra:\n (selectable ? SELECTION_WIDTH : 0) + (hasRowAction ? ACTIONS_WIDTH : 0),\n breakpoint: pivotBreakpoint,\n });\n const pivot = pivotClasses(widths.essential);\n /**\n * The sticky title's cells: opaque, so the columns scrolling under it never\n * show through — a header cell on the header's surface, a row's on the\n * row's, following its hover.\n */\n const stickyClass = (\n column: EntityTableColumn<TEntity>,\n part: 'header' | 'body',\n ) =>\n column !== stickyTitle\n ? undefined\n : part === 'header'\n ? 'sticky start-0 z-2 bg-surface'\n : 'sticky start-0 z-1 bg-surface-elevated group-hover/row:bg-surface';\n /**\n * The first load has nothing to show and is held with a skeleton; a refetch\n * already has rows, so it keeps them and only marks the region busy. Splitting\n * the two is what stops every pagination click flashing grey.\n */\n const isFirstLoad = isLoading && items.length === 0;\n /** Loaded, nothing came back, and nothing failed: there are no rows to lay out. */\n const settledEmpty = items.length === 0 && !isLoading && error === undefined;\n\n /** `true`/omitted → the built-in default; a node → that node; `false` → none. */\n const customSkeleton = typeof skeleton === 'boolean' ? undefined : skeleton;\n const showSkeleton = isFirstLoad && skeleton !== false;\n const skeletonRows = Array.from(\n { length: Math.min(pageSize, SKELETON_ROW_CAP) },\n (_, index) => index,\n );\n\n /**\n * A refetch keeps its rows at full contrast and marks them `aria-busy`:\n * dimming them through opacity took the text under the contrast a reader\n * needs, on every page change.\n */\n const busy = isLoading || undefined;\n\n /**\n * The column a row reads *as*: the member `recordLabel()` names it by, when\n * the reader has not hidden that column; else one declared `card: 'title'`;\n * else the first visible text one it filled in that is not a key; else the\n * table's title column, whose empty cell then reads as the record's label.\n * So every row has exactly one open link, and it is never a number or an\n * enum.\n */\n const declaredTitle = visibleColumns.find(column => column.card === 'title');\n const linkColumn = (item: TEntity) => {\n const label = recordLabel(entityConstructor, item);\n const named =\n label.kind === 'fallback'\n ? undefined\n : visibleColumns.find(column => column.name === label.member.name);\n return (\n named ??\n declaredTitle ??\n visibleColumns.find(column => {\n const value = (item as Record<string, unknown>)[column.name];\n return (\n canNameRecord(column) &&\n isTextMember(column) &&\n value != null &&\n String(value) !== ''\n );\n }) ??\n stickyTitle\n );\n };\n\n /**\n * What a record's card shows, by each member's declared `card` role or the\n * default: an id is hidden, the first enum is the badge, and up to\n * {@link UNDECLARED_META_CAP} more members are meta — a card is a summary,\n * and the grid holds the rest.\n */\n const roleOf = cardRoles(visibleColumns);\n const cardParts = (item: TEntity) => {\n const title = linkColumn(item);\n const rest = visibleColumns.filter(column => column !== title);\n let undeclared = 0;\n return {\n title,\n subtitle: rest.find(column => roleOf(column) === 'subtitle'),\n badges: rest.filter(column => roleOf(column) === 'badge'),\n meta: rest.filter(column => {\n if (roleOf(column) !== 'meta') return false;\n if (column.card !== undefined) return true;\n undeclared += 1;\n return undeclared <= UNDECLARED_META_CAP;\n }),\n };\n };\n\n const renderValue = (\n column: EntityTableColumn<TEntity>,\n item: TEntity,\n ): ReactNode =>\n column.render ? (\n column.render(item)\n ) : (\n <CellValue\n value={(item as Record<string, unknown>)[column.name]}\n descriptor={column}\n record={item as Record<string, unknown>}\n />\n );\n\n /**\n * A cell, and the row's title cell is the record's link\n * ([ADR 0026](../../../../../../../docs/adr/0026-actions-hierarchy-overflow-and-destructive-verbs.md)).\n * A column of identical \"Open\" links named nothing, and a reader tabbing\n * down it heard \"Open\" once per row; the title says which record it opens.\n * A picker's rows are chosen, not opened, so they stay plain.\n */\n const renderCell = (\n column: EntityTableColumn<TEntity>,\n item: TEntity,\n ): ReactNode => {\n if (linkColumn(item).name !== column.name) return renderValue(column, item);\n // The row's title cell left empty still reads as the record.\n const raw = (item as Record<string, unknown>)[column.name];\n const blank = column.render === undefined && (raw == null || raw === '');\n const value = blank ? rowLabel(item) : renderValue(column, item);\n if (hrefFor === undefined || onSelect !== undefined) return value;\n return renderLink({\n href: hrefFor(item.id),\n className: linkClassName,\n children: value,\n intent: { kind: 'open', id: item.id },\n });\n };\n\n /**\n * The row a shift-click ranges *from* — the last box the user actually\n * toggled. Held in a ref rather than state because it changes nothing on\n * screen, and re-rendering the whole table on every click to remember an\n * anchor is a cost with no visible return.\n */\n const anchorIndex = useRef<number | undefined>(undefined);\n\n /**\n * An entity that declares a parent renders as a tree: the page arranged\n * depth first, its first column indented, and a subtree hidden while its\n * record is collapsed. Collapsing is view state, so it lives here and is\n * forgotten with the table, like the shift-click anchor above.\n */\n const treeKeys = useMemo(\n () => hierarchyOf(entityConstructor),\n [entityConstructor],\n );\n const [collapsed, setCollapsed] = useState<ReadonlySet<string>>(\n () => new Set(),\n );\n const rows = useMemo(() => treeRows(items, treeKeys), [items, treeKeys]);\n const shown = shownTreeRows(rows, collapsed);\n const shownItems = shown.map(row => row.item);\n const toggleCollapsed = (key: string) =>\n setCollapsed(current => {\n const next = new Set(current);\n if (next.has(key)) next.delete(key);\n else next.add(key);\n return next;\n });\n\n const setSelection = (next: EntitySelection<TEntity>) =>\n onSelectionChange?.(next);\n\n const toggleRow = (\n index: number,\n checked: boolean,\n shiftKey: boolean,\n current: EntitySelection<TEntity>,\n ) => {\n // A shift-click extends the last toggle across the rows *on this page*, in\n // the direction the user dragged, and applies the new state to all of them.\n const from = shiftKey ? (anchorIndex.current ?? index) : index;\n const [start, end] = from <= index ? [from, index] : [index, from];\n\n let next = current;\n // The rows as shown: in a tree the order on screen is not the load's.\n for (const row of shownItems.slice(start, end + 1)) {\n next = toggleSelected(next, row.id, checked);\n }\n\n anchorIndex.current = index;\n setSelection(next);\n };\n\n /**\n * The header box, and it has three states rather than two: none of this\n * page's rows selected, all of them, or some. Without the third the box\n * reads as \"nothing is selected\" while a bulk bar sits below it saying\n * otherwise.\n */\n const pageIds = items.map(item => item.id);\n const selectedOnPage = selectionState\n ? pageIds.filter(id => isSelected(selectionState, id)).length\n : 0;\n const allOnPageSelected =\n pageIds.length > 0 && selectedOnPage === pageIds.length;\n const someOnPageSelected = selectedOnPage > 0 && !allOnPageSelected;\n\n const toggleAllOnPage = (\n checked: boolean,\n current: EntitySelection<TEntity>,\n ) => {\n let next = current;\n for (const id of pageIds) next = toggleSelected(next, id, checked);\n anchorIndex.current = undefined;\n setSelection(next);\n };\n\n const selectionCell = (\n item: TEntity,\n index: number,\n // Passed in rather than closed over: this is only ever called under\n // `selectable`, which already proves the selection exists, and reading the\n // optional prop here would add a fallback arm that nothing can reach.\n current: EntitySelection<TEntity>,\n ) => (\n <Checkbox\n // Deliberately no `id`: both pivots are always in the DOM, so an id here\n // would be emitted twice per row. `aria-label` names the control instead,\n // and it names the *record* rather than the position.\n aria-label={t('table.selectRow', { record: rowLabel(item) })}\n checked={isSelected(current, item.id)}\n disabled={isBulkRunning}\n onChange={event =>\n toggleRow(\n index,\n event.currentTarget.checked,\n (event.nativeEvent as MouseEvent).shiftKey === true,\n current,\n )\n }\n />\n );\n\n const runTarget = (key: string, target: PendingTarget<TEntity>) => {\n if (target.kind === 'row') onUseCase?.(key, target.item);\n else onBulkUseCase?.(key, target.selection);\n };\n\n /**\n * Every verb on the table goes through here — the row menu, the bulk bar and\n * the toolbar — so none reaches a destructive verb around its confirmation,\n * its typed check or its Undo.\n */\n const verbs = useVerbInvoker<PendingTarget<TEntity>>({\n run: runTarget,\n busy: isBulkRunning,\n served: metadata?.useCases,\n });\n\n // The row a verb last ran on. Its menu trigger unmounts when the verb moved\n // the record out of every state a row verb applies to, and focus then goes\n // to that row's own link or control rather than `<body>`.\n const rowScope = useId();\n const [lastRow, setLastRow] = useState<string | undefined>(undefined);\n useFocusOnLoss(\n () =>\n lastRow === undefined ? undefined : focusableIn(`${rowScope}${lastRow}`),\n shown\n .map(({ item }) =>\n availableUseCases(rowUseCases, item)\n .map(({ key }) => key)\n .join(','),\n )\n .join(' '),\n );\n\n const invoke = (\n useCase: UseCaseDescriptor,\n target: PendingTarget<TEntity>,\n ) => {\n if (target.kind === 'row') {\n setLastRow(String(target.item.id));\n verbs.invoke({\n descriptor: useCase,\n target,\n object: rowLabel(target.item),\n count: 1,\n });\n return;\n }\n const count = selectionSize(target.selection);\n verbs.invoke({\n descriptor: useCase,\n target,\n object: t('confirm.selection', {\n count,\n label: entityNoun(metaEntity),\n plural: entityNoun(metaEntity, 'plural'),\n }),\n count,\n matching: target.selection.mode === 'matching',\n });\n };\n\n const rowMenu = (item: TEntity) =>\n hasRowMenu ? (\n <ActionBar\n surface=\"row-menu\"\n menuLabel={t('actions.forRecord', { record: rowLabel(item) })}\n items={itemsForUseCases(\n availableUseCases(rowUseCases, item),\n translateKey,\n useCase => invoke(useCase, { kind: 'row', item }),\n )}\n />\n ) : undefined;\n\n /**\n * A picker's Select, then the row's verbs. Opening the record is not here:\n * it is the title's link.\n */\n const recordAction = (item: TEntity) => {\n const pick = onSelect ? (\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n onClick={() => onSelect(item)}\n >\n {t('table.select')}\n </Button>\n ) : undefined;\n\n const menu = rowMenu(item);\n if (!menu) return pick;\n\n return (\n <span className=\"flex items-center gap-2xs\">\n {pick}\n {menu}\n </span>\n );\n };\n\n /**\n * \"New\" is the list's primary, and only where something can be created\n * here: the entity is not one only a flow writes (`creatable: false`), and\n * the caller may write it. A list that offered \"New\" to a reader who could\n * never save opened a form with no Save on it.\n */\n const mayCreate =\n newHref !== undefined &&\n metaEntity.creatable &&\n (metadata === undefined || metadata.actions.includes('write'));\n const toolbarItems: ActionBarItem[] = itemsForUseCases(\n toolbarUseCases,\n translateKey,\n useCase =>\n invoke(useCase, { kind: 'selection', selection: everythingMatching }),\n isBulkRunning,\n );\n const declaresToolbarPrimary = toolbarItems.some(\n item => item.emphasis === 'primary',\n );\n const toolbarActions: ActionBarItem[] = [\n ...(mayCreate\n ? [\n {\n key: 'new',\n label: t('table.new'),\n emphasis: declaresToolbarPrimary\n ? ('default' as const)\n : ('primary' as const),\n href: newHref,\n intent: { kind: 'new' as const },\n },\n ]\n : []),\n ...toolbarItems,\n ];\n\n const locale = useLocale();\n const panelId = useId();\n const keys = sortKeys(sorting, columns);\n const activeFilters = filtering?.values.length ?? 0;\n const results = t('table.results', { count: totalItems });\n\n /**\n * What the status region says once a filter, a sort or a page has settled —\n * debounced, and silent on the first load.\n */\n const announcement = useResultAnnouncement(\n !isLoading,\n totalItems === 0 && activeFilters > 0\n ? t('table.noResultsFiltered')\n : results,\n JSON.stringify([filtering, sorting, currentPage, pageSize]),\n );\n\n /** The caption: what the table holds, how many, and in what order. */\n const primaryKey = keys[0];\n const primaryColumn =\n primaryKey === undefined\n ? undefined\n : columns.find(column => column.name === primaryKey.member);\n const caption =\n primaryKey === undefined || primaryColumn === undefined\n ? t('table.caption', {\n entity: entityNoun(metaEntity, 'plural'),\n results,\n })\n : t('table.captionSorted', {\n entity: entityNoun(metaEntity, 'plural'),\n results,\n column: primaryColumn.label,\n direction: t(\n primaryKey.type === 'asc' ? 'sort.ascending' : 'sort.descending',\n ),\n });\n\n /**\n * A column's header: its name, and — for a sortable one — a button that\n * cycles it ascending → descending → unsorted, with Shift adding it as the\n * next key. Only the primary key carries `aria-sort`.\n */\n const headerCell = (column: EntityTableColumn<TEntity>) => {\n const label = column.header ?? column.label;\n if (!column.sortable || onSortingChange === undefined)\n return (\n <TableHeaderCell\n key={column.name}\n className={stickyClass(column, 'header')}\n >\n {label}\n </TableHeaderCell>\n );\n const position = keys.findIndex(key => key.member === column.name);\n const type = keys[position]?.type;\n return (\n <TableHeaderCell\n key={column.name}\n className={stickyClass(column, 'header')}\n aria-sort={\n position === 0\n ? type === 'asc'\n ? 'ascending'\n : 'descending'\n : undefined\n }\n >\n <button\n type=\"button\"\n className=\"inline-flex min-h-(--target-min) items-center gap-3xs rounded-sm focus-ring hover:text-content\"\n onClick={event =>\n onSortingChange(\n nextHeaderSorting<TEntity>(\n keys,\n {\n member: column.name,\n property: queryPropertyFor(column, locale),\n },\n event.shiftKey,\n ),\n )\n }\n >\n {label}\n <span aria-hidden=\"true\">\n {type === 'asc' ? '▲' : type === 'desc' ? '▼' : '↕'}\n </span>\n {keys.length > 1 && position >= 0 && (\n <span aria-hidden=\"true\" className=\"text-step-sm\">\n {position + 1}\n </span>\n )}\n </button>\n </TableHeaderCell>\n );\n };\n\n /** A panel toggle: its state said by `aria-expanded`, and its count shown. */\n const panelToggle = (which: Exclude<Panel, 'none'>, count: number) => (\n <Button\n type=\"button\"\n id={`${panelId}-${which}`}\n variant={panel === which ? 'primary' : 'secondary'}\n size=\"sm\"\n aria-expanded={panel === which}\n aria-controls={panelId}\n onClick={() => setPanel(current => (current === which ? 'none' : which))}\n >\n {t(which === 'filters' ? 'table.filters' : 'table.sorting')}\n {count > 0 && (\n // Its name stays \"Filters\": the chips say which filters, and a count\n // in the name would change it under the reader with every filter.\n <span\n aria-hidden=\"true\"\n className=\"ms-3xs rounded-full bg-surface px-3xs text-step-sm text-content\"\n >\n {count}\n </span>\n )}\n </Button>\n );\n\n return (\n <div className=\"@container/entity-table flex flex-col gap-s\">\n {/*\n One announcement for the whole table, not one per layout. Both the grid\n and the card list are always in the DOM — CSS picks which is visible —\n so a live region inside each meant assistive tech was told twice that\n the table was loading. The shimmer itself is aria-hidden, so this is the\n only thing that carries the news.\n */}\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {isFirstLoad ? t('table.loading') : announcement}\n </span>\n\n {showControls && (\n <TableToolbar\n start={\n <>\n {/* \"New\" and the collection-bound verbs that need no\n selection. They sit here rather than in the bulk bar,\n because the bulk bar only exists while rows are ticked and\n these are always available. */}\n <LoadingBoundary isLoading={isMetadataLoading} lines={0}>\n <>\n {toolbarActions.length > 0 && (\n <ActionBar\n surface=\"table-toolbar\"\n items={toolbarActions}\n renderLink={renderLink}\n />\n )}\n </>\n </LoadingBoundary>\n {slots.toolbar}\n </>\n }\n end={\n <>\n {panelToggle('filters', activeFilters)}\n {panelToggle('sorting', keys.length)}\n <ColumnSettings\n columns={columns}\n hidden={hidden}\n onChange={setPersonalization}\n />\n </>\n }\n panelId={panelId}\n panel={\n panel === 'filters' ? (\n <FilterBuilder<TEntity>\n // Remounted when the filtering changes from outside — a chip\n // removed — so its rows show what is in effect.\n key={JSON.stringify(filtering ?? null)}\n descriptors={columns.filter(column => column.filterable)}\n facets={facets}\n value={filtering}\n onChange={(applied: FilterGroup<TEntity>) =>\n onFilteringChange?.(applied)\n }\n />\n ) : panel === 'sorting' ? (\n <SortBuilder<TEntity>\n descriptors={columns.filter(column => column.sortable)}\n value={sorting}\n onChange={(applied: EntitySorting<TEntity>) =>\n onSortingChange?.(applied)\n }\n />\n ) : undefined\n }\n />\n )}\n\n {showControls && onFilteringChange !== undefined && (\n <FilterChips<TEntity>\n descriptors={columns.filter(column => column.filterable)}\n value={filtering}\n onChange={onFilteringChange}\n />\n )}\n\n {/*\n The bar appears when there is something selected and something to do\n with it. It sits above the rows rather than floating over them: a fixed\n overlay covers the last row of a short page, which is the row the user\n most likely just ticked.\n */}\n {selectionState && selectionSize(selectionState) > 0 && (\n <BulkActionBar\n count={selectionSize(selectionState)}\n useCases={bulkUseCases}\n busy={isBulkRunning}\n // Offered only when this page is fully ticked and the store holds\n // more than the page — the escalation has somewhere to escalate to.\n matchingTotal={\n selectionState.mode === 'ids' &&\n allOnPageSelected &&\n totalItems > items.length\n ? totalItems\n : undefined\n }\n onSelectAllMatching={() => setSelection(everythingMatching)}\n onClear={() => setSelection(emptySelection<TEntity>())}\n onUseCase={useCase =>\n invoke(useCase, { kind: 'selection', selection: selectionState })\n }\n />\n )}\n\n {verbs.dialog}\n\n {bulkOutcomes && bulkOutcomes.length > 0 && onBulkDismiss && (\n <BulkResult\n outcomes={bulkOutcomes}\n busy={isBulkRunning}\n labelFor={id => {\n const row = items.find(item => item.id === id);\n return row ? rowLabel(row) : undefined;\n }}\n onRetryFailed={onBulkRetry}\n onDismiss={onBulkDismiss}\n />\n )}\n\n {/*\n Rendered once, outside both layouts, and independently of whether there\n are rows: a refetch that fails leaves the previous page on screen, and\n without this the user would read stale data as current.\n */}\n {/*\n One state for the region, outside both layouts (ADR 0028): a failed\n load with Retry — and the rows from before it marked as possibly out of\n date — or an empty answer, which says whether a filter emptied it.\n */}\n <RegionState\n plural={entityNoun(metaEntity, 'plural')}\n isLoading={isLoading}\n error={error}\n onRetry={onRetry}\n hasStaleData={items.length > 0}\n isEmpty={items.length === 0}\n isFiltered={activeFilters > 0}\n onClearFilters={\n onFilteringChange === undefined\n ? undefined\n : () => {\n // The button goes with the empty state it sits in, so focus\n // moves first to the control that filters — still there, and\n // where a reader would go next — never to `<body>`.\n document.getElementById(`${panelId}-filters`)?.focus();\n onFilteringChange({\n // Only offered under a filter, so there is one to keep the\n // logic of.\n operator: (filtering as FilterGroup<TEntity>).operator,\n values: [],\n });\n }\n }\n emptyAction={\n mayCreate\n ? renderLink({\n href: newHref as string,\n className: button({ variant: 'primary' }),\n children: t('table.new'),\n intent: { kind: 'new' },\n })\n : undefined\n }\n />\n\n {/*\n A settled empty answer is the region's state alone: a grid's header\n over no rows, announced after \"nothing here\", told the reader there\n was a table to read (ADR 0028). Loading keeps the skeleton's geometry,\n and a failure keeps whatever rows it had, so nothing already on screen\n moves.\n */}\n {!settledEmpty && (\n <>\n {/* Wide viewports: a grid. */}\n <div className={pivot.grid} aria-busy={busy}>\n {/* Held to most of the viewport so the header can stick above the\n rows; the scroll padding keeps a focused row out from under it. */}\n <Table\n caption={caption}\n containerClassName=\"max-h-(--table-max-block) scroll-pt-12\"\n // Never narrower than its columns side by side: between the\n // essential width and that, the grid scrolls rather than crushing\n // every column into an unreadable sliver.\n style={{ minWidth: `${widths.full}rem` }}\n // A focused cell scrolled sideways is never left under the\n // sticky title column (WCAG 2.4.11).\n containerStyle={{\n scrollPaddingInlineStart: `${columnWidth(stickyTitle)}rem`,\n }}\n >\n <TableHead>\n {slots.header ? (\n slots.header.render(visibleColumns)\n ) : (\n <tr>\n {selectable && (\n <TableHeaderCell>\n <Checkbox\n aria-label={t('table.selectAllOnPage')}\n checked={allOnPageSelected}\n indeterminate={someOnPageSelected}\n disabled={isBulkRunning || items.length === 0}\n onChange={event =>\n toggleAllOnPage(\n event.currentTarget.checked,\n selectionState,\n )\n }\n />\n </TableHeaderCell>\n )}\n {visibleColumns.map(headerCell)}\n {hasRowAction && (\n <TableHeaderCell>{t('table.actions')}</TableHeaderCell>\n )}\n </tr>\n )}\n </TableHead>\n <TableBody>\n {/* Skeleton rows rather than the word \"Loading\", and one per column\n rather than a single full-width blob: the placeholder occupies\n the real grid, so the swap to rows shifts nothing sideways.\n `TableMessageRow` is deliberately bypassed — it is one centred\n full-span cell and cannot express the geometry. */}\n {showSkeleton &&\n (customSkeleton ? (\n <TableMessageRow colSpan={columnCount}>\n {customSkeleton}\n </TableMessageRow>\n ) : (\n skeletonRows.map(row => (\n <TableRow key={row}>\n {selectable && (\n <TableCell>\n <Skeleton shape=\"line\" className=\"w-4\" />\n </TableCell>\n )}\n {visibleColumns.map(column => (\n <TableCell key={column.name}>\n <Skeleton shape=\"line\" className=\"w-full\" />\n </TableCell>\n ))}\n {hasRowAction && (\n <TableCell>\n <Skeleton shape=\"line\" className=\"w-16\" />\n </TableCell>\n )}\n </TableRow>\n ))\n ))}\n {shown.map(({ item, depth, hasChildren }, index) =>\n slots.row ? (\n // A Fragment carries the key without wrapping the custom row in\n // an element `<tbody>` would reject.\n <Fragment key={String(item.id ?? index)}>\n {slots.row.render(item, visibleColumns)}\n </Fragment>\n ) : (\n <TableRow\n key={String(item.id ?? index)}\n data-record-id={`${rowScope}${String(item.id)}`}\n className=\"group/row\"\n >\n {selectionState && (\n <TableCell>\n {selectionCell(item, index, selectionState)}\n </TableCell>\n )}\n {visibleColumns.map((column, columnIndex) => (\n <TableCell\n key={column.name}\n className={stickyClass(column, 'body')}\n >\n {treeKeys !== undefined && columnIndex === 0 ? (\n <TreeCell\n depth={depth}\n hasChildren={hasChildren}\n expanded={!collapsed.has(treeKeys.idOf(item))}\n label={t(\n collapsed.has(treeKeys.idOf(item))\n ? 'table.expandRow'\n : 'table.collapseRow',\n { record: rowLabel(item) },\n )}\n onToggle={() =>\n toggleCollapsed(treeKeys.idOf(item))\n }\n >\n {renderCell(column, item)}\n </TreeCell>\n ) : (\n renderCell(column, item)\n )}\n </TableCell>\n ))}\n {hasRowAction && (\n <TableCell>{recordAction(item)}</TableCell>\n )}\n </TableRow>\n ),\n )}\n </TableBody>\n </Table>\n </div>\n\n {/* Narrow containers: the same columns pivoted into a list of cards. */}\n <div className={pivot.cards} aria-busy={busy}>\n {/* The card pivot gets card-shaped placeholders, not a bare shimmer\n block: the border, radius and padding are the geometry here. */}\n {showSkeleton &&\n (customSkeleton ?? (\n <ul\n role=\"list\"\n className=\"m-0 p-0 flex list-none flex-col gap-2xs\"\n >\n {skeletonRows.map(row => (\n <li key={row}>\n <EntityRecordCard\n title={<Skeleton shape=\"line\" className=\"w-32\" />}\n meta={visibleColumns.slice(1).map(column => ({\n key: column.name,\n label: column.label,\n value: <Skeleton shape=\"line\" className=\"w-24\" />,\n }))}\n />\n </li>\n ))}\n </ul>\n ))}\n {shown.length > 0 && (\n <ul\n role=\"list\"\n className=\"m-0 p-0 flex list-none flex-col gap-2xs\"\n >\n {shown.map(({ item, depth }, index) => {\n const parts = cardParts(item);\n return (\n <li\n key={String(item.id ?? index)}\n data-record-id={`${rowScope}${String(item.id)}`}\n // A tree's card says how deep it sits, as its row does.\n aria-level={\n treeKeys === undefined ? undefined : depth + 1\n }\n style={\n treeKeys === undefined\n ? undefined\n : { marginInlineStart: `${depth * 1.5}rem` }\n }\n >\n <EntityRecordCard\n // The same renderers as the grid, so the two layouts agree.\n title={renderCell(parts.title, item)}\n subtitle={\n parts.subtitle === undefined\n ? undefined\n : renderCell(parts.subtitle, item)\n }\n badges={parts.badges.map(column => ({\n key: column.name,\n value: renderCell(column, item),\n }))}\n meta={parts.meta.map(column => ({\n key: column.name,\n label: column.header ?? column.label,\n value: renderCell(column, item),\n }))}\n leading={\n selectionState\n ? selectionCell(item, index, selectionState)\n : undefined\n }\n actions={recordAction(item)}\n />\n </li>\n );\n })}\n </ul>\n )}\n </div>\n </>\n )}\n\n <Pagination\n currentPage={currentPage}\n pageSize={pageSize}\n totalItems={totalItems}\n onPageChange={onPageChange}\n onPageSizeChange={onPageSizeChange}\n />\n\n {slots.rest}\n </div>\n );\n}\n\n/**\n * The first control in a record's row or card that the reader can see. Both\n * layouts are in the DOM and CSS shows one, so a control inside the hidden\n * one is skipped. `scoped` is the record's id under this table's own prefix,\n * so a second table on the page holding the same record is never reached.\n */\nfunction focusableIn(scoped: string): HTMLElement | undefined {\n return [\n ...document.querySelectorAll<HTMLElement>(\n `[data-record-id=\"${CSS.escape(scoped)}\"] :is(a[href], button)`,\n ),\n ].find(\n control =>\n // `checkVisibility` is recent; a browser without it is asked for the\n // boxes the control lays out, which a `display: none` layout has none of.\n control.checkVisibility?.() ?? control.getClientRects().length > 0,\n );\n}\n"],"names":["canNameRecord","emptySelection","extractMetaEntity","hierarchyOf","isSelected","isTextMember","queryPropertyFor","recordLabel","selectionSize","toggleSelected","Fragment","useId","useMemo","useRef","useState","useEntityNoun","useLocale","useT","useTranslateKey","availableUseCases","renderAnchor","useCasesForSurface","useVerbInvoker","Button","button","CellValue","useRecordLabel","Checkbox","Skeleton","Table","TableBody","TableCell","TableHead","TableHeaderCell","TableMessageRow","TableRow","linkClassName","ActionBar","itemsForUseCases","BulkActionBar","BulkResult","ColumnSettings","EntityRecordCard","FilterBuilder","FilterChips","LoadingBoundary","Pagination","RegionState","SortBuilder","TableToolbar","useFocusOnLoss","cardRoles","readEntityTableSlots","shownTreeRows","TreeCell","treeRows","nextHeaderSorting","sortKeys","ACTIONS_WIDTH","columnWidth","pivotClasses","pivotWidths","SELECTION_WIDTH","useEntityTableColumns","useResultAnnouncement","SKELETON_ROW_CAP","UNDECLARED_META_CAP","RECORD_COLUMN","EntityTable","entityConstructor","isLoading","skeleton","error","items","totalItems","currentPage","pageSize","onPageChange","onPageSizeChange","hrefFor","newHref","renderLink","onSelect","preferencesKey","hiddenColumns","showKey","showControls","pivotBreakpoint","filtering","sorting","onFilteringChange","onSortingChange","facets","selection","onSelectionChange","metadata","isMetadataLoading","onBulkUseCase","onUseCase","onRetry","bulkOutcomes","onBulkDismiss","onBulkRetry","isBulkRunning","children","t","translateKey","entityNoun","metaEntity","slots","panel","setPanel","columns","visibleColumns","resolvedColumns","hidden","setPersonalization","key","name","nameOf","rowLabel","item","titleOf","candidates","find","column","labelMember","card","namedTitle","stickyTitle","label","type","sortable","filterable","order","readonly","required","linkLabelProperty","linkSearchProperty","linkSerialization","resetOnClone","render","virtual","undefined","Error","selectionState","selectable","rowUseCases","useCases","bulkUseCases","toolbarUseCases","hasRowMenu","length","everythingMatching","mode","total","excluded","Set","hasRowAction","columnCount","widths","title","roleOf","extra","breakpoint","pivot","essential","stickyClass","part","isFirstLoad","settledEmpty","customSkeleton","showSkeleton","skeletonRows","Array","from","Math","min","_","index","busy","declaredTitle","linkColumn","named","kind","member","value","String","cardParts","rest","filter","undeclared","subtitle","badges","meta","renderValue","descriptor","record","renderCell","raw","blank","href","id","className","intent","anchorIndex","treeKeys","collapsed","setCollapsed","rows","shown","shownItems","map","row","toggleCollapsed","current","next","has","delete","add","setSelection","toggleRow","checked","shiftKey","start","end","slice","pageIds","selectedOnPage","allOnPageSelected","someOnPageSelected","toggleAllOnPage","selectionCell","aria-label","disabled","onChange","event","currentTarget","nativeEvent","runTarget","target","verbs","run","served","rowScope","lastRow","setLastRow","focusableIn","join","invoke","useCase","object","count","plural","matching","rowMenu","surface","menuLabel","recordAction","pick","variant","size","onClick","menu","span","mayCreate","creatable","actions","includes","toolbarItems","declaresToolbarPrimary","some","emphasis","toolbarActions","locale","panelId","keys","activeFilters","values","results","announcement","JSON","stringify","primaryKey","primaryColumn","caption","entity","direction","headerCell","header","position","findIndex","aria-sort","property","aria-hidden","panelToggle","which","aria-expanded","aria-controls","div","role","aria-live","lines","toolbar","descriptors","applied","matchingTotal","onSelectAllMatching","onClear","dialog","outcomes","labelFor","onRetryFailed","onDismiss","hasStaleData","isEmpty","isFiltered","onClearFilters","document","getElementById","focus","operator","emptyAction","grid","aria-busy","containerClassName","style","minWidth","full","containerStyle","scrollPaddingInlineStart","tr","indeterminate","colSpan","shape","depth","hasChildren","data-record-id","columnIndex","expanded","idOf","onToggle","cards","ul","li","parts","aria-level","marginInlineStart","leading","scoped","querySelectorAll","CSS","escape","control","checkVisibility","getClientRects"],"mappings":"AAAA;;AAEA,SACEA,aAAa,EACbC,cAAc,EAKdC,iBAAiB,EAEjBC,WAAW,EACXC,UAAU,EACVC,YAAY,EACZC,gBAAgB,EAChBC,WAAW,EACXC,aAAa,EACbC,cAAc,QAET,gBAAgB;AACvB,SACEC,QAAQ,EAERC,KAAK,EACLC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,QAAQ;AAEf,SACEC,aAAa,EACbC,SAAS,EACTC,IAAI,EACJC,eAAe,QACV,yBAAyB;AAChC,SACEC,iBAAiB,EACjBC,YAAY,EACZC,kBAAkB,QACb,yBAAyB;AAChC,SAASC,cAAc,QAAQ,oCAAoC;AACnE,SAASC,MAAM,EAAEC,MAAM,QAAQ,8BAA8B;AAC7D,SAASC,SAAS,EAAEC,cAAc,QAAQ,kCAAkC;AAC5E,SAASC,QAAQ,QAAQ,6BAA6B;AACtD,SAASC,QAAQ,QAAQ,gCAAgC;AACzD,SACEC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,eAAe,EACfC,eAAe,EACfC,QAAQ,QACH,6BAA6B;AACpC,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SACEC,SAAS,EAETC,gBAAgB,QACX,sCAAsC;AAC7C,SAASC,aAAa,QAAQ,2CAA2C;AACzE,SAASC,UAAU,QAAQ,uCAAuC;AAClE,SAASC,cAAc,QAAQ,2CAA2C;AAC1E,SAASC,gBAAgB,QAAQ,8CAA8C;AAC/E,SAASC,aAAa,QAAQ,0CAA0C;AACxE,SAASC,WAAW,QAAQ,wCAAwC;AACpE,SAASC,eAAe,QAAQ,4CAA4C;AAC5E,SAASC,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K;oDACpCwD,OAAOY,WAAWzE,QAAQJ;gDAC5B;;4CACAmO,SACE3M,iBACIuF,cAAc/G,MAAM0D,OAAOlC,kBAC3BF;4CAEN4H,SAAST,aAAazI;;uCAlCnBkE,QAAOlE,WAAAA,KAAKiF,EAAE,YAAPjF,WAAW0D;gCAsC7B;;;;;;0BAOV,KAACrI;gBACC6B,aAAaA;gBACbC,UAAUA;gBACVF,YAAYA;gBACZG,cAAcA;gBACdC,kBAAkBA;;YAGnB+B,MAAMgF,IAAI;;;AAGjB;AAEA;;;;;CAKC,GACD,SAAS0D,YAAYsG,MAAc;IACjC,OAAO;WACF/B,SAASgC,gBAAgB,CAC1B,CAAC,iBAAiB,EAAEC,IAAIC,MAAM,CAACH,QAAQ,uBAAuB,CAAC;KAElE,CAACjO,IAAI,CACJqO,CAAAA;;uBACE,qEAAqE;QACrE,0EAA0E;QAC1EA,QAAQC,eAAe,oBAAvBD,QAAQC,eAAe,MAAvBD,2BAA+BA,QAAQE,cAAc,GAAG3M,MAAM,GAAG;;AAEvE"}
|
|
@@ -87,6 +87,13 @@ export interface EntityTableProps<TEntity extends Entity> {
|
|
|
87
87
|
* the reader cannot bring it back. A name that is not a column throws.
|
|
88
88
|
*/
|
|
89
89
|
hiddenColumns?: readonly string[];
|
|
90
|
+
/**
|
|
91
|
+
* Shows the record's own key (its `id`) as a column. Off by default: an id
|
|
92
|
+
* is how a record is addressed, never how a person reads it, and a row
|
|
93
|
+
* already opens by its name — or by its noun and short id when it has none.
|
|
94
|
+
* A reference's id is unaffected, and `id=in=` still queries.
|
|
95
|
+
*/
|
|
96
|
+
showKey?: boolean;
|
|
90
97
|
/** Hide the toolbar (columns, filters, sorting) — a bare listing. */
|
|
91
98
|
showControls?: boolean;
|
|
92
99
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-table.types.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-table/entity-table.types.ts"],"names":[],"mappings":"AAAA,OAAO,K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AAE,eAAe,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC3E,mEAAmE;IACnE,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAEjD,0EAA0E;IAC1E,YAAY,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACxC,oEAAoE;IACpE,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB"}
|
|
1
|
+
{"version":3,"file":"entity-table.types.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-table/entity-table.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,MAAM,EACN,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,QAAQ,EACR,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,WAAW,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,iBAAiB,CAChC,OAAO,SAAS,MAAM,CACtB,SAAQ,qBAAqB;IAC7B,wCAAwC;IACxC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,kEAAkE;IAClE,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,SAAS,CAAC;IACtC,4EAA4E;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5D,MAAM,WAAW,gBAAgB,CAAC,OAAO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CAAC,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC9D,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,8EAA8E;IAE9E,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC5D;;;OAGG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAElE;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,6DAA6D;IAC7D,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC3E,mEAAmE;IACnE,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAEjD,0EAA0E;IAC1E,YAAY,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACxC,oEAAoE;IACpE,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ui/organisms/entity-table/entity-table.types.ts"],"sourcesContent":["import type {\n BulkOutcome,\n EntifixFailure,\n Entity,\n EntityConstructor,\n EntityFacetCounts,\n EntityFieldDescriptor,\n EntityId,\n EntityMetadataDocument,\n EntitySelection,\n EntitySorting,\n FilterGroup,\n} from '@entifix/core';\nimport type { ReactNode } from 'react';\n\nimport type { RenderLink } from '../../actions/index.js';\n\n/**\n * A column as the table finally renders it: the metadata descriptor plus the\n * per-column overrides a caller supplied through an `<EntityColumn>` slot.\n */\nexport interface EntityTableColumn<\n TEntity extends Entity,\n> extends EntityFieldDescriptor {\n /** Replaces the default header text. */\n header?: ReactNode;\n /** Replaces the default `CellValue` rendering for this column. */\n render?: (item: TEntity) => ReactNode;\n /** True when the column has no backing entity member (slot-only column). */\n virtual?: boolean;\n}\n\n/**\n * A fixed width, read against the table's own container, at and above which\n * it renders as a grid rather than as cards: `sm` 40rem, `md` 48rem, `lg` 64rem.\n */\nexport type EntityTablePivotBreakpoint = 'sm' | 'md' | 'lg';\n\nexport interface EntityTableProps<TEntity extends Entity> {\n /** Metadata source. Columns, labels, types and the filter/sort controls all\n * derive from this constructor's accessors. */\n entityConstructor: EntityConstructor<TEntity>;\n\n isLoading: boolean;\n /**\n * What holds the table's shape during the first load.\n *\n * `true` (the default) renders the built-in placeholder, which is derived from\n * the table's own resolved geometry — one shimmer cell per visible column, so\n * the swap to real rows shifts nothing. A node replaces that default; `false`\n * renders no placeholder at all.\n *\n * Only the *first* load is held this way. A refetch that already has rows\n * keeps them and marks the region busy instead — replacing populated rows with\n * shimmer on every pagination click is a grey flash, not a loading state.\n */\n skeleton?: boolean | ReactNode;\n /**\n * The failure of the last load, if it failed.\n *\n * A listing that renders an empty table when the service is unreachable tells\n * the user their catalog is empty — the one thing they must not conclude. So\n * this is rendered as an alert, and it also changes the empty message.\n *\n * It arrives for free from `useDataLoading`, whose whole state is spread into\n * this component.\n */\n error?: EntifixFailure;\n items: ReadonlyArray<TEntity>;\n totalItems: number;\n currentPage: number;\n pageSize: number;\n onPageChange: (newPage: number) => void;\n onPageSizeChange?: (newPageSize: number) => void;\n\n /**\n * Builds the link to a row's record. Supplied as a function rather than the\n * table routing by itself: this package must not depend on a router, so the\n * caller (a shell page, which does know one) owns the URL shape.\n *\n * Omit it and the actions column is not rendered at all.\n */\n hrefFor?: (id: EntityId) => string;\n /** Link to the create form. Omit and no `New` action is rendered. */\n newHref?: string;\n /**\n * Renders the `Open` and `New` links. Defaults to a plain anchor, which a\n * client-routed host experiences as a full document load — pass one built on\n * the host's own link component. See {@link RenderLink}.\n */\n renderLink?: RenderLink;\n\n /**\n * Picks a row instead of navigating to it — how a link picker reuses this\n * table as its browse dialog.\n *\n * Takes precedence over {@link hrefFor}: inside a picker the user is choosing\n * a value, and offering to navigate away from the form they are editing is the\n * wrong affordance. Either one renders the actions column.\n */\n onSelect?: (item: TEntity) => void;\n\n /** Scope for persisted personalization. Defaults to the entity's key. */\n preferencesKey?: string;\n /**\n * Columns this reader does not get — a member that is always the reader\n * themselves, say. Unlike a column the reader hides from the settings, it is\n * gone from the settings, the filters, the sort choices and the cards, and\n * the reader cannot bring it back. A name that is not a column throws.\n */\n hiddenColumns?: readonly string[];\n /** Hide the toolbar (columns, filters, sorting) — a bare listing. */\n showControls?: boolean;\n /**\n * Overrides where rows stop pivoting into cards. By default that is where\n * the visible columns fit side by side in the table's own container — the\n * sum of each member's `minWidth`, or its type's — so a table in a split\n * view, a drawer or a wizard step switches by the room it actually has.\n */\n pivotBreakpoint?: EntityTablePivotBreakpoint;\n\n /** The filtering currently applied, seeding the filter panel so it shows\n * what is in effect rather than an empty form. */\n filtering?: FilterGroup<TEntity>;\n /** The sorting currently applied, seeding the sort panel. */\n sorting?: EntitySorting<TEntity>;\n\n /** Notified when the filter panel is **applied** — not while it is edited, so\n * the value can feed a load request directly. */\n onFilteringChange?: (filtering: FilterGroup<TEntity>) => void;\n /** Loads the page again — what a failed load offers as Retry. */\n onRetry?: () => void;\n /** Notified when the sort panel is applied, or a column header is clicked. */\n\n onSortingChange?: (sorting: EntitySorting<TEntity>) => void;\n /**\n * How many records hold each value, by member, for the filter panel to show\n * beside an enum's or a boolean's choices.\n */\n facets?: EntityFacetCounts;\n\n /**\n * The rows a collection-bound action would act on.\n *\n * **Controlled from above the table**, exactly as `filtering` and `sorting`\n * are, and for the same reason plus one more: a selection has to survive\n * pagination, and the page owns the pager. A selection held inside the table\n * would be reset by the very navigation the user performs to add to it.\n *\n * Omit it and no selection column is rendered — a listing that is only read\n * gains nothing from a column of empty boxes.\n */\n selection?: EntitySelection<TEntity>;\n onSelectionChange?: (selection: EntitySelection<TEntity>) => void;\n\n /**\n * What this caller may do with the entity, as the service decided it.\n *\n * The same document `EntityForm` takes. The table reads only the\n * `collection`-bound half of `useCases` — the entity-bound verbs belong to a\n * record, and a row's own overflow menu is fed from the\n * `context-dependent` ones.\n *\n * Absent keeps the pre-ADR-0026 behaviour: no bulk bar and no row menu, which\n * is what every un-migrated call site renders today.\n */\n metadata?: EntityMetadataDocument;\n isMetadataLoading?: boolean;\n\n /** Runs a `collection`-bound verb over {@link selection}. */\n onBulkUseCase?: (key: string, selection: EntitySelection<TEntity>) => void;\n /** Runs an `entity`-bound, `context-dependent` verb on one row. */\n onUseCase?: (key: string, item: TEntity) => void;\n\n /** The outcome of the last bulk run, rendered per row until dismissed. */\n bulkOutcomes?: readonly BulkOutcome[];\n onBulkDismiss?: () => void;\n onBulkRetry?: (ids: EntityId[]) => void;\n /** A bulk run is in flight — every verb is disabled while it is. */\n isBulkRunning?: boolean;\n\n /** Customization slots — see `entity-table-slots`. */\n children?: ReactNode;\n}\n"],"names":[],"mappings":"AAsCA,
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/organisms/entity-table/entity-table.types.ts"],"sourcesContent":["import type {\n BulkOutcome,\n EntifixFailure,\n Entity,\n EntityConstructor,\n EntityFacetCounts,\n EntityFieldDescriptor,\n EntityId,\n EntityMetadataDocument,\n EntitySelection,\n EntitySorting,\n FilterGroup,\n} from '@entifix/core';\nimport type { ReactNode } from 'react';\n\nimport type { RenderLink } from '../../actions/index.js';\n\n/**\n * A column as the table finally renders it: the metadata descriptor plus the\n * per-column overrides a caller supplied through an `<EntityColumn>` slot.\n */\nexport interface EntityTableColumn<\n TEntity extends Entity,\n> extends EntityFieldDescriptor {\n /** Replaces the default header text. */\n header?: ReactNode;\n /** Replaces the default `CellValue` rendering for this column. */\n render?: (item: TEntity) => ReactNode;\n /** True when the column has no backing entity member (slot-only column). */\n virtual?: boolean;\n}\n\n/**\n * A fixed width, read against the table's own container, at and above which\n * it renders as a grid rather than as cards: `sm` 40rem, `md` 48rem, `lg` 64rem.\n */\nexport type EntityTablePivotBreakpoint = 'sm' | 'md' | 'lg';\n\nexport interface EntityTableProps<TEntity extends Entity> {\n /** Metadata source. Columns, labels, types and the filter/sort controls all\n * derive from this constructor's accessors. */\n entityConstructor: EntityConstructor<TEntity>;\n\n isLoading: boolean;\n /**\n * What holds the table's shape during the first load.\n *\n * `true` (the default) renders the built-in placeholder, which is derived from\n * the table's own resolved geometry — one shimmer cell per visible column, so\n * the swap to real rows shifts nothing. A node replaces that default; `false`\n * renders no placeholder at all.\n *\n * Only the *first* load is held this way. A refetch that already has rows\n * keeps them and marks the region busy instead — replacing populated rows with\n * shimmer on every pagination click is a grey flash, not a loading state.\n */\n skeleton?: boolean | ReactNode;\n /**\n * The failure of the last load, if it failed.\n *\n * A listing that renders an empty table when the service is unreachable tells\n * the user their catalog is empty — the one thing they must not conclude. So\n * this is rendered as an alert, and it also changes the empty message.\n *\n * It arrives for free from `useDataLoading`, whose whole state is spread into\n * this component.\n */\n error?: EntifixFailure;\n items: ReadonlyArray<TEntity>;\n totalItems: number;\n currentPage: number;\n pageSize: number;\n onPageChange: (newPage: number) => void;\n onPageSizeChange?: (newPageSize: number) => void;\n\n /**\n * Builds the link to a row's record. Supplied as a function rather than the\n * table routing by itself: this package must not depend on a router, so the\n * caller (a shell page, which does know one) owns the URL shape.\n *\n * Omit it and the actions column is not rendered at all.\n */\n hrefFor?: (id: EntityId) => string;\n /** Link to the create form. Omit and no `New` action is rendered. */\n newHref?: string;\n /**\n * Renders the `Open` and `New` links. Defaults to a plain anchor, which a\n * client-routed host experiences as a full document load — pass one built on\n * the host's own link component. See {@link RenderLink}.\n */\n renderLink?: RenderLink;\n\n /**\n * Picks a row instead of navigating to it — how a link picker reuses this\n * table as its browse dialog.\n *\n * Takes precedence over {@link hrefFor}: inside a picker the user is choosing\n * a value, and offering to navigate away from the form they are editing is the\n * wrong affordance. Either one renders the actions column.\n */\n onSelect?: (item: TEntity) => void;\n\n /** Scope for persisted personalization. Defaults to the entity's key. */\n preferencesKey?: string;\n /**\n * Columns this reader does not get — a member that is always the reader\n * themselves, say. Unlike a column the reader hides from the settings, it is\n * gone from the settings, the filters, the sort choices and the cards, and\n * the reader cannot bring it back. A name that is not a column throws.\n */\n hiddenColumns?: readonly string[];\n /**\n * Shows the record's own key (its `id`) as a column. Off by default: an id\n * is how a record is addressed, never how a person reads it, and a row\n * already opens by its name — or by its noun and short id when it has none.\n * A reference's id is unaffected, and `id=in=` still queries.\n */\n showKey?: boolean;\n /** Hide the toolbar (columns, filters, sorting) — a bare listing. */\n showControls?: boolean;\n /**\n * Overrides where rows stop pivoting into cards. By default that is where\n * the visible columns fit side by side in the table's own container — the\n * sum of each member's `minWidth`, or its type's — so a table in a split\n * view, a drawer or a wizard step switches by the room it actually has.\n */\n pivotBreakpoint?: EntityTablePivotBreakpoint;\n\n /** The filtering currently applied, seeding the filter panel so it shows\n * what is in effect rather than an empty form. */\n filtering?: FilterGroup<TEntity>;\n /** The sorting currently applied, seeding the sort panel. */\n sorting?: EntitySorting<TEntity>;\n\n /** Notified when the filter panel is **applied** — not while it is edited, so\n * the value can feed a load request directly. */\n onFilteringChange?: (filtering: FilterGroup<TEntity>) => void;\n /** Loads the page again — what a failed load offers as Retry. */\n onRetry?: () => void;\n /** Notified when the sort panel is applied, or a column header is clicked. */\n\n onSortingChange?: (sorting: EntitySorting<TEntity>) => void;\n /**\n * How many records hold each value, by member, for the filter panel to show\n * beside an enum's or a boolean's choices.\n */\n facets?: EntityFacetCounts;\n\n /**\n * The rows a collection-bound action would act on.\n *\n * **Controlled from above the table**, exactly as `filtering` and `sorting`\n * are, and for the same reason plus one more: a selection has to survive\n * pagination, and the page owns the pager. A selection held inside the table\n * would be reset by the very navigation the user performs to add to it.\n *\n * Omit it and no selection column is rendered — a listing that is only read\n * gains nothing from a column of empty boxes.\n */\n selection?: EntitySelection<TEntity>;\n onSelectionChange?: (selection: EntitySelection<TEntity>) => void;\n\n /**\n * What this caller may do with the entity, as the service decided it.\n *\n * The same document `EntityForm` takes. The table reads only the\n * `collection`-bound half of `useCases` — the entity-bound verbs belong to a\n * record, and a row's own overflow menu is fed from the\n * `context-dependent` ones.\n *\n * Absent keeps the pre-ADR-0026 behaviour: no bulk bar and no row menu, which\n * is what every un-migrated call site renders today.\n */\n metadata?: EntityMetadataDocument;\n isMetadataLoading?: boolean;\n\n /** Runs a `collection`-bound verb over {@link selection}. */\n onBulkUseCase?: (key: string, selection: EntitySelection<TEntity>) => void;\n /** Runs an `entity`-bound, `context-dependent` verb on one row. */\n onUseCase?: (key: string, item: TEntity) => void;\n\n /** The outcome of the last bulk run, rendered per row until dismissed. */\n bulkOutcomes?: readonly BulkOutcome[];\n onBulkDismiss?: () => void;\n onBulkRetry?: (ids: EntityId[]) => void;\n /** A bulk run is in flight — every verb is disabled while it is. */\n isBulkRunning?: boolean;\n\n /** Customization slots — see `entity-table-slots`. */\n children?: ReactNode;\n}\n"],"names":[],"mappings":"AAsCA,WAwJC"}
|
|
@@ -4,11 +4,12 @@ import type { EntityTableColumn } from './entity-table.types.js';
|
|
|
4
4
|
import type { EntityColumnProps } from './entity-table-slots.js';
|
|
5
5
|
/**
|
|
6
6
|
* The whole column pipeline as a pure function — metadata descriptors, then
|
|
7
|
-
* slot overrides, then what the host withholds
|
|
7
|
+
* slot overrides, then what the host withholds and the record's own key
|
|
8
|
+
* (unless `showKey`), then the user's stored layout.
|
|
8
9
|
* Kept separate from the hook so the resolution rules can be reasoned about
|
|
9
10
|
* (and tested) without React.
|
|
10
11
|
*/
|
|
11
|
-
export declare function resolveEntityTableColumns<TEntity extends Entity>(described: Array<EntityTableColumn<TEntity>>, slotColumns: Array<EntityColumnProps<TEntity>>, personalization: ColumnPersonalization, withheld?: readonly string[]): {
|
|
12
|
+
export declare function resolveEntityTableColumns<TEntity extends Entity>(described: Array<EntityTableColumn<TEntity>>, slotColumns: Array<EntityColumnProps<TEntity>>, personalization: ColumnPersonalization, withheld?: readonly string[], showKey?: boolean): {
|
|
12
13
|
columns: Array<EntityTableColumn<TEntity>>;
|
|
13
14
|
visibleColumns: Array<EntityTableColumn<TEntity>>;
|
|
14
15
|
hidden: string[];
|
|
@@ -26,5 +27,5 @@ export interface UseEntityTableColumnsResult<TEntity extends Entity> {
|
|
|
26
27
|
* Resolves the columns a table renders: entity metadata, then slot overrides,
|
|
27
28
|
* then the user's persisted layout.
|
|
28
29
|
*/
|
|
29
|
-
export declare function useEntityTableColumns<TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>, slotColumns: Array<EntityColumnProps<TEntity>>, sample: TEntity | undefined, preferenceKey: string, withheld?: readonly string[]): UseEntityTableColumnsResult<TEntity>;
|
|
30
|
+
export declare function useEntityTableColumns<TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>, slotColumns: Array<EntityColumnProps<TEntity>>, sample: TEntity | undefined, preferenceKey: string, withheld?: readonly string[], showKey?: boolean): UseEntityTableColumnsResult<TEntity>;
|
|
30
31
|
//# sourceMappingURL=use-entity-table-columns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-entity-table-columns.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-table/use-entity-table-columns.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,MAAM,EACX,KAAK,iBAAiB,EACvB,MAAM,eAAe,CAAC;AAKvB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"use-entity-table-columns.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-table/use-entity-table-columns.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,MAAM,EACX,KAAK,iBAAiB,EACvB,MAAM,eAAe,CAAC;AAKvB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AA0GjE;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,SAAS,MAAM,EAC9D,SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAC5C,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAC9C,eAAe,EAAE,qBAAqB,EACtC,QAAQ,GAAE,SAAS,MAAM,EAAkB,EAC3C,OAAO,UAAQ,GACd;IACD,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;IAClD,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAaA;AAED,MAAM,WAAW,2BAA2B,CAAC,OAAO,SAAS,MAAM;IACjE,2EAA2E;IAC3E,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,oCAAoC;IACpC,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;IAClD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,eAAe,EAAE,qBAAqB,CAAC;IACvC,kBAAkB,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;CAC3D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,MAAM,EAC1D,iBAAiB,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAC7C,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAC9C,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,aAAa,EAAE,MAAM,EACrB,QAAQ,GAAE,SAAS,MAAM,EAAkB,EAC3C,OAAO,UAAQ,GACd,2BAA2B,CAAC,OAAO,CAAC,CAqCtC"}
|
|
@@ -78,14 +78,22 @@ const NONE_WITHHELD = [];
|
|
|
78
78
|
}
|
|
79
79
|
return columns.filter((column)=>!withheld.includes(column.name));
|
|
80
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Whether a column is the record's own key — the entity's `id`, not a
|
|
83
|
+
* reference to another record's.
|
|
84
|
+
*/ function isOwnKey(column) {
|
|
85
|
+
return column.type === 'id' && column.references === undefined;
|
|
86
|
+
}
|
|
81
87
|
/**
|
|
82
88
|
* The whole column pipeline as a pure function — metadata descriptors, then
|
|
83
|
-
* slot overrides, then what the host withholds
|
|
89
|
+
* slot overrides, then what the host withholds and the record's own key
|
|
90
|
+
* (unless `showKey`), then the user's stored layout.
|
|
84
91
|
* Kept separate from the hook so the resolution rules can be reasoned about
|
|
85
92
|
* (and tested) without React.
|
|
86
|
-
*/ export function resolveEntityTableColumns(described, slotColumns, personalization, withheld = NONE_WITHHELD) {
|
|
93
|
+
*/ export function resolveEntityTableColumns(described, slotColumns, personalization, withheld = NONE_WITHHELD, showKey = false) {
|
|
87
94
|
var _personalization_hidden;
|
|
88
|
-
const
|
|
95
|
+
const kept = withhold(mergeSlots(described, slotColumns), withheld);
|
|
96
|
+
const columns = applyOrder(showKey ? kept : kept.filter((column)=>!isOwnKey(column)), personalization.order);
|
|
89
97
|
const hidden = (_personalization_hidden = personalization.hidden) != null ? _personalization_hidden : [];
|
|
90
98
|
return {
|
|
91
99
|
columns,
|
|
@@ -96,7 +104,7 @@ const NONE_WITHHELD = [];
|
|
|
96
104
|
/**
|
|
97
105
|
* Resolves the columns a table renders: entity metadata, then slot overrides,
|
|
98
106
|
* then the user's persisted layout.
|
|
99
|
-
*/ export function useEntityTableColumns(entityConstructor, slotColumns, sample, preferenceKey, withheld = NONE_WITHHELD) {
|
|
107
|
+
*/ export function useEntityTableColumns(entityConstructor, slotColumns, sample, preferenceKey, withheld = NONE_WITHHELD, showKey = false) {
|
|
100
108
|
const { value: personalization, setValue: setPersonalization } = useUiPreference(preferenceKey, EMPTY_PERSONALIZATION);
|
|
101
109
|
const metadata = useMemo(()=>describeEntityColumns(entityConstructor, sample), [
|
|
102
110
|
entityConstructor,
|
|
@@ -108,7 +116,7 @@ const NONE_WITHHELD = [];
|
|
|
108
116
|
// Not memoized: `slotColumns` is rebuilt from `children` on every render, so
|
|
109
117
|
// any dependency list would miss every time. The work is a few array passes
|
|
110
118
|
// over a handful of columns — cheaper than the comparison would be.
|
|
111
|
-
const { columns, visibleColumns, hidden } = resolveEntityTableColumns(described, slotColumns, personalization, withheld);
|
|
119
|
+
const { columns, visibleColumns, hidden } = resolveEntityTableColumns(described, slotColumns, personalization, withheld, showKey);
|
|
112
120
|
return {
|
|
113
121
|
columns,
|
|
114
122
|
visibleColumns,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ui/organisms/entity-table/use-entity-table-columns.ts"],"sourcesContent":["'use client';\n\nimport {\n describeEntityColumns,\n type Entity,\n type EntityConstructor,\n} from '@entifix/core';\nimport { useMemo } from 'react';\n\nimport { useLocalizedDescriptors } from '../../../i18n/index.js';\nimport { useUiPreference } from '../../../preferences/index.js';\nimport type { ColumnPersonalization } from '../../molecules/column-settings/index.js';\nimport type { EntityTableColumn } from './entity-table.types.js';\nimport type { EntityColumnProps } from './entity-table-slots.js';\n\nconst EMPTY_PERSONALIZATION: ColumnPersonalization = {};\nconst NONE_WITHHELD: readonly string[] = [];\n\n/**\n * Applies `<EntityColumn>` overrides on top of the metadata descriptors, and\n * appends a virtual column for any slot naming a member the entity does not\n * have (a computed column).\n */\nfunction mergeSlots<TEntity extends Entity>(\n descriptors: Array<EntityTableColumn<TEntity>>,\n slotColumns: Array<EntityColumnProps<TEntity>>,\n): Array<EntityTableColumn<TEntity>> {\n const merged = descriptors.map(descriptor => {\n const slot = slotColumns.find(entry => entry.field === descriptor.name);\n if (!slot) return descriptor;\n const { field: _field, ...overrides } = slot;\n return {\n ...descriptor,\n ...Object.fromEntries(\n Object.entries(overrides).filter(([, value]) => value !== undefined),\n ),\n } as EntityTableColumn<TEntity>;\n });\n\n const virtual = slotColumns\n .filter(slot => !descriptors.some(entry => entry.name === slot.field))\n .map<EntityTableColumn<TEntity>>((slot, index) => ({\n name: slot.field,\n key: slot.field,\n label: slot.label ?? slot.field,\n type: slot.type ?? 'string',\n sortable: slot.sortable ?? false,\n filterable: slot.filterable ?? false,\n order: slot.order ?? descriptors.length + index,\n readonly: false,\n required: false,\n linkLabelProperty: 'name',\n linkSearchProperty: 'name',\n linkSerialization: 'id',\n // A slot-only column has no accessor, so there is nothing for a copy to\n // reset — the value is computed from members that are cloned themselves.\n resetOnClone: false,\n ...(slot.minWidth === undefined ? {} : { minWidth: slot.minWidth }),\n header: slot.header,\n render: slot.render,\n virtual: true,\n }));\n\n return [...merged, ...virtual].sort(\n (left, right) => left.order - right.order,\n );\n}\n\n/**\n * Reorders columns per the stored personalization. Names the user never saw\n * (added to the entity after the layout was saved) keep their default position\n * at the end instead of vanishing, and stale names in the stored order are\n * dropped — so a saved layout degrades rather than breaks.\n */\nfunction applyOrder<TEntity extends Entity>(\n columns: Array<EntityTableColumn<TEntity>>,\n order: string[] | undefined,\n): Array<EntityTableColumn<TEntity>> {\n if (!order || order.length === 0) return columns;\n\n const ranked = order\n .map(name => columns.find(column => column.name === name))\n .filter((column): column is EntityTableColumn<TEntity> => !!column);\n const remaining = columns.filter(column => !order.includes(column.name));\n\n return [...ranked, ...remaining];\n}\n\n/**\n * Drops the columns the host withholds from this reader. Not a hidden column\n * the reader can bring back: it is gone from the settings, the filters, the\n * sort choices and the cards. A name that is no column throws, because a\n * withheld column that is still on screen is the failure nobody would notice.\n */\nfunction withhold<TEntity extends Entity>(\n columns: Array<EntityTableColumn<TEntity>>,\n withheld: readonly string[],\n): Array<EntityTableColumn<TEntity>> {\n for (const name of withheld) {\n if (!columns.some(column => column.name === name)) {\n throw new Error(\n `EntityTable was asked to hide \"${name}\", which is not one of its columns. ` +\n 'Name a member the entity declares, or a column a slot adds.',\n );\n }\n }\n return columns.filter(column => !withheld.includes(column.name));\n}\n\n/**\n * The whole column pipeline as a pure function — metadata descriptors, then\n * slot overrides, then what the host withholds, then the user's stored layout.\n * Kept separate from the hook so the resolution rules can be reasoned about\n * (and tested) without React.\n */\nexport function resolveEntityTableColumns<TEntity extends Entity>(\n described: Array<EntityTableColumn<TEntity>>,\n slotColumns: Array<EntityColumnProps<TEntity>>,\n personalization: ColumnPersonalization,\n withheld: readonly string[] = NONE_WITHHELD,\n): {\n columns: Array<EntityTableColumn<TEntity>>;\n visibleColumns: Array<EntityTableColumn<TEntity>>;\n hidden: string[];\n} {\n const columns = applyOrder(\n withhold(mergeSlots(described, slotColumns), withheld),\n personalization.order,\n );\n const hidden = personalization.hidden ?? [];\n\n return {\n columns,\n visibleColumns: columns.filter(column => !hidden.includes(column.name)),\n hidden,\n };\n}\n\nexport interface UseEntityTableColumnsResult<TEntity extends Entity> {\n /** Every column, in the user's order — what the settings popover lists. */\n columns: Array<EntityTableColumn<TEntity>>;\n /** The subset actually rendered. */\n visibleColumns: Array<EntityTableColumn<TEntity>>;\n hidden: string[];\n personalization: ColumnPersonalization;\n setPersonalization: (next: ColumnPersonalization) => void;\n}\n\n/**\n * Resolves the columns a table renders: entity metadata, then slot overrides,\n * then the user's persisted layout.\n */\nexport function useEntityTableColumns<TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n slotColumns: Array<EntityColumnProps<TEntity>>,\n sample: TEntity | undefined,\n preferenceKey: string,\n withheld: readonly string[] = NONE_WITHHELD,\n): UseEntityTableColumnsResult<TEntity> {\n const { value: personalization, setValue: setPersonalization } =\n useUiPreference<ColumnPersonalization>(\n preferenceKey,\n EMPTY_PERSONALIZATION,\n );\n\n const metadata = useMemo(\n () =>\n describeEntityColumns(entityConstructor, sample) as Array<\n EntityTableColumn<TEntity>\n >,\n [entityConstructor, sample],\n );\n\n // Before slots merge, so an `<EntityColumn label>` override still wins over\n // the entity's own translated label.\n const described = useLocalizedDescriptors(metadata);\n\n // Not memoized: `slotColumns` is rebuilt from `children` on every render, so\n // any dependency list would miss every time. The work is a few array passes\n // over a handful of columns — cheaper than the comparison would be.\n const { columns, visibleColumns, hidden } = resolveEntityTableColumns(\n described,\n slotColumns,\n personalization,\n withheld,\n );\n\n return {\n columns,\n visibleColumns,\n hidden,\n personalization,\n setPersonalization,\n };\n}\n"],"names":["describeEntityColumns","useMemo","useLocalizedDescriptors","useUiPreference","EMPTY_PERSONALIZATION","NONE_WITHHELD","mergeSlots","descriptors","slotColumns","merged","map","descriptor","slot","find","entry","field","name","_field","overrides","Object","fromEntries","entries","filter","value","undefined","virtual","some","index","key","label","type","sortable","filterable","order","length","readonly","required","linkLabelProperty","linkSearchProperty","linkSerialization","resetOnClone","minWidth","header","render","sort","left","right","applyOrder","columns","ranked","column","remaining","includes","withhold","withheld","Error","resolveEntityTableColumns","described","personalization","hidden","visibleColumns","useEntityTableColumns","entityConstructor","sample","preferenceKey","setValue","setPersonalization","metadata"],"mappings":"AAAA;;;AAEA,SACEA,qBAAqB,QAGhB,gBAAgB;AACvB,SAASC,OAAO,QAAQ,QAAQ;AAEhC,SAASC,uBAAuB,QAAQ,yBAAyB;AACjE,SAASC,eAAe,QAAQ,gCAAgC;AAKhE,MAAMC,wBAA+C,CAAC;AACtD,MAAMC,gBAAmC,EAAE;AAE3C;;;;CAIC,GACD,SAASC,WACPC,WAA8C,EAC9CC,WAA8C;IAE9C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,CAAAA,SAAU,CAACS,OAAOP,QAAQ,CAACF,OAAOlC,IAAI;QACrE2C;IACF;AACF;AAYA;;;CAGC,GACD,OAAO,SAASE,sBACdC,iBAA6C,EAC7CtD,WAA8C,EAC9CuD,MAA2B,EAC3BC,aAAqB,EACrBV,WAA8BjD,aAAa;IAE3C,MAAM,EAAEkB,OAAOmC,eAAe,EAAEO,UAAUC,kBAAkB,EAAE,GAC5D/D,gBACE6D,eACA5D;IAGJ,MAAM+D,WAAWlE,QACf,IACED,sBAAsB8D,mBAAmBC,SAG3C;QAACD;QAAmBC;KAAO;IAG7B,4EAA4E;IAC5E,qCAAqC;IACrC,MAAMN,YAAYvD,wBAAwBiE;IAE1C,6EAA6E;IAC7E,4EAA4E;IAC5E,oEAAoE;IACpE,MAAM,EAAEnB,OAAO,EAAEY,cAAc,EAAED,MAAM,EAAE,GAAGH,0BAC1CC,WACAjD,aACAkD,iBACAJ;IAGF,OAAO;QACLN;QACAY;QACAD;QACAD;QACAQ;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/organisms/entity-table/use-entity-table-columns.ts"],"sourcesContent":["'use client';\n\nimport {\n describeEntityColumns,\n type Entity,\n type EntityConstructor,\n} from '@entifix/core';\nimport { useMemo } from 'react';\n\nimport { useLocalizedDescriptors } from '../../../i18n/index.js';\nimport { useUiPreference } from '../../../preferences/index.js';\nimport type { ColumnPersonalization } from '../../molecules/column-settings/index.js';\nimport type { EntityTableColumn } from './entity-table.types.js';\nimport type { EntityColumnProps } from './entity-table-slots.js';\n\nconst EMPTY_PERSONALIZATION: ColumnPersonalization = {};\nconst NONE_WITHHELD: readonly string[] = [];\n\n/**\n * Applies `<EntityColumn>` overrides on top of the metadata descriptors, and\n * appends a virtual column for any slot naming a member the entity does not\n * have (a computed column).\n */\nfunction mergeSlots<TEntity extends Entity>(\n descriptors: Array<EntityTableColumn<TEntity>>,\n slotColumns: Array<EntityColumnProps<TEntity>>,\n): Array<EntityTableColumn<TEntity>> {\n const merged = descriptors.map(descriptor => {\n const slot = slotColumns.find(entry => entry.field === descriptor.name);\n if (!slot) return descriptor;\n const { field: _field, ...overrides } = slot;\n return {\n ...descriptor,\n ...Object.fromEntries(\n Object.entries(overrides).filter(([, value]) => value !== undefined),\n ),\n } as EntityTableColumn<TEntity>;\n });\n\n const virtual = slotColumns\n .filter(slot => !descriptors.some(entry => entry.name === slot.field))\n .map<EntityTableColumn<TEntity>>((slot, index) => ({\n name: slot.field,\n key: slot.field,\n label: slot.label ?? slot.field,\n type: slot.type ?? 'string',\n sortable: slot.sortable ?? false,\n filterable: slot.filterable ?? false,\n order: slot.order ?? descriptors.length + index,\n readonly: false,\n required: false,\n linkLabelProperty: 'name',\n linkSearchProperty: 'name',\n linkSerialization: 'id',\n // A slot-only column has no accessor, so there is nothing for a copy to\n // reset — the value is computed from members that are cloned themselves.\n resetOnClone: false,\n ...(slot.minWidth === undefined ? {} : { minWidth: slot.minWidth }),\n header: slot.header,\n render: slot.render,\n virtual: true,\n }));\n\n return [...merged, ...virtual].sort(\n (left, right) => left.order - right.order,\n );\n}\n\n/**\n * Reorders columns per the stored personalization. Names the user never saw\n * (added to the entity after the layout was saved) keep their default position\n * at the end instead of vanishing, and stale names in the stored order are\n * dropped — so a saved layout degrades rather than breaks.\n */\nfunction applyOrder<TEntity extends Entity>(\n columns: Array<EntityTableColumn<TEntity>>,\n order: string[] | undefined,\n): Array<EntityTableColumn<TEntity>> {\n if (!order || order.length === 0) return columns;\n\n const ranked = order\n .map(name => columns.find(column => column.name === name))\n .filter((column): column is EntityTableColumn<TEntity> => !!column);\n const remaining = columns.filter(column => !order.includes(column.name));\n\n return [...ranked, ...remaining];\n}\n\n/**\n * Drops the columns the host withholds from this reader. Not a hidden column\n * the reader can bring back: it is gone from the settings, the filters, the\n * sort choices and the cards. A name that is no column throws, because a\n * withheld column that is still on screen is the failure nobody would notice.\n */\nfunction withhold<TEntity extends Entity>(\n columns: Array<EntityTableColumn<TEntity>>,\n withheld: readonly string[],\n): Array<EntityTableColumn<TEntity>> {\n for (const name of withheld) {\n if (!columns.some(column => column.name === name)) {\n throw new Error(\n `EntityTable was asked to hide \"${name}\", which is not one of its columns. ` +\n 'Name a member the entity declares, or a column a slot adds.',\n );\n }\n }\n return columns.filter(column => !withheld.includes(column.name));\n}\n\n/**\n * Whether a column is the record's own key — the entity's `id`, not a\n * reference to another record's.\n */\nfunction isOwnKey<TEntity extends Entity>(\n column: EntityTableColumn<TEntity>,\n): boolean {\n return column.type === 'id' && column.references === undefined;\n}\n\n/**\n * The whole column pipeline as a pure function — metadata descriptors, then\n * slot overrides, then what the host withholds and the record's own key\n * (unless `showKey`), then the user's stored layout.\n * Kept separate from the hook so the resolution rules can be reasoned about\n * (and tested) without React.\n */\nexport function resolveEntityTableColumns<TEntity extends Entity>(\n described: Array<EntityTableColumn<TEntity>>,\n slotColumns: Array<EntityColumnProps<TEntity>>,\n personalization: ColumnPersonalization,\n withheld: readonly string[] = NONE_WITHHELD,\n showKey = false,\n): {\n columns: Array<EntityTableColumn<TEntity>>;\n visibleColumns: Array<EntityTableColumn<TEntity>>;\n hidden: string[];\n} {\n const kept = withhold(mergeSlots(described, slotColumns), withheld);\n const columns = applyOrder(\n showKey ? kept : kept.filter(column => !isOwnKey(column)),\n personalization.order,\n );\n const hidden = personalization.hidden ?? [];\n\n return {\n columns,\n visibleColumns: columns.filter(column => !hidden.includes(column.name)),\n hidden,\n };\n}\n\nexport interface UseEntityTableColumnsResult<TEntity extends Entity> {\n /** Every column, in the user's order — what the settings popover lists. */\n columns: Array<EntityTableColumn<TEntity>>;\n /** The subset actually rendered. */\n visibleColumns: Array<EntityTableColumn<TEntity>>;\n hidden: string[];\n personalization: ColumnPersonalization;\n setPersonalization: (next: ColumnPersonalization) => void;\n}\n\n/**\n * Resolves the columns a table renders: entity metadata, then slot overrides,\n * then the user's persisted layout.\n */\nexport function useEntityTableColumns<TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n slotColumns: Array<EntityColumnProps<TEntity>>,\n sample: TEntity | undefined,\n preferenceKey: string,\n withheld: readonly string[] = NONE_WITHHELD,\n showKey = false,\n): UseEntityTableColumnsResult<TEntity> {\n const { value: personalization, setValue: setPersonalization } =\n useUiPreference<ColumnPersonalization>(\n preferenceKey,\n EMPTY_PERSONALIZATION,\n );\n\n const metadata = useMemo(\n () =>\n describeEntityColumns(entityConstructor, sample) as Array<\n EntityTableColumn<TEntity>\n >,\n [entityConstructor, sample],\n );\n\n // Before slots merge, so an `<EntityColumn label>` override still wins over\n // the entity's own translated label.\n const described = useLocalizedDescriptors(metadata);\n\n // Not memoized: `slotColumns` is rebuilt from `children` on every render, so\n // any dependency list would miss every time. The work is a few array passes\n // over a handful of columns — cheaper than the comparison would be.\n const { columns, visibleColumns, hidden } = resolveEntityTableColumns(\n described,\n slotColumns,\n personalization,\n withheld,\n showKey,\n );\n\n return {\n columns,\n visibleColumns,\n hidden,\n personalization,\n setPersonalization,\n };\n}\n"],"names":["describeEntityColumns","useMemo","useLocalizedDescriptors","useUiPreference","EMPTY_PERSONALIZATION","NONE_WITHHELD","mergeSlots","descriptors","slotColumns","merged","map","descriptor","slot","find","entry","field","name","_field","overrides","Object","fromEntries","entries","filter","value","undefined","virtual","some","index","key","label","type","sortable","filterable","order","length","readonly","required","linkLabelProperty","linkSearchProperty","linkSerialization","resetOnClone","minWidth","header","render","sort","left","right","applyOrder","columns","ranked","column","remaining","includes","withhold","withheld","Error","isOwnKey","references","resolveEntityTableColumns","described","personalization","showKey","kept","hidden","visibleColumns","useEntityTableColumns","entityConstructor","sample","preferenceKey","setValue","setPersonalization","metadata"],"mappings":"AAAA;;;AAEA,SACEA,qBAAqB,QAGhB,gBAAgB;AACvB,SAASC,OAAO,QAAQ,QAAQ;AAEhC,SAASC,uBAAuB,QAAQ,yBAAyB;AACjE,SAASC,eAAe,QAAQ,gCAAgC;AAKhE,MAAMC,wBAA+C,CAAC;AACtD,MAAMC,gBAAmC,EAAE;AAE3C;;;;CAIC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AWnD,cAAc8C;IAC1D,MAAMN,UAAUD,WACdc,UAAUC,OAAOA,KAAKxC,MAAM,CAAC4B,CAAAA,SAAU,CAACM,SAASN,UACjDU,gBAAgB3B,KAAK;IAEvB,MAAM8B,UAASH,0BAAAA,gBAAgBG,MAAM,YAAtBH,0BAA0B,EAAE;IAE3C,OAAO;QACLZ;QACAgB,gBAAgBhB,QAAQ1B,MAAM,CAAC4B,CAAAA,SAAU,CAACa,OAAOX,QAAQ,CAACF,OAAOlC,IAAI;QACrE+C;IACF;AACF;AAYA;;;CAGC,GACD,OAAO,SAASE,sBACdC,iBAA6C,EAC7C1D,WAA8C,EAC9C2D,MAA2B,EAC3BC,aAAqB,EACrBd,WAA8BjD,aAAa,EAC3CwD,UAAU,KAAK;IAEf,MAAM,EAAEtC,OAAOqC,eAAe,EAAES,UAAUC,kBAAkB,EAAE,GAC5DnE,gBACEiE,eACAhE;IAGJ,MAAMmE,WAAWtE,QACf,IACED,sBAAsBkE,mBAAmBC,SAG3C;QAACD;QAAmBC;KAAO;IAG7B,4EAA4E;IAC5E,qCAAqC;IACrC,MAAMR,YAAYzD,wBAAwBqE;IAE1C,6EAA6E;IAC7E,4EAA4E;IAC5E,oEAAoE;IACpE,MAAM,EAAEvB,OAAO,EAAEgB,cAAc,EAAED,MAAM,EAAE,GAAGL,0BAC1CC,WACAnD,aACAoD,iBACAN,UACAO;IAGF,OAAO;QACLb;QACAgB;QACAD;QACAH;QACAU;IACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entifix/react-controls",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.3",
|
|
4
4
|
"description": "Entity-agnostic React UI — table, form, filters, wizard, command palette — rendered from entity metadata, plus layout primitives.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@headlessui/react": "^2.2.10",
|
|
20
20
|
"class-variance-authority": "^0.7.1",
|
|
21
21
|
"idb": "^8.0.4",
|
|
22
|
-
"@entifix/core": "0.22.
|
|
22
|
+
"@entifix/core": "0.22.3"
|
|
23
23
|
},
|
|
24
24
|
"exports": {
|
|
25
25
|
"./package.json": "./package.json",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"react": "19.3.1",
|
|
56
56
|
"react-i18next": "17.1.10",
|
|
57
57
|
"storybook": "^10.6.6",
|
|
58
|
-
"@entifix/i18n": "0.22.
|
|
59
|
-
"@entifix/style": "0.22.
|
|
58
|
+
"@entifix/i18n": "0.22.3",
|
|
59
|
+
"@entifix/style": "0.22.3"
|
|
60
60
|
},
|
|
61
61
|
"nx": {
|
|
62
62
|
"tags": [
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"i18next": ">=26 <27",
|
|
112
112
|
"react": ">=19 <20",
|
|
113
113
|
"react-i18next": ">=17 <18",
|
|
114
|
-
"@entifix/i18n": "0.22.
|
|
114
|
+
"@entifix/i18n": "0.22.3"
|
|
115
115
|
},
|
|
116
116
|
"peerDependenciesMeta": {
|
|
117
117
|
"@entifix/i18n": {
|