@redis-ui/table 2.12.0 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Table/Table.cjs +70 -145
- package/dist/Table/Table.context.cjs +16 -1
- package/dist/Table/Table.context.d.ts +22 -4
- package/dist/Table/Table.context.js +16 -1
- package/dist/Table/Table.d.ts +83 -5
- package/dist/Table/Table.js +70 -145
- package/dist/Table/Table.style.cjs +10 -5
- package/dist/Table/Table.style.d.ts +3 -3
- package/dist/Table/Table.style.js +10 -5
- package/dist/Table/Table.types.d.ts +20 -38
- package/dist/Table/components/Compose/Compose.cjs +42 -0
- package/dist/Table/components/Compose/Compose.d.ts +13 -0
- package/dist/Table/components/Compose/Compose.js +42 -0
- package/dist/Table/components/EmptyState/EmptyState.cjs +31 -0
- package/dist/Table/components/EmptyState/EmptyState.d.ts +6 -0
- package/dist/Table/components/EmptyState/EmptyState.js +31 -0
- package/dist/Table/components/HiddenCaption/HiddenCaption.cjs +13 -0
- package/dist/Table/components/HiddenCaption/HiddenCaption.d.ts +3 -0
- package/dist/Table/components/HiddenCaption/HiddenCaption.js +13 -0
- package/dist/Table/components/PluggableTable/PluggableTable.cjs +19 -0
- package/dist/Table/components/PluggableTable/PluggableTable.d.ts +10 -0
- package/dist/Table/components/PluggableTable/PluggableTable.js +19 -0
- package/dist/Table/components/PluggableTable/compositionComponents.cjs +21 -0
- package/dist/Table/components/PluggableTable/compositionComponents.d.ts +67 -0
- package/dist/Table/components/PluggableTable/compositionComponents.js +21 -0
- package/dist/Table/components/TableBody/TableBody.cjs +33 -0
- package/dist/Table/components/TableBody/TableBody.d.ts +23 -0
- package/dist/Table/components/TableBody/TableBody.js +33 -0
- package/dist/Table/components/TableBody/components/Compose/Compose.cjs +10 -0
- package/dist/Table/components/TableBody/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TableBody/components/Compose/Compose.js +10 -0
- package/dist/Table/components/TableBodyCell/TableBodyCell.cjs +22 -0
- package/dist/Table/components/TableBodyCell/TableBodyCell.d.ts +12 -0
- package/dist/Table/components/TableBodyCell/TableBodyCell.js +22 -0
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.cjs +5 -0
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.js +5 -0
- package/dist/Table/components/TableBodyRow/TableBodyRow.cjs +38 -0
- package/dist/Table/components/TableBodyRow/TableBodyRow.d.ts +20 -0
- package/dist/Table/components/TableBodyRow/TableBodyRow.js +38 -0
- package/dist/Table/components/TableBodyRow/TableBodyRowExpandable.cjs +33 -0
- package/dist/Table/components/TableBodyRow/TableBodyRowExpandable.d.ts +2 -0
- package/dist/Table/components/TableBodyRow/TableBodyRowExpandable.js +33 -0
- package/dist/Table/components/TableBodyRow/components/Compose/Compose.cjs +17 -0
- package/dist/Table/components/TableBodyRow/components/Compose/Compose.d.ts +4 -0
- package/dist/Table/components/TableBodyRow/components/Compose/Compose.js +17 -0
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.cjs +3 -4
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.d.ts +1 -1
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.js +3 -4
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.cjs +9 -4
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.d.ts +1 -1
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.js +9 -4
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.types.d.ts +3 -5
- package/dist/Table/components/TableHeader/TableHeader.cjs +28 -0
- package/dist/Table/components/TableHeader/TableHeader.d.ts +21 -0
- package/dist/Table/components/TableHeader/TableHeader.js +28 -0
- package/dist/Table/components/TableHeader/components/Compose/Compose.cjs +5 -0
- package/dist/Table/components/TableHeader/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TableHeader/components/Compose/Compose.js +5 -0
- package/dist/Table/components/TableHeaderCell/SRSortingNotification.cjs +19 -0
- package/dist/Table/components/TableHeaderCell/SRSortingNotification.d.ts +1 -0
- package/dist/Table/components/TableHeaderCell/SRSortingNotification.js +19 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.cjs +19 -33
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.context.cjs +15 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.context.d.ts +8 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.context.js +15 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.d.ts +16 -4
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.js +19 -33
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.test.d.ts +1 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.utils.cjs +0 -22
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.utils.d.ts +0 -1
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.utils.js +1 -23
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.cjs +40 -0
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.d.ts +9 -0
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.js +40 -0
- package/dist/Table/components/TableHeaderCell/components/Heading/Heading.cjs +34 -0
- package/dist/Table/components/TableHeaderCell/components/Heading/Heading.d.ts +5 -0
- package/dist/Table/components/TableHeaderCell/components/Heading/Heading.js +34 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/SortableHeading.cjs +16 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/SortableHeading.d.ts +8 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/SortableHeading.js +16 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/Compose/Compose.cjs +23 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/Compose/Compose.d.ts +5 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/Compose/Compose.js +23 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/SortIndicator/SortIndicator.cjs +6 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/SortIndicator/SortIndicator.d.ts +2 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/SortIndicator/SortIndicator.js +6 -0
- package/dist/Table/components/TableHeaderRow/TableHeaderRow.cjs +27 -0
- package/dist/Table/components/TableHeaderRow/TableHeaderRow.d.ts +12 -0
- package/dist/Table/components/TableHeaderRow/TableHeaderRow.js +27 -0
- package/dist/Table/components/TableHeaderRow/components/Compose/Compose.cjs +5 -0
- package/dist/Table/components/TableHeaderRow/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TableHeaderRow/components/Compose/Compose.js +5 -0
- package/dist/Table/components/TablePagination/TablePagination.cjs +65 -99
- package/dist/Table/components/TablePagination/TablePagination.d.ts +23 -3
- package/dist/Table/components/TablePagination/TablePagination.js +66 -100
- package/dist/Table/components/TablePagination/TablePagination.style.cjs +70 -50
- package/dist/Table/components/TablePagination/TablePagination.style.d.ts +17 -50
- package/dist/Table/components/TablePagination/TablePagination.style.js +72 -52
- package/dist/Table/components/TablePagination/components/Compose/Compose.cjs +41 -0
- package/dist/Table/components/TablePagination/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TablePagination/components/Compose/Compose.js +41 -0
- package/dist/Table/components/TableRoot/TableRoot.cjs +5 -0
- package/dist/Table/components/TableRoot/TableRoot.d.ts +1 -0
- package/dist/Table/components/TableRoot/TableRoot.js +5 -0
- package/dist/Table/index.d.ts +3 -6
- package/dist/Table/plugins/ClickableRowPlugin.cjs +48 -0
- package/dist/Table/plugins/ClickableRowPlugin.d.ts +25 -0
- package/dist/Table/plugins/ClickableRowPlugin.js +48 -0
- package/dist/Table/plugins/ExpandableRowPlugin.cjs +38 -0
- package/dist/Table/plugins/ExpandableRowPlugin.d.ts +22 -0
- package/dist/Table/plugins/ExpandableRowPlugin.js +38 -0
- package/dist/Table/plugins/PaginationPlugin.cjs +45 -0
- package/dist/Table/plugins/PaginationPlugin.d.ts +16 -0
- package/dist/Table/plugins/PaginationPlugin.js +45 -0
- package/dist/Table/plugins/RowSelectionPlugin.cjs +28 -0
- package/dist/Table/plugins/RowSelectionPlugin.d.ts +12 -0
- package/dist/Table/plugins/RowSelectionPlugin.js +28 -0
- package/dist/Table/plugins/SortingPlugin.cjs +44 -0
- package/dist/Table/plugins/SortingPlugin.d.ts +18 -0
- package/dist/Table/plugins/SortingPlugin.js +44 -0
- package/dist/Table/tanStackExtendedTypes.d.ts +11 -0
- package/dist/Table/utils/plugin.utils.cjs +49 -0
- package/dist/Table/utils/plugin.utils.d.ts +17 -0
- package/dist/Table/utils/plugin.utils.js +49 -0
- package/dist/Table/utils/plugin.utils.test.d.ts +1 -0
- package/dist/index.cjs +60 -0
- package/dist/index.js +61 -1
- package/dist/node_modules/@tanstack/react-table/build/lib/index.cjs +7 -0
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js +8 -1
- package/dist/node_modules/@tanstack/table-core/build/lib/index.cjs +361 -4
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +361 -4
- package/package.json +6 -5
- package/dist/Table/components/EmptyStateRow/EmptyStateRow.cjs +0 -16
- package/dist/Table/components/EmptyStateRow/EmptyStateRow.d.ts +0 -8
- package/dist/Table/components/EmptyStateRow/EmptyStateRow.js +0 -16
- package/dist/node_modules/@radix-ui/react-id/dist/index.cjs +0 -32
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +0 -14
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +0 -24
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -6
package/dist/Table/Table.js
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "../node_modules/react/jsx-runtime.js";
|
|
2
|
-
import { useState, useEffect, Fragment } from "react";
|
|
3
|
-
import { VisuallyHidden } from "../node_modules/@radix-ui/react-visually-hidden/dist/index.js";
|
|
4
|
-
import { useReactTable, flexRender } from "../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
5
|
-
import { useControllableState } from "../node_modules/@radix-ui/react-use-controllable-state/dist/index.js";
|
|
6
|
-
import TablePagination from "./components/TablePagination/TablePagination.js";
|
|
7
2
|
import { ExpandRowButton } from "./components/ExpandRowButton/ExpandRowButton.js";
|
|
8
3
|
import { TableExpandedRow } from "./components/TableExpandedRow/TableExpandedRow.js";
|
|
9
4
|
import { TableAnimatedExpandedRow } from "./components/TableExpandedRow/TableAnimatedExpandedRow.js";
|
|
10
|
-
import { TableContext } from "./Table.context.js";
|
|
11
|
-
import { TableHeaderCell } from "./components/TableHeaderCell/TableHeaderCell.js";
|
|
12
|
-
import { getTableSortLabel, formatTableSortNotification } from "./components/TableHeaderCell/TableHeaderCell.utils.js";
|
|
13
|
-
import { EmptyStateRow } from "./components/EmptyStateRow/EmptyStateRow.js";
|
|
14
5
|
import { RowSelectionButton } from "./components/RowSelection/RowSelectionButton.js";
|
|
15
6
|
import { HeaderMultiRowSelectionButton } from "./components/RowSelection/HeaderMultiRowSelectionButton.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
|
|
7
|
+
import { useRowSelectionPlugin } from "./plugins/RowSelectionPlugin.js";
|
|
8
|
+
import { useExpandableRowPlugin, useExpandableRowContext } from "./plugins/ExpandableRowPlugin.js";
|
|
9
|
+
import { usePaginationPlugin, usePaginationContext } from "./plugins/PaginationPlugin.js";
|
|
10
|
+
import { useSortingPlugin, useSortingContext } from "./plugins/SortingPlugin.js";
|
|
11
|
+
import { useClickableRowPlugin, useClickableRowContext } from "./plugins/ClickableRowPlugin.js";
|
|
12
|
+
import { useTableContext, useComposeContext } from "./Table.context.js";
|
|
13
|
+
import { PluggableTable } from "./components/PluggableTable/PluggableTable.js";
|
|
14
|
+
import { compositionComponents } from "./components/PluggableTable/compositionComponents.js";
|
|
24
15
|
const Table = Object.assign(({
|
|
25
16
|
columns,
|
|
26
17
|
caption,
|
|
@@ -31,15 +22,16 @@ const Table = Object.assign(({
|
|
|
31
22
|
maxHeight,
|
|
32
23
|
stripedRows = false,
|
|
33
24
|
// sorting
|
|
25
|
+
enableSorting,
|
|
34
26
|
defaultSorting,
|
|
35
27
|
onSortingChange,
|
|
36
28
|
sorting,
|
|
37
|
-
manualSorting
|
|
29
|
+
manualSorting,
|
|
38
30
|
// row expansion
|
|
39
31
|
getIsRowExpandable,
|
|
40
32
|
renderExpandedRow,
|
|
41
33
|
expandRowOnClick,
|
|
42
|
-
expandedRowComponent
|
|
34
|
+
expandedRowComponent,
|
|
43
35
|
// pagination
|
|
44
36
|
pagination,
|
|
45
37
|
defaultPagination,
|
|
@@ -47,7 +39,7 @@ const Table = Object.assign(({
|
|
|
47
39
|
manualPagination,
|
|
48
40
|
totalRowCount,
|
|
49
41
|
pageSizes,
|
|
50
|
-
paginationEnabled
|
|
42
|
+
paginationEnabled,
|
|
51
43
|
// row selection
|
|
52
44
|
rowSelection,
|
|
53
45
|
defaultRowSelection,
|
|
@@ -55,142 +47,75 @@ const Table = Object.assign(({
|
|
|
55
47
|
rowSelectionMode,
|
|
56
48
|
getRowCanSelect
|
|
57
49
|
}) => {
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
defaultProp: defaultSorting,
|
|
62
|
-
onChange: onSortingChange
|
|
63
|
-
});
|
|
64
|
-
const [paginationState, setPaginationState] = useControllableState({
|
|
65
|
-
prop: pagination,
|
|
66
|
-
defaultProp: defaultPagination ?? DEFAULT_PAGINATION,
|
|
67
|
-
onChange: onPaginationChange
|
|
50
|
+
const clickableRowPluginData = useClickableRowPlugin({
|
|
51
|
+
onRowClick: onRowClick && ((row) => onRowClick(row.original)),
|
|
52
|
+
shouldClickOnEnter: true
|
|
68
53
|
});
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
54
|
+
const sortingPluginData = useSortingPlugin({
|
|
55
|
+
enableSorting,
|
|
56
|
+
defaultSorting,
|
|
57
|
+
onSortingChange,
|
|
58
|
+
sorting,
|
|
59
|
+
manualSorting
|
|
73
60
|
});
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
onPaginationChange
|
|
61
|
+
const paginationPluginData = usePaginationPlugin({
|
|
62
|
+
pagination,
|
|
63
|
+
defaultPagination,
|
|
64
|
+
onPaginationChange,
|
|
78
65
|
manualPagination,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const table = useReactTable({
|
|
83
|
-
data,
|
|
84
|
-
columns,
|
|
85
|
-
getRowId,
|
|
86
|
-
getCoreRowModel: getCoreRowModel(),
|
|
87
|
-
getSortedRowModel: getSortedRowModel(),
|
|
88
|
-
state: {
|
|
89
|
-
sorting: sortingState,
|
|
90
|
-
...paginationEnabled && {
|
|
91
|
-
pagination: paginationState
|
|
92
|
-
},
|
|
93
|
-
...rowSelectionMode && {
|
|
94
|
-
rowSelection: rowSelectionState
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
manualSorting,
|
|
98
|
-
onSortingChange: (value) => {
|
|
99
|
-
setSortingState(value);
|
|
100
|
-
setUserSorted(true);
|
|
101
|
-
},
|
|
102
|
-
getExpandedRowModel: isExpandable ? getExpandedRowModel() : void 0,
|
|
103
|
-
getRowCanExpand: isExpandable ? getIsRowExpandable && ((row) => getIsRowExpandable(row.original)) || getTrue : void 0,
|
|
104
|
-
...paginationEnabled && paginationSettings,
|
|
105
|
-
enableRowSelection: rowSelectionMode && (getRowCanSelect ?? true),
|
|
106
|
-
enableMultiRowSelection: rowSelectionMode === "multiple",
|
|
107
|
-
onRowSelectionChange: setRowSelectionState
|
|
66
|
+
totalRowCount,
|
|
67
|
+
pageSizes,
|
|
68
|
+
paginationEnabled
|
|
108
69
|
});
|
|
109
|
-
const {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
70
|
+
const expandableRowPluginData = useExpandableRowPlugin({
|
|
71
|
+
expandRowOnClick,
|
|
72
|
+
getRowCanExpand: getIsRowExpandable && ((row) => getIsRowExpandable(row.original)),
|
|
73
|
+
renderExpandedRow,
|
|
74
|
+
expandedRowComponent
|
|
75
|
+
});
|
|
76
|
+
const rowSelectionPluginData = useRowSelectionPlugin({
|
|
77
|
+
rowSelection,
|
|
78
|
+
defaultRowSelection,
|
|
79
|
+
onRowSelectionChange,
|
|
80
|
+
rowSelectionMode,
|
|
81
|
+
getRowCanSelect
|
|
82
|
+
});
|
|
83
|
+
return jsxRuntimeExports.jsx(Table.PluggableTable, {
|
|
84
|
+
...{
|
|
85
|
+
data,
|
|
86
|
+
columns,
|
|
87
|
+
maxHeight,
|
|
88
|
+
stripedRows,
|
|
89
|
+
caption,
|
|
90
|
+
emptyStateRender: emptyState
|
|
91
|
+
},
|
|
92
|
+
tableOptions: {
|
|
93
|
+
getRowId
|
|
122
94
|
},
|
|
123
|
-
|
|
124
|
-
children: [jsxRuntimeExports.jsxs(Table$1, {
|
|
125
|
-
children: [caption && jsxRuntimeExports.jsx(VisuallyHidden, {
|
|
126
|
-
asChild: true,
|
|
127
|
-
children: jsxRuntimeExports.jsx("caption", {
|
|
128
|
-
children: caption
|
|
129
|
-
})
|
|
130
|
-
}), jsxRuntimeExports.jsx(TableHead, {
|
|
131
|
-
children: table.getHeaderGroups().map((headerGroup) => jsxRuntimeExports.jsx(TableHeaderRow, {
|
|
132
|
-
children: headerGroup.headers.map((header) => jsxRuntimeExports.jsx(TableHeaderCell, {
|
|
133
|
-
header
|
|
134
|
-
}, header.id))
|
|
135
|
-
}, headerGroup.id))
|
|
136
|
-
}), jsxRuntimeExports.jsxs(TableBody, {
|
|
137
|
-
maxHeight,
|
|
138
|
-
children: [!rows.length ? jsxRuntimeExports.jsx(EmptyStateRow, {
|
|
139
|
-
table,
|
|
140
|
-
emptyState
|
|
141
|
-
}) : null, rows.map((row) => {
|
|
142
|
-
const isRowExpandable = isExpandable && row.getCanExpand();
|
|
143
|
-
const isRowExpanded = isRowExpandable && row.getIsExpanded();
|
|
144
|
-
const handleClick = () => {
|
|
145
|
-
isRowExpandable && expandRowOnClick && row.toggleExpanded();
|
|
146
|
-
onRowClick == null ? void 0 : onRowClick(row.original);
|
|
147
|
-
};
|
|
148
|
-
return jsxRuntimeExports.jsxs(Fragment, {
|
|
149
|
-
children: [jsxRuntimeExports.jsx(TableBodyRow, {
|
|
150
|
-
tabIndex: 0,
|
|
151
|
-
"data-row-type": "regular",
|
|
152
|
-
...isRowExpandable ? {
|
|
153
|
-
"aria-expanded": isRowExpanded
|
|
154
|
-
} : null,
|
|
155
|
-
"$stripedRows": stripedRows,
|
|
156
|
-
"$hasOnClick": !!onRowClick || isRowExpandable,
|
|
157
|
-
onClick: handleClick,
|
|
158
|
-
onKeyDown: (event) => {
|
|
159
|
-
if (event.key === "Enter" && event.target === event.currentTarget) {
|
|
160
|
-
handleClick();
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
children: row.getVisibleCells().map((cell) => jsxRuntimeExports.jsx(TableBodyCell, {
|
|
164
|
-
style: {
|
|
165
|
-
width: cell.column.getSize()
|
|
166
|
-
},
|
|
167
|
-
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
168
|
-
}, cell.id))
|
|
169
|
-
}), isRowExpandable && // 2nd row is a custom 1 cell row for expanded part
|
|
170
|
-
jsxRuntimeExports.jsx(ExpandedRow, {
|
|
171
|
-
"data-row-type": "expanded",
|
|
172
|
-
"data-expanded": isRowExpanded,
|
|
173
|
-
expanded: isRowExpanded,
|
|
174
|
-
row,
|
|
175
|
-
renderExpandedRow
|
|
176
|
-
})]
|
|
177
|
-
}, row.id);
|
|
178
|
-
})]
|
|
179
|
-
})]
|
|
180
|
-
}), jsxRuntimeExports.jsx(TablePagination, {
|
|
181
|
-
pageSizes
|
|
182
|
-
})]
|
|
183
|
-
}), userSorted && jsxRuntimeExports.jsx(VisuallyHidden, {
|
|
184
|
-
"aria-live": "polite",
|
|
185
|
-
children: getTableSortLabel(table, formatTableSortNotification)
|
|
186
|
-
})]
|
|
95
|
+
pluginsData: [clickableRowPluginData, sortingPluginData, paginationPluginData, expandableRowPluginData, rowSelectionPluginData]
|
|
187
96
|
});
|
|
188
97
|
}, {
|
|
189
98
|
ExpandRowButton,
|
|
190
99
|
ExpandedRow: TableExpandedRow,
|
|
191
100
|
AnimatedExpandedRow: TableAnimatedExpandedRow,
|
|
192
101
|
RowSelectionButton,
|
|
193
|
-
HeaderMultiRowSelectionButton
|
|
102
|
+
HeaderMultiRowSelectionButton,
|
|
103
|
+
// plugins
|
|
104
|
+
useClickableRowPlugin,
|
|
105
|
+
useSortingPlugin,
|
|
106
|
+
usePaginationPlugin,
|
|
107
|
+
useExpandableRowPlugin,
|
|
108
|
+
useRowSelectionPlugin,
|
|
109
|
+
// contexts
|
|
110
|
+
useTableContext,
|
|
111
|
+
useComposeContext,
|
|
112
|
+
useClickableRowContext,
|
|
113
|
+
useExpandableRowContext,
|
|
114
|
+
usePaginationContext,
|
|
115
|
+
useSortingContext,
|
|
116
|
+
// composition components
|
|
117
|
+
PluggableTable,
|
|
118
|
+
...compositionComponents
|
|
194
119
|
});
|
|
195
120
|
export {
|
|
196
121
|
Table as default
|
|
@@ -22,8 +22,8 @@ const TableHeaderRow = _styled__default.default.tr.withConfig({
|
|
|
22
22
|
displayName: "Tablestyle__TableHeaderRow",
|
|
23
23
|
componentId: "RedisUI__sc-o0xfty-3"
|
|
24
24
|
})(["height:5.6rem;display:table;width:100%;table-layout:fixed;"]);
|
|
25
|
-
const
|
|
26
|
-
displayName: "
|
|
25
|
+
const SortableHeadingCompose = _styled__default.default.button.withConfig({
|
|
26
|
+
displayName: "Tablestyle__SortableHeadingCompose",
|
|
27
27
|
componentId: "RedisUI__sc-o0xfty-4"
|
|
28
28
|
})(["all:unset;border-radius:0.03rem;display:flex;align-items:center;justify-content:flex-start;gap:0.8rem;height:100%;width:100%;min-height:35px;max-width:100%;overflow:hidden;", " svg{flex:none;}"], redisUiStyles.getFocusStyle("0.6rem"));
|
|
29
29
|
const HeaderTitleWrapper = _styled__default.default(redisUiComponents.Typography.Body).withConfig({
|
|
@@ -50,8 +50,8 @@ const TableBodyRow = _styled__default.default.tr.withConfig({
|
|
|
50
50
|
displayName: "Tablestyle__TableBodyRow",
|
|
51
51
|
componentId: "RedisUI__sc-o0xfty-8"
|
|
52
52
|
})(["border-top:1px solid ", ";height:4.8rem;transition:box-shadow 0.2s ease-in-out;position:relative;&:hover,&:focus{cursor:", ";z-index:1;box-shadow:", ";", "{opacity:1;visibility:visible;}}", " display:table;width:100%;table-layout:fixed;"], () => redisUiStyles.useTheme().components.table.table.tableBodyRow.borderTop, ({
|
|
53
|
-
|
|
54
|
-
}) =>
|
|
53
|
+
onClick
|
|
54
|
+
}) => onClick ? "pointer" : "default", () => redisUiStyles.useTheme().components.table.table.tableBodyRow.hoverBoxShadow, ShowOnRowHover_style.ShowOnRowHover, ({
|
|
55
55
|
$stripedRows
|
|
56
56
|
}) => $stripedRows && _styled.css`
|
|
57
57
|
:nth-child(even of [data-row-type='regular']) {
|
|
@@ -62,8 +62,13 @@ const TableBodyCell = _styled__default.default.td.withConfig({
|
|
|
62
62
|
displayName: "Tablestyle__TableBodyCell",
|
|
63
63
|
componentId: "RedisUI__sc-o0xfty-9"
|
|
64
64
|
})(["color:", ";padding:0 1.2rem;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;"], () => redisUiStyles.useTheme().components.table.table.tableBodyCell.color);
|
|
65
|
-
|
|
65
|
+
const EmptyStateContainer = _styled__default.default.div.withConfig({
|
|
66
|
+
displayName: "Tablestyle__EmptyStateContainer",
|
|
67
|
+
componentId: "RedisUI__sc-o0xfty-10"
|
|
68
|
+
})(["text-align:center;"]);
|
|
69
|
+
exports.EmptyStateContainer = EmptyStateContainer;
|
|
66
70
|
exports.HeaderTitleWrapper = HeaderTitleWrapper;
|
|
71
|
+
exports.SortableHeadingCompose = SortableHeadingCompose;
|
|
67
72
|
exports.Table = Table;
|
|
68
73
|
exports.TableBody = TableBody;
|
|
69
74
|
exports.TableBodyCell = TableBodyCell;
|
|
@@ -2,8 +2,8 @@ export declare const TableContainer: import("styled-components").StyledComponent
|
|
|
2
2
|
export declare const Table: import("styled-components").StyledComponent<"table", any, {}, never>;
|
|
3
3
|
export declare const TableHead: import("styled-components").StyledComponent<"thead", any, {}, never>;
|
|
4
4
|
export declare const TableHeaderRow: import("styled-components").StyledComponent<"tr", any, {}, never>;
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const HeaderTitleWrapper: import("styled-components").StyledComponent<({ size, variant, color, component, ellipsis, ...restProps }: import("@redislabsdev/redis-ui-components
|
|
5
|
+
export declare const SortableHeadingCompose: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
6
|
+
export declare const HeaderTitleWrapper: import("styled-components").StyledComponent<({ size, variant, color, component, ellipsis, ...restProps }: import("@redislabsdev/redis-ui-components").TypographyBodyProps) => import("react/jsx-runtime").JSX.Element, any, {
|
|
7
7
|
$isTextual: boolean;
|
|
8
8
|
}, never>;
|
|
9
9
|
export declare const TableTh: import("styled-components").StyledComponent<"th", any, {}, never>;
|
|
@@ -12,6 +12,6 @@ export declare const TableBody: import("styled-components").StyledComponent<"tbo
|
|
|
12
12
|
}, never>;
|
|
13
13
|
export declare const TableBodyRow: import("styled-components").StyledComponent<"tr", any, {
|
|
14
14
|
$stripedRows: boolean;
|
|
15
|
-
$hasOnClick?: boolean | undefined;
|
|
16
15
|
}, never>;
|
|
17
16
|
export declare const TableBodyCell: import("styled-components").StyledComponent<"td", any, {}, never>;
|
|
17
|
+
export declare const EmptyStateContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -18,8 +18,8 @@ const TableHeaderRow = _styled.tr.withConfig({
|
|
|
18
18
|
displayName: "Tablestyle__TableHeaderRow",
|
|
19
19
|
componentId: "RedisUI__sc-o0xfty-3"
|
|
20
20
|
})(["height:5.6rem;display:table;width:100%;table-layout:fixed;"]);
|
|
21
|
-
const
|
|
22
|
-
displayName: "
|
|
21
|
+
const SortableHeadingCompose = _styled.button.withConfig({
|
|
22
|
+
displayName: "Tablestyle__SortableHeadingCompose",
|
|
23
23
|
componentId: "RedisUI__sc-o0xfty-4"
|
|
24
24
|
})(["all:unset;border-radius:0.03rem;display:flex;align-items:center;justify-content:flex-start;gap:0.8rem;height:100%;width:100%;min-height:35px;max-width:100%;overflow:hidden;", " svg{flex:none;}"], getFocusStyle("0.6rem"));
|
|
25
25
|
const HeaderTitleWrapper = _styled(Typography.Body).withConfig({
|
|
@@ -46,8 +46,8 @@ const TableBodyRow = _styled.tr.withConfig({
|
|
|
46
46
|
displayName: "Tablestyle__TableBodyRow",
|
|
47
47
|
componentId: "RedisUI__sc-o0xfty-8"
|
|
48
48
|
})(["border-top:1px solid ", ";height:4.8rem;transition:box-shadow 0.2s ease-in-out;position:relative;&:hover,&:focus{cursor:", ";z-index:1;box-shadow:", ";", "{opacity:1;visibility:visible;}}", " display:table;width:100%;table-layout:fixed;"], () => useTheme().components.table.table.tableBodyRow.borderTop, ({
|
|
49
|
-
|
|
50
|
-
}) =>
|
|
49
|
+
onClick
|
|
50
|
+
}) => onClick ? "pointer" : "default", () => useTheme().components.table.table.tableBodyRow.hoverBoxShadow, ShowOnRowHover, ({
|
|
51
51
|
$stripedRows
|
|
52
52
|
}) => $stripedRows && css`
|
|
53
53
|
:nth-child(even of [data-row-type='regular']) {
|
|
@@ -58,9 +58,14 @@ const TableBodyCell = _styled.td.withConfig({
|
|
|
58
58
|
displayName: "Tablestyle__TableBodyCell",
|
|
59
59
|
componentId: "RedisUI__sc-o0xfty-9"
|
|
60
60
|
})(["color:", ";padding:0 1.2rem;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;"], () => useTheme().components.table.table.tableBodyCell.color);
|
|
61
|
+
const EmptyStateContainer = _styled.div.withConfig({
|
|
62
|
+
displayName: "Tablestyle__EmptyStateContainer",
|
|
63
|
+
componentId: "RedisUI__sc-o0xfty-10"
|
|
64
|
+
})(["text-align:center;"]);
|
|
61
65
|
export {
|
|
62
|
-
|
|
66
|
+
EmptyStateContainer,
|
|
63
67
|
HeaderTitleWrapper,
|
|
68
|
+
SortableHeadingCompose,
|
|
64
69
|
Table,
|
|
65
70
|
TableBody,
|
|
66
71
|
TableBodyCell,
|
|
@@ -1,48 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import './
|
|
1
|
+
import type { CellContext, ColumnDef, PaginationState, Row, SortingState } from '@tanstack/react-table';
|
|
2
|
+
import { TableExpandableRowParams } from './plugins/ExpandableRowPlugin';
|
|
3
|
+
import { TablePaginationParams } from './plugins/PaginationPlugin';
|
|
4
|
+
import { TableRowSelectionParams } from './plugins/RowSelectionPlugin';
|
|
5
|
+
import { TableSortingParams } from './plugins/SortingPlugin';
|
|
6
|
+
import { EmptyStateProps } from './components/EmptyState/EmptyState';
|
|
7
|
+
export * from '@tanstack/react-table';
|
|
8
|
+
/** @deprecated use ColumnDef */
|
|
5
9
|
export type ColumnDefinition<T extends object> = ColumnDef<T>;
|
|
10
|
+
/** @deprecated use Row */
|
|
6
11
|
export type RowDefinition<T extends object> = Row<T>;
|
|
12
|
+
/** @deprecated use CellContext */
|
|
7
13
|
export type CellDefinition<T extends object, D> = CellContext<T, D>;
|
|
14
|
+
/** @deprecated use PaginationState */
|
|
8
15
|
export type PaginationTypes = PaginationState;
|
|
16
|
+
/** @deprecated use SortingState */
|
|
9
17
|
export type SortingTypes = SortingState;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
manualSorting?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export interface TableExpandableRowProps<T extends object> {
|
|
17
|
-
getIsRowExpandable?: (row: T) => boolean;
|
|
18
|
-
renderExpandedRow?: (row: RowDefinition<T>) => ReactNode;
|
|
19
|
-
expandRowOnClick?: boolean;
|
|
20
|
-
expandedRowComponent?: ComponentType<TableExpandedRowProps<T>>;
|
|
21
|
-
}
|
|
22
|
-
interface TablePaginationProps {
|
|
23
|
-
pagination?: PaginationState;
|
|
24
|
-
defaultPagination?: PaginationState;
|
|
25
|
-
onPaginationChange?: (state: PaginationState) => void;
|
|
26
|
-
manualPagination?: boolean;
|
|
27
|
-
totalRowCount?: number;
|
|
28
|
-
pageSizes?: number[];
|
|
29
|
-
paginationEnabled?: boolean;
|
|
30
|
-
}
|
|
31
|
-
interface TableRowSelectionState<T extends object> {
|
|
32
|
-
rowSelection?: RowSelectionState;
|
|
33
|
-
defaultRowSelection?: RowSelectionState;
|
|
34
|
-
onRowSelectionChange?: (state: RowSelectionState) => void;
|
|
35
|
-
rowSelectionMode?: 'single' | 'multiple';
|
|
36
|
-
getRowCanSelect?: (row: Row<T>) => boolean;
|
|
37
|
-
}
|
|
38
|
-
export interface TableProps<T extends object> extends TableSortingProps, TableExpandableRowProps<T>, TablePaginationProps, TableRowSelectionState<T> {
|
|
18
|
+
type TableExpandableRowProps<T extends object> = Omit<TableExpandableRowParams<T>, 'getRowCanExpand'> & {
|
|
19
|
+
getIsRowExpandable?: (rowData: T) => boolean;
|
|
20
|
+
};
|
|
21
|
+
export interface TableProps<T extends object> extends TableSortingParams, TableExpandableRowProps<T>, TablePaginationParams, TableRowSelectionParams<T> {
|
|
39
22
|
data: T[];
|
|
40
|
-
columns:
|
|
41
|
-
getRowId?: (
|
|
42
|
-
onRowClick?: (
|
|
43
|
-
emptyState?:
|
|
23
|
+
columns: ColumnDef<T>[];
|
|
24
|
+
getRowId?: (rowData: T, index: number) => string;
|
|
25
|
+
onRowClick?: (rowData: T) => void;
|
|
26
|
+
emptyState?: EmptyStateProps['emptyStateRender'];
|
|
44
27
|
maxHeight?: string;
|
|
45
28
|
stripedRows?: boolean;
|
|
46
29
|
caption?: string;
|
|
47
30
|
}
|
|
48
|
-
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
|
|
4
|
+
const index = require("../../../node_modules/@tanstack/react-table/build/lib/index.cjs");
|
|
5
|
+
const plugin_utils = require("../../utils/plugin.utils.cjs");
|
|
6
|
+
const Table_context = require("../../Table.context.cjs");
|
|
7
|
+
const Table_style = require("../../Table.style.cjs");
|
|
8
|
+
const index$1 = require("../../../node_modules/@tanstack/table-core/build/lib/index.cjs");
|
|
9
|
+
const TableCompose = ({
|
|
10
|
+
data,
|
|
11
|
+
columns,
|
|
12
|
+
pluginsData,
|
|
13
|
+
tableOptions,
|
|
14
|
+
components,
|
|
15
|
+
maxHeight,
|
|
16
|
+
stripedRows,
|
|
17
|
+
...restProps
|
|
18
|
+
}) => {
|
|
19
|
+
const mergedPluginsData = plugin_utils.mergePluginsData(pluginsData);
|
|
20
|
+
const table = index.useReactTable({
|
|
21
|
+
data,
|
|
22
|
+
columns,
|
|
23
|
+
getCoreRowModel: index$1.getCoreRowModel(),
|
|
24
|
+
enableSorting: false,
|
|
25
|
+
...tableOptions,
|
|
26
|
+
...mergedPluginsData == null ? void 0 : mergedPluginsData.tableOptions
|
|
27
|
+
});
|
|
28
|
+
const tableContext = {
|
|
29
|
+
table,
|
|
30
|
+
plugins: mergedPluginsData.context,
|
|
31
|
+
components,
|
|
32
|
+
stripedRows,
|
|
33
|
+
maxHeight
|
|
34
|
+
};
|
|
35
|
+
return jsxRuntime.jsxRuntimeExports.jsx(Table_context.TableContextProvider, {
|
|
36
|
+
value: tableContext,
|
|
37
|
+
children: jsxRuntime.jsxRuntimeExports.jsx(Table_style.TableContainer, {
|
|
38
|
+
...restProps
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
exports.TableCompose = TableCompose;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SetOptional } from 'type-fest';
|
|
2
|
+
import { TableOptions } from '@tanstack/table-core';
|
|
3
|
+
import { ComposeElementProps } from '@redislabsdev/redis-ui-components';
|
|
4
|
+
import { TablePluginData } from '../../utils/plugin.utils';
|
|
5
|
+
import { CompositionContextProps, TableMainContextProps } from '../../Table.context';
|
|
6
|
+
export type OwnTableComposeProps<T extends object> = TableMainContextProps & Pick<TableOptions<T>, 'data' | 'columns'> & {
|
|
7
|
+
tableOptions?: Omit<SetOptional<TableOptions<T>, 'getCoreRowModel'>, 'data' | 'columns'>;
|
|
8
|
+
pluginsData?: TablePluginData<T>[];
|
|
9
|
+
components?: Partial<CompositionContextProps<T>>;
|
|
10
|
+
};
|
|
11
|
+
export type RestTableComposeProps = ComposeElementProps;
|
|
12
|
+
export type TableComposeProps<T extends object> = OwnTableComposeProps<T> & RestTableComposeProps;
|
|
13
|
+
export declare const TableCompose: <T extends object>({ data, columns, pluginsData, tableOptions, components, maxHeight, stripedRows, ...restProps }: TableComposeProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { useReactTable } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
3
|
+
import { mergePluginsData } from "../../utils/plugin.utils.js";
|
|
4
|
+
import { TableContextProvider } from "../../Table.context.js";
|
|
5
|
+
import { TableContainer } from "../../Table.style.js";
|
|
6
|
+
import { getCoreRowModel } from "../../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
7
|
+
const TableCompose = ({
|
|
8
|
+
data,
|
|
9
|
+
columns,
|
|
10
|
+
pluginsData,
|
|
11
|
+
tableOptions,
|
|
12
|
+
components,
|
|
13
|
+
maxHeight,
|
|
14
|
+
stripedRows,
|
|
15
|
+
...restProps
|
|
16
|
+
}) => {
|
|
17
|
+
const mergedPluginsData = mergePluginsData(pluginsData);
|
|
18
|
+
const table = useReactTable({
|
|
19
|
+
data,
|
|
20
|
+
columns,
|
|
21
|
+
getCoreRowModel: getCoreRowModel(),
|
|
22
|
+
enableSorting: false,
|
|
23
|
+
...tableOptions,
|
|
24
|
+
...mergedPluginsData == null ? void 0 : mergedPluginsData.tableOptions
|
|
25
|
+
});
|
|
26
|
+
const tableContext = {
|
|
27
|
+
table,
|
|
28
|
+
plugins: mergedPluginsData.context,
|
|
29
|
+
components,
|
|
30
|
+
stripedRows,
|
|
31
|
+
maxHeight
|
|
32
|
+
};
|
|
33
|
+
return jsxRuntimeExports.jsx(TableContextProvider, {
|
|
34
|
+
value: tableContext,
|
|
35
|
+
children: jsxRuntimeExports.jsx(TableContainer, {
|
|
36
|
+
...restProps
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
TableCompose
|
|
42
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
|
|
4
|
+
const Table_context = require("../../Table.context.cjs");
|
|
5
|
+
const TableHeaderCell_utils = require("../TableHeaderCell/TableHeaderCell.utils.cjs");
|
|
6
|
+
const Table_style = require("../../Table.style.cjs");
|
|
7
|
+
const EmptyState = ({
|
|
8
|
+
emptyStateRender,
|
|
9
|
+
...restProps
|
|
10
|
+
}) => {
|
|
11
|
+
const {
|
|
12
|
+
table
|
|
13
|
+
} = Table_context.useTableContext();
|
|
14
|
+
if (table.getRowModel().rows.length) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const content = (typeof emptyStateRender === "function" ? emptyStateRender() : emptyStateRender) ?? "No data to display";
|
|
18
|
+
return jsxRuntime.jsxRuntimeExports.jsx(Table_style.TableBody, {
|
|
19
|
+
...restProps,
|
|
20
|
+
children: jsxRuntime.jsxRuntimeExports.jsx(Table_style.TableBodyRow, {
|
|
21
|
+
"$stripedRows": false,
|
|
22
|
+
children: jsxRuntime.jsxRuntimeExports.jsx(Table_style.TableBodyCell, {
|
|
23
|
+
colSpan: TableHeaderCell_utils.normalizeCellSpan(table.getVisibleLeafColumns().length),
|
|
24
|
+
children: typeof content === "string" ? jsxRuntime.jsxRuntimeExports.jsx(Table_style.EmptyStateContainer, {
|
|
25
|
+
children: content
|
|
26
|
+
}) : content
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
exports.EmptyState = EmptyState;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { ChildFree } from '@redislabsdev/redis-ui-components';
|
|
3
|
+
export interface EmptyStateProps extends ChildFree<HTMLAttributes<HTMLTableSectionElement>> {
|
|
4
|
+
emptyStateRender?: (() => ReactNode) | string;
|
|
5
|
+
}
|
|
6
|
+
export declare const EmptyState: ({ emptyStateRender, ...restProps }: EmptyStateProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { useTableContext } from "../../Table.context.js";
|
|
3
|
+
import { normalizeCellSpan } from "../TableHeaderCell/TableHeaderCell.utils.js";
|
|
4
|
+
import { TableBody, TableBodyRow, TableBodyCell, EmptyStateContainer } from "../../Table.style.js";
|
|
5
|
+
const EmptyState = ({
|
|
6
|
+
emptyStateRender,
|
|
7
|
+
...restProps
|
|
8
|
+
}) => {
|
|
9
|
+
const {
|
|
10
|
+
table
|
|
11
|
+
} = useTableContext();
|
|
12
|
+
if (table.getRowModel().rows.length) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
const content = (typeof emptyStateRender === "function" ? emptyStateRender() : emptyStateRender) ?? "No data to display";
|
|
16
|
+
return jsxRuntimeExports.jsx(TableBody, {
|
|
17
|
+
...restProps,
|
|
18
|
+
children: jsxRuntimeExports.jsx(TableBodyRow, {
|
|
19
|
+
"$stripedRows": false,
|
|
20
|
+
children: jsxRuntimeExports.jsx(TableBodyCell, {
|
|
21
|
+
colSpan: normalizeCellSpan(table.getVisibleLeafColumns().length),
|
|
22
|
+
children: typeof content === "string" ? jsxRuntimeExports.jsx(EmptyStateContainer, {
|
|
23
|
+
children: content
|
|
24
|
+
}) : content
|
|
25
|
+
})
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
EmptyState
|
|
31
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
|
|
4
|
+
const index = require("../../../node_modules/@radix-ui/react-visually-hidden/dist/index.cjs");
|
|
5
|
+
const HiddenCaption = ({
|
|
6
|
+
caption
|
|
7
|
+
}) => caption ? jsxRuntime.jsxRuntimeExports.jsx(index.VisuallyHidden, {
|
|
8
|
+
asChild: true,
|
|
9
|
+
children: jsxRuntime.jsxRuntimeExports.jsx("caption", {
|
|
10
|
+
children: caption
|
|
11
|
+
})
|
|
12
|
+
}) : null;
|
|
13
|
+
exports.HiddenCaption = HiddenCaption;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { VisuallyHidden } from "../../../node_modules/@radix-ui/react-visually-hidden/dist/index.js";
|
|
3
|
+
const HiddenCaption = ({
|
|
4
|
+
caption
|
|
5
|
+
}) => caption ? jsxRuntimeExports.jsx(VisuallyHidden, {
|
|
6
|
+
asChild: true,
|
|
7
|
+
children: jsxRuntimeExports.jsx("caption", {
|
|
8
|
+
children: caption
|
|
9
|
+
})
|
|
10
|
+
}) : null;
|
|
11
|
+
export {
|
|
12
|
+
HiddenCaption
|
|
13
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
|
|
4
|
+
const compositionComponents = require("./compositionComponents.cjs");
|
|
5
|
+
const PluggableTable = ({
|
|
6
|
+
caption,
|
|
7
|
+
emptyStateRender,
|
|
8
|
+
...restProps
|
|
9
|
+
}) => jsxRuntime.jsxRuntimeExports.jsxs(compositionComponents.compositionComponents.Compose, {
|
|
10
|
+
...restProps,
|
|
11
|
+
children: [jsxRuntime.jsxRuntimeExports.jsxs(compositionComponents.compositionComponents.Root, {
|
|
12
|
+
children: [jsxRuntime.jsxRuntimeExports.jsx(compositionComponents.compositionComponents.SRCaption, {
|
|
13
|
+
caption
|
|
14
|
+
}), jsxRuntime.jsxRuntimeExports.jsx(compositionComponents.compositionComponents.Header, {}), jsxRuntime.jsxRuntimeExports.jsx(compositionComponents.compositionComponents.EmptyState, {
|
|
15
|
+
emptyStateRender
|
|
16
|
+
}), jsxRuntime.jsxRuntimeExports.jsx(compositionComponents.compositionComponents.Body, {})]
|
|
17
|
+
}), jsxRuntime.jsxRuntimeExports.jsx(compositionComponents.compositionComponents.Pagination, {}), jsxRuntime.jsxRuntimeExports.jsx(compositionComponents.compositionComponents.SRSortingNotification, {})]
|
|
18
|
+
});
|
|
19
|
+
exports.PluggableTable = PluggableTable;
|