@solexllc/usx-react 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +15 -0
  2. package/dist/index.cjs +3173 -3238
  3. package/dist/index.js +3174 -3239
  4. package/package.json +4 -4
  5. package/src/components/checkbox/Checkbox.tsx +9 -4
  6. package/src/components/checkbox/checkbox.django.html +2 -2
  7. package/src/components/checkbox/config.json +9 -0
  8. package/src/components/data-table/DataTable.tsx +177 -0
  9. package/src/components/data-table/README.md +42 -0
  10. package/src/components/data-table/TableBody.tsx +123 -0
  11. package/src/components/{table → data-table}/TableCell.tsx +6 -3
  12. package/src/components/data-table/TableContext.tsx +49 -0
  13. package/src/components/{table → data-table}/TableFoot.tsx +8 -7
  14. package/src/components/data-table/TableGroup.tsx +62 -0
  15. package/src/components/data-table/TableHead.tsx +126 -0
  16. package/src/components/data-table/TableRow.tsx +24 -0
  17. package/src/components/data-table/cells.ts +49 -0
  18. package/src/components/data-table/columns.ts +15 -0
  19. package/src/components/data-table/config.json +375 -0
  20. package/src/components/data-table/data-table.django-snapshot.html +13560 -0
  21. package/src/components/data-table/data-table.django.html +13 -0
  22. package/src/components/data-table/data-table.html +34 -0
  23. package/src/components/data-table/data-table.react-snapshot.html +12033 -0
  24. package/src/components/{table → data-table}/table-body.django.html +12 -12
  25. package/src/components/{table → data-table}/table-foot.django.html +6 -6
  26. package/src/components/data-table/table-group.django.html +24 -0
  27. package/src/components/data-table/table-head.django.html +21 -0
  28. package/src/components/data-table/table-row.django.html +57 -0
  29. package/src/components/{table → data-table}/types.ts +48 -5
  30. package/src/components/pagination/Pagination.tsx +7 -1
  31. package/src/components/pagination/config.json +8 -0
  32. package/src/components/pagination/navigation/PaginationNavigation.tsx +10 -0
  33. package/src/components/pagination/step-options/PaginationStepOptions.tsx +3 -0
  34. package/src/components/radio-buttons/RadioButtons.tsx +37 -27
  35. package/src/components/radio-buttons/config.json +19 -1
  36. package/src/components/radio-buttons/radio-buttons.django-snapshot.html +28 -60
  37. package/src/components/radio-buttons/radio-buttons.django.html +16 -28
  38. package/src/components/table/Table.tsx +64 -334
  39. package/src/components/table/config.json +21 -339
  40. package/src/components/table/table.django-snapshot.html +712 -1482
  41. package/src/components/table/table.django.html +14 -59
  42. package/src/components/table/table.html +7 -2364
  43. package/src/components/table/table.react-snapshot.html +711 -2085
  44. package/src/index.js +1 -0
  45. package/src/components/table/TableBody.tsx +0 -256
  46. package/src/components/table/TableContext.tsx +0 -87
  47. package/src/components/table/TableGroup.tsx +0 -69
  48. package/src/components/table/TableHead.tsx +0 -139
  49. package/src/components/table/TableRow.tsx +0 -56
  50. package/src/components/table/hooks/useRowDetails.ts +0 -34
  51. package/src/components/table/hooks/useTableGroups.ts +0 -61
  52. package/src/components/table/hooks/useTableSelect.ts +0 -82
  53. package/src/components/table/hooks/useTableSort.ts +0 -60
  54. package/src/components/table/table-group.django.html +0 -40
  55. package/src/components/table/table-head.django.html +0 -85
  56. package/src/components/table/table-row.django.html +0 -98
  57. package/src/components/table/table_helper.py +0 -298
  58. /package/src/components/{table → data-table}/table-detail-row.django.html +0 -0
@@ -0,0 +1,126 @@
1
+ import React from 'react';
2
+ import classnames from 'classnames';
3
+ import { useTableContext } from './TableContext';
4
+ import type { TableColumn } from './types';
5
+ import { visibleColumns } from './columns';
6
+ import Checkbox from '../checkbox/Checkbox';
7
+
8
+ // ─── Multi-level header helpers ──────────────────────────────────────────────
9
+
10
+ function getDepth(columns: TableColumn[]): number {
11
+ let max = 1;
12
+ for (const col of columns) {
13
+ if (col.columns?.length) max = Math.max(max, 1 + getDepth(col.columns));
14
+ }
15
+ return max;
16
+ }
17
+
18
+ function getLeafCount(col: TableColumn): number {
19
+ if (!col.columns?.length) return 1;
20
+ return col.columns.reduce((sum, c) => sum + getLeafCount(c), 0);
21
+ }
22
+
23
+ interface HeaderCell {
24
+ col: TableColumn;
25
+ rowSpan: number;
26
+ colSpan: number;
27
+ }
28
+
29
+ // One array of cells per header level; leaf columns span down to the last level.
30
+ function buildHeaderRows(columns: TableColumn[], totalDepth: number): HeaderCell[][] {
31
+ const rows: HeaderCell[][] = Array.from({ length: totalDepth }, () => []);
32
+ function traverse(cols: TableColumn[], level: number) {
33
+ for (const col of cols) {
34
+ const isLeaf = !col.columns?.length;
35
+ rows[level].push({ col, rowSpan: isLeaf ? totalDepth - level : 1, colSpan: isLeaf ? 1 : getLeafCount(col) });
36
+ if (!isLeaf) traverse(col.columns!, level + 1);
37
+ }
38
+ }
39
+ traverse(columns, 0);
40
+ return rows;
41
+ }
42
+
43
+ export type TableHeadProps = React.HTMLAttributes<HTMLTableSectionElement>;
44
+
45
+ /**
46
+ * Renders `<thead>`. Compound mode: wrap your own `<tr>`/`<th>` children.
47
+ * Data-driven mode: pass no children; renders from the table's columns.
48
+ */
49
+ export default function TableHead({ className = '', children, ...props }: TableHeadProps) {
50
+ const { id, columns, data, primaryKey, groupHeaders, selectionMode, selectionPosition, selectionVerticalAlign, selectedKeys, disabled, allowSelectAll, rowDetails } =
51
+ useTableContext();
52
+
53
+ if (children) {
54
+ return (
55
+ <thead className={classnames('usx-data-table__head', className)} {...props}>
56
+ {children}
57
+ </thead>
58
+ );
59
+ }
60
+
61
+ const visibleCols = visibleColumns(columns);
62
+ const totalDepth = getDepth(visibleCols);
63
+ const headerRows = buildHeaderRows(visibleCols, totalDepth);
64
+ const hasRowDetails = !!rowDetails;
65
+ const hasSelection = !!selectionMode;
66
+ const enabled = data.filter((row) => !disabled.includes(row[primaryKey] as string | number));
67
+ const isAllSelected = enabled.length > 0 && enabled.every((row) => selectedKeys.has(row[primaryKey] as string | number));
68
+ const selectionRowSpan = totalDepth + Number(groupHeaders.length > 0);
69
+
70
+ const selectAllCell = (
71
+ <th scope="col" rowSpan={selectionRowSpan > 1 ? selectionRowSpan : undefined} className={classnames('usx-data-table__cell', 'usx-data-table__cell--selection', `usx-data-table__cell--valign-${selectionVerticalAlign}`)}>
72
+ {selectionMode === 'checkbox' && allowSelectAll && (
73
+ <Checkbox id={`${id}-select-all`} label="" ariaLabel="Select all rows" small={true} formGroup={false}
74
+ checked={isAllSelected} />
75
+ )}
76
+ </th>
77
+ );
78
+
79
+ return (
80
+ <thead className={classnames('usx-data-table__head', className)} {...props}>
81
+ {!!groupHeaders.length && <tr className="usx-data-table__head-row usx-data-table__head-row--groups">
82
+ {hasRowDetails && <th scope="col" rowSpan={totalDepth + 1} className="usx-data-table__cell usx-data-table__cell--detail-toggle" aria-label="Row details" />}
83
+ {hasSelection && selectionPosition === 'left' && selectAllCell}
84
+ {groupHeaders.map((column) => <th key={column.key} scope="col" colSpan={column.colSpan}
85
+ className={classnames('usx-data-table__cell', column.align && `usx-data-table__cell--align-${column.align}`,
86
+ column.verticalAlign && `usx-data-table__cell--valign-${column.verticalAlign}`, column.className)}
87
+ style={{ backgroundColor: column.backgroundColor, color: column.color }}>{column.header}</th>)}
88
+ {hasSelection && selectionPosition === 'right' && selectAllCell}
89
+ </tr>}
90
+ {headerRows.map((row, rowIndex) => (
91
+ <tr key={rowIndex} className="usx-data-table__head-row">
92
+ {hasRowDetails && rowIndex === 0 && !groupHeaders.length && (
93
+ <th scope="col" rowSpan={totalDepth > 1 ? totalDepth : undefined} className="usx-data-table__cell usx-data-table__cell--detail-toggle" aria-label="Row details" />
94
+ )}
95
+ {hasSelection && selectionPosition === 'left' && rowIndex === 0 && !groupHeaders.length && selectAllCell}
96
+
97
+ {row.map(({ col, rowSpan, colSpan }) => {
98
+ const isSortable = !col.columns?.length && col.sortable === true;
99
+ const cellClasses = classnames(
100
+ 'usx-data-table__cell',
101
+ col.headerAlign && `usx-data-table__cell--align-${col.headerAlign}`,
102
+ !col.headerAlign && col.align && `usx-data-table__cell--align-${col.align}`,
103
+ col.headerClassName
104
+ );
105
+ return (
106
+ <th
107
+ key={col.key}
108
+ scope="col"
109
+ className={cellClasses}
110
+ rowSpan={rowSpan > 1 ? rowSpan : undefined}
111
+ colSpan={colSpan > 1 ? colSpan : undefined}
112
+ style={{ width: col.width, backgroundColor: col.headerBackgroundColor, color: col.headerColor }}
113
+ data-usx-sortable={isSortable || undefined}
114
+ data-column-key={col.key}
115
+ >
116
+ {col.header}
117
+ </th>
118
+ );
119
+ })}
120
+
121
+ {hasSelection && selectionPosition === 'right' && rowIndex === 0 && !groupHeaders.length && selectAllCell}
122
+ </tr>
123
+ ))}
124
+ </thead>
125
+ );
126
+ }
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import classnames from 'classnames';
3
+ import type { RowKey } from './types';
4
+
5
+ export interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
6
+ rowKey?: RowKey;
7
+ searchValue?: string;
8
+ selected?: boolean;
9
+ disabled?: boolean;
10
+ clickable?: boolean;
11
+ }
12
+
13
+ /** A data row. Interaction is attached by @solexllc/usx/js/data-table. */
14
+ export default function TableRow({
15
+ rowKey, searchValue, selected = false, disabled = false, clickable = false,
16
+ className = '', children, ...props
17
+ }: TableRowProps) {
18
+ return <tr className={classnames('usx-data-table__row',
19
+ selected && 'usx-data-table__row--selected',
20
+ disabled && 'usx-data-table__row--disabled',
21
+ clickable && !disabled && 'usx-data-table__row--clickable', className)}
22
+ data-row-key={rowKey} data-search-value={searchValue}
23
+ tabIndex={clickable && !disabled ? 0 : undefined} {...props}>{children}</tr>;
24
+ }
@@ -0,0 +1,49 @@
1
+ import type { CellOptions, TableColumn, TableRowData } from './types';
2
+
3
+ /** A cell's color utility replaces the same utility family from its column. */
4
+ export function mergeCellClasses(columnClass?: string, cellClass?: string): string {
5
+ const cellTokens = cellClass?.split(/\s+/).filter(Boolean) || [];
6
+ const replacesBackground = cellTokens.some((token) => token.startsWith('bg-'));
7
+ const replacesText = cellTokens.some((token) => token.startsWith('text-'));
8
+ const columnTokens = columnClass?.split(/\s+/).filter((token) => token &&
9
+ !(replacesBackground && token.startsWith('bg-')) &&
10
+ !(replacesText && token.startsWith('text-'))) || [];
11
+ return [...columnTokens, ...cellTokens].join(' ');
12
+ }
13
+
14
+ export interface PlannedCell {
15
+ column: TableColumn;
16
+ options: CellOptions;
17
+ colSpan: number;
18
+ rowSpan: number;
19
+ }
20
+
21
+ export interface PlannedRow {
22
+ row: TableRowData;
23
+ cells: PlannedCell[];
24
+ }
25
+
26
+ /** Plan a rectangular body grid, omitting slots covered by spans. Spans stop at the current group/page. */
27
+ export function planCells(rows: TableRowData[], columns: TableColumn[]): PlannedRow[] {
28
+ const occupied = rows.map(() => columns.map(() => false));
29
+ return rows.map((row, rowIndex) => {
30
+ const cellProps = row.cellProps || {};
31
+ const cells: PlannedCell[] = [];
32
+ columns.forEach((column, columnIndex) => {
33
+ if (occupied[rowIndex][columnIndex]) return;
34
+ const options = cellProps[column.key] || {};
35
+ const desiredCols = Math.max(1, Math.floor(Number(options.colSpan) || 1));
36
+ const desiredRows = Math.max(1, Math.floor(Number(options.rowSpan) || 1));
37
+ let colSpan = 0;
38
+ while (colSpan < desiredCols && columnIndex + colSpan < columns.length && !occupied[rowIndex][columnIndex + colSpan]) colSpan++;
39
+ let rowSpan = 0;
40
+ while (rowSpan < desiredRows && rowIndex + rowSpan < rows.length &&
41
+ occupied[rowIndex + rowSpan].slice(columnIndex, columnIndex + colSpan).every((slot) => !slot)) rowSpan++;
42
+ for (let r = rowIndex; r < rowIndex + rowSpan; r++) {
43
+ for (let c = columnIndex; c < columnIndex + colSpan; c++) occupied[r][c] = true;
44
+ }
45
+ cells.push({ column, options, colSpan, rowSpan });
46
+ });
47
+ return { row, cells };
48
+ });
49
+ }
@@ -0,0 +1,15 @@
1
+ import type { TableColumn } from './types';
2
+
3
+ /** Keep header groups and body columns in sync when nested columns are hidden. */
4
+ export function visibleColumns(columns: TableColumn[]): TableColumn[] {
5
+ return columns.flatMap((column) => {
6
+ if (column.hidden) return [];
7
+ if (!column.columns?.length) return [column];
8
+ const children = visibleColumns(column.columns);
9
+ return children.length ? [{ ...column, columns: children }] : [];
10
+ });
11
+ }
12
+
13
+ export function leafColumns(columns: TableColumn[]): TableColumn[] {
14
+ return visibleColumns(columns).flatMap((column) => column.columns?.length ? leafColumns(column.columns) : [column]);
15
+ }
@@ -0,0 +1,375 @@
1
+ {
2
+ "name": "data-table",
3
+ "template": "data-table/data-table.django.html",
4
+ "version": 1,
5
+ "required": [
6
+ "columns",
7
+ "data"
8
+ ],
9
+ "default": {
10
+ "id": "standard",
11
+ "columns": [
12
+ {
13
+ "key": "title",
14
+ "header": "Document title",
15
+ "primary": true
16
+ },
17
+ {
18
+ "key": "description",
19
+ "header": "Description"
20
+ },
21
+ {
22
+ "key": "year",
23
+ "header": "Year",
24
+ "align": "right"
25
+ }
26
+ ],
27
+ "data": [
28
+ {
29
+ "id": 1,
30
+ "title": "Declaration of Independence",
31
+ "description": "Statement adopted by the Continental Congress declaring independence from the British Empire.",
32
+ "year": 1776
33
+ },
34
+ {
35
+ "id": 2,
36
+ "title": "Bill of Rights",
37
+ "description": "The first ten amendments of the U.S. Constitution guaranteeing rights and freedoms.",
38
+ "year": 1791
39
+ },
40
+ {
41
+ "id": 3,
42
+ "title": "Declaration of Sentiments",
43
+ "description": "A document written during the Seneca Falls Convention outlining the rights that American women should be entitled to as citizens.",
44
+ "year": 1848
45
+ },
46
+ {
47
+ "id": 4,
48
+ "title": "Emancipation Proclamation",
49
+ "description": "An executive order granting freedom to slaves in designated southern states.",
50
+ "year": 1863
51
+ }
52
+ ],
53
+ "caption": "Historic U.S. documents"
54
+ },
55
+ "props": {
56
+ "id": {
57
+ "type": "string",
58
+ "description": "ID for the <table> element. Required for accessibility when using sticky headers or scrollable tables."
59
+ },
60
+ "columns": {
61
+ "type": "array",
62
+ "description": "Ordered column definitions; nested columns form grouped headers. Hidden columns are omitted from rendering.",
63
+ "items": {
64
+ "type": "object",
65
+ "description": "Column definition.",
66
+ "properties": {
67
+ "key": {
68
+ "type": "string",
69
+ "description": "Row data property to read."
70
+ },
71
+ "header": {
72
+ "type": "string",
73
+ "description": "Column header text."
74
+ },
75
+ "render": {
76
+ "type": "function",
77
+ "description": "React cell renderer: (row, rowIndex) => node."
78
+ },
79
+ "align": {
80
+ "type": "select",
81
+ "options": [
82
+ "left",
83
+ "center",
84
+ "right"
85
+ ],
86
+ "description": "Horizontal cell content alignment. Center also centers buttons and avatars."
87
+ },
88
+ "verticalAlign": {
89
+ "type": "select",
90
+ "options": [
91
+ "top",
92
+ "middle",
93
+ "bottom"
94
+ ],
95
+ "description": "Vertical position of cell content; top is the default."
96
+ },
97
+ "sortable": {
98
+ "type": "boolean",
99
+ "description": "Allow sorting by this column."
100
+ },
101
+ "width": {
102
+ "type": "string",
103
+ "description": "CSS width for the column."
104
+ },
105
+ "primary": {
106
+ "type": "boolean",
107
+ "description": "Marks the primary column shown in stacked/responsive mode."
108
+ },
109
+ "hidden": {
110
+ "type": "boolean",
111
+ "description": "Hide the column."
112
+ },
113
+ "aggregate": {
114
+ "type": "select",
115
+ "options": [
116
+ "sum",
117
+ "avg",
118
+ "min",
119
+ "max",
120
+ "count"
121
+ ],
122
+ "description": "Built-in footer aggregate."
123
+ },
124
+ "footer": {
125
+ "type": "string",
126
+ "description": "Static footer content, or a React callback receiving visible rows."
127
+ },
128
+ "className": {
129
+ "type": "string",
130
+ "description": "Additional data-cell classes, including bg-* and text-* USX color utilities."
131
+ },
132
+ "headerClassName": {
133
+ "type": "string",
134
+ "description": "Additional header cell classes, including bg-* and text-* USX color utilities."
135
+ },
136
+ "backgroundColor": {
137
+ "type": "string",
138
+ "description": "Background color for data cells in this column."
139
+ },
140
+ "color": {
141
+ "type": "string",
142
+ "description": "Text color for data cells in this column."
143
+ },
144
+ "headerBackgroundColor": {
145
+ "type": "string",
146
+ "description": "Background color for this column header."
147
+ },
148
+ "headerColor": {
149
+ "type": "string",
150
+ "description": "Text color for this column header."
151
+ },
152
+ "filterable": {
153
+ "type": "boolean",
154
+ "default": true,
155
+ "description": "Include this column in client-side search."
156
+ },
157
+ "searchValue": {
158
+ "type": "function",
159
+ "description": "React-only text source for searching computed values."
160
+ },
161
+ "stackLabel": {
162
+ "type": "string",
163
+ "description": "Label for this cell in stacked layout."
164
+ },
165
+ "headerAlign": {
166
+ "type": "select",
167
+ "options": [
168
+ "left",
169
+ "center",
170
+ "right"
171
+ ],
172
+ "description": "Header cell alignment."
173
+ },
174
+ "minWidth": {
175
+ "type": "string",
176
+ "description": "Minimum column width."
177
+ },
178
+ "sortValue": {
179
+ "type": "function",
180
+ "description": "React-only comparable value serialized for the shared JS sorter."
181
+ }
182
+ }
183
+ }
184
+ },
185
+ "data": {
186
+ "type": "array",
187
+ "description": "Array of row data objects. Each row may set rowProps {backgroundColor, color, className} and cellProps keyed by column key with {rowSpan, colSpan, align, verticalAlign, backgroundColor, color, className}."
188
+ },
189
+ "primaryKey": {
190
+ "type": "string",
191
+ "default": "id",
192
+ "description": "Property name used as the unique row identifier."
193
+ },
194
+ "caption": {
195
+ "type": "slot",
196
+ "description": "Accessible caption for the data table."
197
+ },
198
+ "striped": {
199
+ "type": "boolean",
200
+ "default": false,
201
+ "description": "Apply alternating row shading (usx-data-table--striped)."
202
+ },
203
+ "borderless": {
204
+ "type": "boolean",
205
+ "default": false,
206
+ "description": "Remove cell borders (usx-data-table--borderless)."
207
+ },
208
+ "compact": {
209
+ "type": "boolean",
210
+ "default": false,
211
+ "description": "Reduce cell padding (usx-data-table--compact)."
212
+ },
213
+ "searchable": {
214
+ "type": "boolean",
215
+ "default": false,
216
+ "description": "Show a search field. Searches visible column values in React and rendered row text in Django/HTML."
217
+ },
218
+ "searchPlaceholder": {
219
+ "type": "string",
220
+ "default": "Search table",
221
+ "description": "Placeholder text for the search input."
222
+ },
223
+ "scrollable": {
224
+ "type": "boolean",
225
+ "default": false,
226
+ "description": "Wrap the table in a horizontally-scrollable container."
227
+ },
228
+ "height": {
229
+ "type": "string",
230
+ "description": "CSS max-height for vertical scrolling (e.g. '400px')."
231
+ },
232
+ "responsive": {
233
+ "type": "select",
234
+ "options": [
235
+ false,
236
+ "stack",
237
+ "stack-header"
238
+ ],
239
+ "default": false,
240
+ "description": "Below 480px, stack cells with labels; 'stack-header' shades the first data cell as each row's heading."
241
+ },
242
+ "stickyHeader": {
243
+ "type": "boolean",
244
+ "default": false,
245
+ "description": "Keep the header row visible while scrolling (usx-data-table--sticky-header)."
246
+ },
247
+ "stickyFirstColumn": {
248
+ "type": "boolean",
249
+ "default": false,
250
+ "description": "Sticky-pin the first column on horizontal scroll."
251
+ },
252
+ "sortable": {
253
+ "type": "boolean",
254
+ "default": false,
255
+ "description": "Enable sorting on all columns (individual columns can opt out via column.sortable: false)."
256
+ },
257
+ "sort": {
258
+ "type": "object",
259
+ "description": "Initial sort state: { key: string, direction: 'asc' | 'desc' | null }. Runtime changes are emitted as usx:data-table:sort events."
260
+ },
261
+ "selectionMode": {
262
+ "type": "select",
263
+ "options": [
264
+ null,
265
+ "checkbox",
266
+ "radio"
267
+ ],
268
+ "default": null,
269
+ "description": "Row selection mode. 'checkbox' enables multi-select; 'radio' enables single-select."
270
+ },
271
+ "selectionPosition": {
272
+ "type": "select",
273
+ "options": [
274
+ "left",
275
+ "right"
276
+ ],
277
+ "default": "left",
278
+ "description": "Position of the selection column."
279
+ },
280
+ "selectionVerticalAlign": {
281
+ "type": "select",
282
+ "options": [
283
+ "top",
284
+ "middle",
285
+ "bottom"
286
+ ],
287
+ "default": "middle",
288
+ "description": "Vertical position of selection checkboxes and radios. They are centered horizontally."
289
+ },
290
+ "select": {
291
+ "type": "array",
292
+ "description": "Initially selected primary key values. Runtime changes are emitted as usx:data-table:select events."
293
+ },
294
+ "allowSelectAll": {
295
+ "type": "boolean",
296
+ "default": true,
297
+ "description": "Show 'select all' checkbox in header (checkbox mode only)."
298
+ },
299
+ "disabled": {
300
+ "type": "array",
301
+ "description": "Array of primary key values for rows that should be non-interactive."
302
+ },
303
+ "groupBy": {
304
+ "type": "object",
305
+ "description": "Group rows by a property. String shorthand or object: { property, expand, defaultExpanded, headers, columns, rowClassName, values }. headers defines an optional top band; columns defines group-row cells. Both sets of colSpans must cover visible data columns. rowClassName accepts bg-* and text-* USX utilities."
306
+ },
307
+ "rowDetails": {
308
+ "type": "object",
309
+ "description": "Expandable row details. React accepts a render callback; Django uses rowDetailField with rowDetails enabled."
310
+ },
311
+ "showFooter": {
312
+ "type": "boolean",
313
+ "default": false,
314
+ "description": "Render a <tfoot> row using column.footer or column.aggregate values."
315
+ },
316
+ "paginate": {
317
+ "type": "object",
318
+ "description": "Client-side pagination with pageSize and pageSizeOptions. totalCount enables server-side paging via usx:data-table:page-change events."
319
+ },
320
+ "loading": {
321
+ "type": "boolean",
322
+ "default": false,
323
+ "description": "Show a loading state overlay. Does not affect interactivity."
324
+ },
325
+ "placeholder": {
326
+ "type": "slot",
327
+ "description": "Content shown when the data array is empty."
328
+ },
329
+ "className": {
330
+ "type": "string",
331
+ "default": "",
332
+ "description": "Additional CSS classes applied to the <table> element."
333
+ },
334
+ "expandedRows": {
335
+ "type": "array",
336
+ "default": [],
337
+ "description": "Django only. List of primary-key values whose detail rows are open on initial render. Mirrors the React rowDetails.expand controlled prop."
338
+ },
339
+ "rowDetailTemplate": {
340
+ "type": "string",
341
+ "default": null,
342
+ "description": "Django only. Path to a Django partial template rendered as row-detail content (replaces React rowDetails.render)."
343
+ },
344
+ "rowDetailField": {
345
+ "type": "string",
346
+ "default": null,
347
+ "description": "Django only. Key in each row dict whose value is used as inline row-detail content (simpler alternative to rowDetailTemplate)."
348
+ },
349
+ "rowUrlField": {
350
+ "type": "string",
351
+ "default": null,
352
+ "description": "Django only. Key in each row dict holding the navigation URL for clickable rows (replaces React onClickRow). The block-link CSS pattern is used; no JS required."
353
+ },
354
+ "children": {
355
+ "type": "slot",
356
+ "description": "Composed table sections, replacing the generated table sections (React only).",
357
+ "renderers": {
358
+ "django": {
359
+ "supported": false,
360
+ "description": "The Django template does not consume children."
361
+ }
362
+ }
363
+ },
364
+ "infinite": {
365
+ "type": "boolean",
366
+ "default": false,
367
+ "description": "Render a sentinel that emits usx:data-table:more when it enters the viewport."
368
+ },
369
+ "clickableRows": {
370
+ "type": "boolean",
371
+ "default": false,
372
+ "description": "Make rows keyboard and pointer activatable; the JS initializer emits usx:data-table:row-activate."
373
+ }
374
+ }
375
+ }