@calcifer-design/ui 0.5.0 → 0.6.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 (45) hide show
  1. package/dist/components/DataGrid/DataGrid.d.ts +3 -0
  2. package/dist/components/DataGrid/DataGrid.js +436 -0
  3. package/dist/components/DataGrid/DataGrid.module.js +36 -0
  4. package/dist/components/DataGrid/DataGrid_module.css +367 -0
  5. package/dist/components/DataGrid/GridCardHeader.d.ts +16 -0
  6. package/dist/components/DataGrid/GridCardHeader.js +40 -0
  7. package/dist/components/DataGrid/GridCheckbox.d.ts +15 -0
  8. package/dist/components/DataGrid/GridCheckbox.js +25 -0
  9. package/dist/components/DataGrid/GridHeaderCell.d.ts +14 -0
  10. package/dist/components/DataGrid/GridHeaderCell.js +29 -0
  11. package/dist/components/DataGrid/GridHeaderRow.d.ts +35 -0
  12. package/dist/components/DataGrid/GridHeaderRow.js +56 -0
  13. package/dist/components/DataGrid/GridRow.d.ts +69 -0
  14. package/dist/components/DataGrid/GridRow.js +139 -0
  15. package/dist/components/DataGrid/GridStateRows.d.ts +24 -0
  16. package/dist/components/DataGrid/GridStateRows.js +59 -0
  17. package/dist/components/DataGrid/columns.d.ts +40 -0
  18. package/dist/components/DataGrid/columns.js +37 -0
  19. package/dist/components/DataGrid/labels.d.ts +20 -0
  20. package/dist/components/DataGrid/labels.js +25 -0
  21. package/dist/components/DataGrid/types.d.ts +88 -0
  22. package/dist/components/DataGrid/types.js +0 -0
  23. package/dist/components/DataGrid/useGridEntries.d.ts +17 -0
  24. package/dist/components/DataGrid/useGridEntries.js +40 -0
  25. package/dist/components/DataGrid/useGridHighlight.d.ts +16 -0
  26. package/dist/components/DataGrid/useGridHighlight.js +24 -0
  27. package/dist/components/DataGrid/useGridKeyboard.d.ts +50 -0
  28. package/dist/components/DataGrid/useGridKeyboard.js +242 -0
  29. package/dist/components/DataGrid/useGridMetrics.d.ts +13 -0
  30. package/dist/components/DataGrid/useGridMetrics.js +35 -0
  31. package/dist/components/DataGrid/useLatest.d.ts +7 -0
  32. package/dist/components/DataGrid/useLatest.js +9 -0
  33. package/dist/components/DataGrid/useLoadMore.d.ts +30 -0
  34. package/dist/components/DataGrid/useLoadMore.js +39 -0
  35. package/dist/components/DataGrid/useRowExpansion.d.ts +14 -0
  36. package/dist/components/DataGrid/useRowExpansion.js +21 -0
  37. package/dist/components/DataGrid/useRowSelection.d.ts +43 -0
  38. package/dist/components/DataGrid/useRowSelection.js +107 -0
  39. package/dist/icons/ChevronRightIcon.d.ts +6 -0
  40. package/dist/icons/ChevronRightIcon.js +17 -0
  41. package/dist/icons/RefreshIcon.d.ts +6 -0
  42. package/dist/icons/RefreshIcon.js +22 -0
  43. package/dist/index.d.ts +5 -0
  44. package/dist/index.js +2 -0
  45. package/package.json +3 -2
@@ -0,0 +1,3 @@
1
+ import { type RowData } from '@tanstack/react-table';
2
+ import type { DataGridProps } from './types.js';
3
+ export declare function DataGrid<Row extends RowData>({ heading, headingLevel, rows, columns, getRowId, getRowLabel, actions, mode, totalRowCount, hasMore, loadingMore, loadError, onLoadMore, onQueryChange, initialSorting, enableSorting, multiSort, density, maxHeight, fill, hideFooter, loading, emptyState, onRefresh, refreshing, highlightOnClick, highlightedRowId, onHighlightChange, selectionMode, selectedRowIds, defaultSelectedRowIds, onSelectedRowIdsChange, isRowSelectable, onRowClick, onRowDoubleClick, onRowContextMenu, renderRowActions, rowActionsHeader, renderExpandedRow, isRowExpandable, expandedRowIds, defaultExpandedRowIds, onExpandedRowIdsChange, labels, }: DataGridProps<Row>): import("react").JSX.Element;
@@ -0,0 +1,436 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useTable } from "@tanstack/react-table";
3
+ import { useVirtualizer } from "@tanstack/react-virtual";
4
+ import { useCallback, useId, useMemo, useRef, useState } from "react";
5
+ import { LiveRegion } from "../LiveRegion/LiveRegion.js";
6
+ import { dataGridFeatures, textValueOf } from "./columns.js";
7
+ import DataGrid_module from "./DataGrid.module.js";
8
+ import { GridCardHeader } from "./GridCardHeader.js";
9
+ import { GridHeaderRow } from "./GridHeaderRow.js";
10
+ import { GridDetailRow, GridRow, GridSpacerRow } from "./GridRow.js";
11
+ import { GridErrorRow, GridStateRow } from "./GridStateRows.js";
12
+ import { resolveDataGridLabels } from "./labels.js";
13
+ import { useGridEntries } from "./useGridEntries.js";
14
+ import { useGridHighlight } from "./useGridHighlight.js";
15
+ import { useGridMetrics } from "./useGridMetrics.js";
16
+ import { cellControlSelector, useGridKeyboard } from "./useGridKeyboard.js";
17
+ import { useLoadMore } from "./useLoadMore.js";
18
+ import { useRowExpansion } from "./useRowExpansion.js";
19
+ import { useRowSelection } from "./useRowSelection.js";
20
+ const emptyCellText = '—';
21
+ const estimatedRowHeight = {
22
+ comfortable: 40,
23
+ compact: 34
24
+ };
25
+ const overscanRows = 8;
26
+ const loadAheadViewports = 2;
27
+ function extractRange(range, pinnedIndexes, entries) {
28
+ const start = Math.max(range.startIndex - range.overscan, 0);
29
+ const end = Math.min(range.endIndex + range.overscan, range.count - 1);
30
+ const indexes = new Set();
31
+ for(let index = start; index <= end; index += 1)indexes.add(index);
32
+ for (const pinnedIndex of pinnedIndexes)if (pinnedIndex >= 0 && pinnedIndex < range.count) indexes.add(pinnedIndex);
33
+ for (const index of [
34
+ ...indexes
35
+ ])if (entries[index]?.kind === 'row' && entries[index + 1]?.kind === 'detail') indexes.add(index + 1);
36
+ return [
37
+ ...indexes
38
+ ].sort((first, second)=>first - second);
39
+ }
40
+ function formatCellValue(value) {
41
+ if (null == value) return emptyCellText;
42
+ const text = 'string' == typeof value ? value : String(value);
43
+ return '' === text.trim() ? emptyCellText : text;
44
+ }
45
+ function DataGrid({ heading, headingLevel = 2, rows, columns, getRowId, getRowLabel, actions, mode = 'client', totalRowCount, hasMore = false, loadingMore = false, loadError, onLoadMore, onQueryChange, initialSorting = [], enableSorting = true, multiSort = false, density = 'comfortable', maxHeight, fill = false, hideFooter = false, loading = false, emptyState, onRefresh, refreshing = false, highlightOnClick = false, highlightedRowId, onHighlightChange, selectionMode = 'none', selectedRowIds, defaultSelectedRowIds, onSelectedRowIdsChange, isRowSelectable, onRowClick, onRowDoubleClick, onRowContextMenu, renderRowActions, rowActionsHeader, renderExpandedRow, isRowExpandable, expandedRowIds, defaultExpandedRowIds, onExpandedRowIdsChange, labels }) {
46
+ const serverMode = 'server' === mode;
47
+ const sortingEnabled = enableSorting && (!serverMode || void 0 !== onQueryChange);
48
+ const [sorting, setSorting] = useState(initialSorting);
49
+ const [rowsOfOldQuery, setRowsOfOldQuery] = useState(null);
50
+ const awaitingNewRows = rowsOfOldQuery === rows;
51
+ const { highlightedId, setHighlightedId } = useGridHighlight({
52
+ rows,
53
+ getRowId,
54
+ loading,
55
+ highlightedRowId,
56
+ onHighlightChange
57
+ });
58
+ const selecting = 'multiple' === selectionMode;
59
+ const expanding = void 0 !== renderExpandedRow;
60
+ const expandColumn = selecting ? 1 : 0;
61
+ const columnOffset = expandColumn + (expanding ? 1 : 0);
62
+ const expansion = useRowExpansion({
63
+ expandedRowIds,
64
+ defaultExpandedRowIds,
65
+ onExpandedRowIdsChange
66
+ });
67
+ const isExpandable = (row)=>expanding && (isRowExpandable?.(row) ?? true);
68
+ const selection = useRowSelection({
69
+ enabled: selecting,
70
+ rows,
71
+ getRowId,
72
+ isRowSelectable,
73
+ loading,
74
+ selectedRowIds,
75
+ defaultSelectedRowIds,
76
+ onSelectedRowIdsChange,
77
+ getDisplayedRowIds: ()=>entries.flatMap((entry)=>'row' === entry.kind ? [
78
+ entry.row.id
79
+ ] : [])
80
+ });
81
+ const headingId = useId();
82
+ const panelIdPrefix = useId();
83
+ const resolvedLabels = resolveDataGridLabels(labels);
84
+ const table = useTable({
85
+ features: dataGridFeatures,
86
+ data: rows,
87
+ columns,
88
+ getRowId,
89
+ state: {
90
+ sorting,
91
+ rowSelection: selection.rowSelection
92
+ },
93
+ manualSorting: serverMode,
94
+ onSortingChange: (updater)=>{
95
+ const nextSorting = 'function' == typeof updater ? updater(sorting) : updater;
96
+ setSorting(nextSorting);
97
+ selection.clear();
98
+ if (serverMode) {
99
+ setRowsOfOldQuery(rows);
100
+ loadMore.reset();
101
+ virtualizer.scrollToOffset(0);
102
+ onQueryChange?.({
103
+ sorting: nextSorting,
104
+ filters: {},
105
+ matchMode: 'all',
106
+ search: ''
107
+ });
108
+ }
109
+ },
110
+ enableRowSelection: (row)=>isRowSelectable?.(row.original) ?? true,
111
+ enableSorting: sortingEnabled,
112
+ enableMultiSort: multiSort,
113
+ defaultColumn: {
114
+ sortDescFirst: false,
115
+ cell: (context)=>context.column.accessorFn ? formatCellValue(context.getValue()) : null
116
+ }
117
+ });
118
+ const scrollRef = useRef(null);
119
+ const headRef = useRef(null);
120
+ const { viewportHeight, headerHeight, rightToLeft } = useGridMetrics(scrollRef, headRef);
121
+ const tableRows = table.getRowModel().rows;
122
+ const entries = useGridEntries(tableRows, expansion.expandedIds, (row)=>isExpandable(row.original));
123
+ const openPanelCount = useMemo(()=>entries.filter((entry)=>'detail' === entry.kind).length, [
124
+ entries
125
+ ]);
126
+ const leafHeaders = table.getHeaderGroups()[0]?.headers ?? [];
127
+ const leafColumns = table.getAllLeafColumns();
128
+ const columnCount = columnOffset + leafColumns.length + (renderRowActions ? 1 : 0);
129
+ const panelIdOf = (row)=>`${panelIdPrefix}-detail-${row.index}`;
130
+ const showsLoadError = serverMode && void 0 !== loadError && !loading;
131
+ let stateKind = null;
132
+ if (loading) stateKind = 'loading';
133
+ else if (0 === entries.length && !showsLoadError) stateKind = 'empty';
134
+ const rowHeight = estimatedRowHeight[density];
135
+ const rowsPerViewport = Math.max(1, Math.floor((viewportHeight - headerHeight) / rowHeight));
136
+ const rowsClickable = Boolean(onRowClick || highlightOnClick);
137
+ const clickRow = (row, event)=>{
138
+ onRowClick?.(row.original, event);
139
+ if (!highlightOnClick) return;
140
+ if (highlightedId === row.id && 'detail' in event && event.detail > 1) return;
141
+ setHighlightedId(highlightedId === row.id ? null : row.id);
142
+ };
143
+ const handleRowClick = (row, event)=>{
144
+ const selectsRow = event.shiftKey || event.ctrlKey || event.metaKey;
145
+ if (selecting && selectsRow) return void selection.toggleRow(row.id, {
146
+ range: event.shiftKey
147
+ });
148
+ clickRow(row, event);
149
+ };
150
+ const rowLabelOf = (row)=>{
151
+ if (getRowLabel) return getRowLabel(row.original);
152
+ const firstColumn = leafColumns[0];
153
+ const text = firstColumn ? textValueOf(firstColumn.columnDef, row.original) : void 0;
154
+ return text ?? row.id;
155
+ };
156
+ const handleActivate = (rowIndex, columnIndex, event)=>{
157
+ if (rowIndex > 0 && expanding && columnIndex === expandColumn) {
158
+ const entry = entries[rowIndex - 1];
159
+ if (entry?.kind === 'row' && isExpandable(entry.row.original)) {
160
+ event.preventDefault();
161
+ expansion.toggleRow(entry.row.id);
162
+ return;
163
+ }
164
+ }
165
+ if (' ' === event.key) {
166
+ if (!selecting) return;
167
+ if (0 === rowIndex) {
168
+ if (0 !== columnIndex || !selection.canSelectAny) return;
169
+ event.preventDefault();
170
+ selection.toggleAll();
171
+ return;
172
+ }
173
+ const entry = entries[rowIndex - 1];
174
+ if (entry?.kind !== 'row' || !selection.isSelectable(entry.row.id)) return;
175
+ event.preventDefault();
176
+ selection.toggleRow(entry.row.id, {
177
+ range: event.shiftKey
178
+ });
179
+ return;
180
+ }
181
+ if ('Enter' !== event.key) return;
182
+ if (0 === rowIndex) {
183
+ const column = leafHeaders[columnIndex - columnOffset]?.column;
184
+ if (column?.getCanSort()) {
185
+ event.preventDefault();
186
+ column.getToggleSortingHandler()?.(event);
187
+ }
188
+ return;
189
+ }
190
+ const entry = entries[rowIndex - 1];
191
+ if (entry?.kind !== 'row' || event.currentTarget.querySelector(cellControlSelector)) return;
192
+ if (rowsClickable) {
193
+ event.preventDefault();
194
+ clickRow(entry.row, event);
195
+ }
196
+ };
197
+ const keyboardContextMenuCellRef = useRef(null);
198
+ const forgetKeyboardContextMenu = ()=>{
199
+ keyboardContextMenuCellRef.current = null;
200
+ };
201
+ const handleContextMenuKey = (rowIndex, _columnIndex, event)=>{
202
+ const entry = entries[rowIndex - 1];
203
+ if (entry?.kind !== 'row' || !onRowContextMenu) return;
204
+ event.preventDefault();
205
+ keyboardContextMenuCellRef.current = event.currentTarget;
206
+ onRowContextMenu(entry.row.original, event);
207
+ };
208
+ const handleRowContextMenu = (row, event)=>{
209
+ event.preventDefault();
210
+ const pressedCell = keyboardContextMenuCellRef.current;
211
+ keyboardContextMenuCellRef.current = null;
212
+ if (null !== pressedCell && pressedCell === event.target.closest('td')) return;
213
+ onRowContextMenu?.(row.original, event);
214
+ };
215
+ const keyboard = useGridKeyboard({
216
+ rowCount: stateKind ? 1 : entries.length + 1 + (showsLoadError ? 1 : 0),
217
+ columnCount,
218
+ onActivate: handleActivate,
219
+ onContextMenu: handleContextMenuKey,
220
+ scrollToEntry: (entryIndex)=>virtualizer.scrollToIndex(entryIndex),
221
+ getPageSize: ()=>{
222
+ const range = virtualizer.range;
223
+ return range ? Math.max(1, range.endIndex - range.startIndex + 1) : rowsPerViewport;
224
+ }
225
+ });
226
+ const focusedEntryIndex = keyboard.focusedCell.rowIndex - 1;
227
+ const pinnedIndexes = useMemo(()=>new Set(focusedEntryIndex >= 0 ? [
228
+ focusedEntryIndex
229
+ ] : []), [
230
+ focusedEntryIndex
231
+ ]);
232
+ const getItemKey = useCallback((index)=>{
233
+ const entry = entries[index];
234
+ return entry ? `${entry.kind}:${entry.row.id}` : index;
235
+ }, [
236
+ entries
237
+ ]);
238
+ const virtualizer = useVirtualizer({
239
+ count: entries.length,
240
+ getScrollElement: ()=>scrollRef.current,
241
+ estimateSize: ()=>rowHeight,
242
+ measureElement: (element, entry)=>entry?.borderBoxSize?.[0]?.blockSize ?? element.getBoundingClientRect().height,
243
+ getItemKey,
244
+ overscan: overscanRows,
245
+ initialRect: {
246
+ width: scrollRef.current?.clientWidth ?? 0,
247
+ height: scrollRef.current?.clientHeight ?? 0
248
+ },
249
+ scrollMargin: headerHeight,
250
+ scrollPaddingStart: headerHeight,
251
+ rangeExtractor: (range)=>extractRange(range, pinnedIndexes, entries)
252
+ });
253
+ const virtualItems = stateKind ? [] : virtualizer.getVirtualItems();
254
+ const loadMore = useLoadMore({
255
+ enabled: serverMode && !awaitingNewRows,
256
+ loading,
257
+ loadedCount: rows.length,
258
+ lastRenderedIndex: (stateKind ? void 0 : entries[virtualizer.range?.endIndex ?? -1]?.rowIndex) ?? -1,
259
+ threshold: loadAheadViewports * rowsPerViewport,
260
+ hasMore,
261
+ loadingMore,
262
+ loadError,
263
+ onLoadMore
264
+ });
265
+ const bodyRows = [];
266
+ let renderedEnd = headerHeight;
267
+ for (const virtualItem of virtualItems){
268
+ const entry = entries[virtualItem.index];
269
+ if (!entry) continue;
270
+ if (virtualItem.start > renderedEnd) bodyRows.push(/*#__PURE__*/ jsx(GridSpacerRow, {
271
+ height: virtualItem.start - renderedEnd,
272
+ columnCount: columnCount
273
+ }, `gap-${virtualItem.index}`));
274
+ renderedEnd = virtualItem.end;
275
+ const { row } = entry;
276
+ if ('detail' === entry.kind) {
277
+ bodyRows.push(/*#__PURE__*/ jsx(GridDetailRow, {
278
+ entryIndex: virtualItem.index,
279
+ measureRef: virtualizer.measureElement,
280
+ columnCount: columnCount,
281
+ panelId: panelIdOf(row),
282
+ getCellProps: keyboard.getCellProps,
283
+ children: renderExpandedRow?.(row.original)
284
+ }, `detail:${row.id}`));
285
+ continue;
286
+ }
287
+ bodyRows.push(/*#__PURE__*/ jsx(GridRow, {
288
+ row: row,
289
+ entryIndex: virtualItem.index,
290
+ measureRef: virtualizer.measureElement,
291
+ density: density,
292
+ columnOffset: columnOffset,
293
+ highlighted: highlightedId === row.id,
294
+ clickable: rowsClickable,
295
+ checkbox: selecting ? {
296
+ label: resolvedLabels.selectRow(rowLabelOf(row)),
297
+ selected: row.getIsSelected(),
298
+ selectable: row.getCanSelect(),
299
+ onCheckedChange: ()=>selection.toggleRowFromCheckbox(row.id),
300
+ onClickCapture: selection.noteCheckboxClick,
301
+ onCellClick: (event)=>selection.toggleRow(row.id, {
302
+ range: event.shiftKey
303
+ })
304
+ } : void 0,
305
+ expander: expanding ? {
306
+ expandable: isExpandable(row.original),
307
+ expanded: entries[virtualItem.index + 1]?.kind === 'detail',
308
+ label: resolvedLabels.expandRow(rowLabelOf(row)),
309
+ panelId: panelIdOf(row),
310
+ onToggle: ()=>expansion.toggleRow(row.id)
311
+ } : void 0,
312
+ renderRowActions: renderRowActions,
313
+ getCellProps: keyboard.getCellProps,
314
+ onClick: (event)=>handleRowClick(row, event),
315
+ onDoubleClick: onRowDoubleClick ? (event)=>onRowDoubleClick(row.original, event) : void 0,
316
+ onContextMenu: onRowContextMenu ? (event)=>handleRowContextMenu(row, event) : void 0
317
+ }, row.id));
318
+ }
319
+ const bottomSpacerHeight = virtualItems.length ? virtualizer.getTotalSize() + headerHeight - renderedEnd : 0;
320
+ const scrollStyle = {
321
+ maxHeight: maxHeight && !fill ? maxHeight : void 0,
322
+ scrollPaddingBlockStart: headerHeight || void 0
323
+ };
324
+ const errorRowIndex = entries.length + 2;
325
+ const knownRowCount = serverMode && void 0 !== totalRowCount ? Math.max(totalRowCount, rows.length) : rows.length;
326
+ let ariaRowCount = Math.max(knownRowCount + openPanelCount + 1, showsLoadError ? errorRowIndex : 0);
327
+ if (serverMode && void 0 === totalRowCount && hasMore) ariaRowCount = -1;
328
+ if (stateKind) ariaRowCount = 2;
329
+ let stateLabel = '';
330
+ if ('loading' === stateKind) stateLabel = resolvedLabels.loading;
331
+ if ('empty' === stateKind) stateLabel = resolvedLabels.empty;
332
+ return /*#__PURE__*/ jsxs("section", {
333
+ className: fill ? `${DataGrid_module.card} ${DataGrid_module.fill}` : DataGrid_module.card,
334
+ "aria-labelledby": headingId,
335
+ children: [
336
+ /*#__PURE__*/ jsx(GridCardHeader, {
337
+ heading: heading,
338
+ headingLevel: headingLevel,
339
+ headingId: headingId,
340
+ actions: actions,
341
+ onRefresh: onRefresh,
342
+ refreshing: refreshing,
343
+ toolbarLabel: resolvedLabels.toolbar,
344
+ refreshLabel: resolvedLabels.refresh
345
+ }),
346
+ /*#__PURE__*/ jsx(LiveRegion, {
347
+ message: stateLabel,
348
+ politeness: "polite"
349
+ }),
350
+ /*#__PURE__*/ jsx("div", {
351
+ ref: scrollRef,
352
+ className: fill ? `${DataGrid_module.scroll} ${DataGrid_module.scrollFill}` : DataGrid_module.scroll,
353
+ style: scrollStyle,
354
+ "data-grid-scroll": "",
355
+ children: /*#__PURE__*/ jsxs("table", {
356
+ ref: keyboard.gridRef,
357
+ className: DataGrid_module.table,
358
+ role: "grid",
359
+ "aria-labelledby": headingId,
360
+ "aria-rowcount": ariaRowCount,
361
+ "aria-colcount": columnCount,
362
+ "aria-multiselectable": selecting || void 0,
363
+ "aria-busy": loading || void 0,
364
+ "data-density": density,
365
+ "data-rtl": rightToLeft ? '' : void 0,
366
+ onPointerDownCapture: forgetKeyboardContextMenu,
367
+ onKeyDownCapture: forgetKeyboardContextMenu,
368
+ onBlur: forgetKeyboardContextMenu,
369
+ children: [
370
+ /*#__PURE__*/ jsx("thead", {
371
+ ref: headRef,
372
+ className: DataGrid_module.head,
373
+ children: table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ jsx(GridHeaderRow, {
374
+ headers: headerGroup.headers,
375
+ columnCount: columnCount,
376
+ columnOffset: columnOffset,
377
+ selectAll: selecting ? {
378
+ label: resolvedLabels.selectAll,
379
+ checked: selection.allSelected,
380
+ indeterminate: selection.someSelected,
381
+ disabled: !selection.canSelectAny,
382
+ onCheckedChange: selection.toggleAll
383
+ } : void 0,
384
+ expandLabel: expanding ? resolvedLabels.expandColumn : void 0,
385
+ rowActions: renderRowActions ? {
386
+ header: rowActionsHeader,
387
+ label: resolvedLabels.rowActions
388
+ } : void 0,
389
+ getCellProps: keyboard.getCellProps
390
+ }, headerGroup.id))
391
+ }),
392
+ /*#__PURE__*/ jsxs("tbody", {
393
+ children: [
394
+ stateKind ? /*#__PURE__*/ jsx(GridStateRow, {
395
+ kind: stateKind,
396
+ label: stateLabel,
397
+ emptyState: emptyState,
398
+ columnCount: columnCount
399
+ }) : null,
400
+ bodyRows,
401
+ bottomSpacerHeight > 0 ? /*#__PURE__*/ jsx(GridSpacerRow, {
402
+ height: bottomSpacerHeight,
403
+ columnCount: columnCount
404
+ }) : null,
405
+ showsLoadError ? /*#__PURE__*/ jsx(GridErrorRow, {
406
+ entryIndex: entries.length,
407
+ columnCount: columnCount,
408
+ message: loadError,
409
+ retryLabel: resolvedLabels.retry,
410
+ onRetry: loadMore.retry,
411
+ getCellProps: keyboard.getCellProps
412
+ }) : null
413
+ ]
414
+ })
415
+ ]
416
+ })
417
+ }),
418
+ hideFooter ? null : /*#__PURE__*/ jsxs("footer", {
419
+ className: DataGrid_module.footer,
420
+ children: [
421
+ selection.selectedIds.size > 0 ? /*#__PURE__*/ jsx("span", {
422
+ children: resolvedLabels.selectedCount(selection.selectedIds.size)
423
+ }) : null,
424
+ serverMode && loadingMore ? /*#__PURE__*/ jsx("span", {
425
+ children: resolvedLabels.loadingMore
426
+ }) : null,
427
+ /*#__PURE__*/ jsx("span", {
428
+ className: DataGrid_module.rowCount,
429
+ children: serverMode && void 0 !== totalRowCount ? resolvedLabels.loadedRowCount(rows.length, totalRowCount) : resolvedLabels.rowCount(rows.length)
430
+ })
431
+ ]
432
+ })
433
+ ]
434
+ });
435
+ }
436
+ export { DataGrid };
@@ -0,0 +1,36 @@
1
+ import "./DataGrid_module.css";
2
+ const DataGrid_module = {
3
+ card: "card-sKuGs",
4
+ header: "header-FnSmG",
5
+ heading: "heading-cO1_Q",
6
+ cluster: "cluster-FC5NS",
7
+ actions: "actions-_1Hpt",
8
+ scroll: "scroll-FzUQa",
9
+ fill: "fill-gnSOL",
10
+ scrollFill: "scrollFill-ouKju",
11
+ table: "table-sZLxO",
12
+ head: "head-z5Rnq",
13
+ headerCell: "headerCell-CgaE0",
14
+ sortIcon: "sortIcon-aw3qW",
15
+ row: "row-OLZkz",
16
+ cell: "cell-TYnuY",
17
+ pinnedHeader: "pinnedHeader-b7R5T",
18
+ pinnedCell: "pinnedCell-hktdQ",
19
+ selectHeader: "selectHeader-ysJFY",
20
+ selectCell: "selectCell-WkrzU",
21
+ expandHeader: "expandHeader-xZuaw",
22
+ expandCell: "expandCell-nB87K",
23
+ expandButton: "expandButton-gnwRu",
24
+ actionsHeader: "actionsHeader-DXNJS",
25
+ actionsCell: "actionsCell-XmWDR",
26
+ detailRow: "detailRow-WsOl1",
27
+ detailCell: "detailCell-y4qyE",
28
+ errorCell: "errorCell-m9Gxy",
29
+ errorContent: "errorContent-_tmon",
30
+ stateCell: "stateCell-_44Lv",
31
+ state: "state-WLbKa",
32
+ spacerCell: "spacerCell-IoOYY",
33
+ footer: "footer-pI1Q7",
34
+ rowCount: "rowCount-M_Nba"
35
+ };
36
+ export default DataGrid_module;