@redis-ui/table 2.23.2 → 3.3.2
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 +34 -5
- package/dist/Table/Table.context.d.ts +0 -1
- package/dist/Table/Table.d.ts +22 -18
- package/dist/Table/Table.js +34 -5
- package/dist/Table/Table.style.cjs +65 -39
- package/dist/Table/Table.style.d.ts +10 -7
- package/dist/Table/Table.style.js +65 -39
- package/dist/Table/Table.types.d.ts +8 -20
- package/dist/Table/components/Compose/Compose.cjs +4 -6
- package/dist/Table/components/Compose/Compose.d.ts +10 -9
- package/dist/Table/components/Compose/Compose.js +5 -7
- package/dist/Table/components/ExpandRowButton/useExpanderColumn.cjs +0 -1
- package/dist/Table/components/ExpandRowButton/useExpanderColumn.js +0 -1
- package/dist/Table/components/PluggableTable/PluggableTable.cjs +7 -1
- package/dist/Table/components/PluggableTable/PluggableTable.d.ts +3 -1
- package/dist/Table/components/PluggableTable/PluggableTable.js +7 -1
- package/dist/Table/components/PluggableTable/compositionComponents.cjs +4 -0
- package/dist/Table/components/PluggableTable/compositionComponents.d.ts +8 -6
- package/dist/Table/components/PluggableTable/compositionComponents.js +4 -0
- package/dist/Table/components/RowSelection/useRowSelectionColumn.cjs +0 -1
- package/dist/Table/components/RowSelection/useRowSelectionColumn.js +0 -1
- package/dist/Table/components/TableBody/TableBody.d.ts +2 -2
- package/dist/Table/components/TableBodyCell/TableBodyCell.d.ts +1 -1
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.d.ts +1 -1
- package/dist/Table/components/TableBodyRow/TableBodyRow.d.ts +1 -1
- package/dist/Table/components/TableBodyRow/components/Compose/Compose.d.ts +1 -1
- package/dist/Table/components/TableBottomBar/TableBottomBar.cjs +12 -0
- package/dist/Table/components/TableBottomBar/TableBottomBar.d.ts +2 -0
- package/dist/Table/components/TableBottomBar/TableBottomBar.js +12 -0
- package/dist/Table/components/TableBottomBar/TableBottomBar.test.d.ts +1 -0
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.cjs +8 -1
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.d.ts +1 -1
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.js +9 -2
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.style.cjs +11 -1
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.style.d.ts +3 -2
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.style.js +11 -1
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.cjs +2 -1
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.d.ts +1 -1
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.js +2 -1
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.style.cjs +2 -2
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.style.js +2 -2
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.types.d.ts +3 -2
- package/dist/Table/components/TableHeader/TableHeader.d.ts +1 -1
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.d.ts +1 -1
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.cjs +1 -1
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.d.ts +1 -1
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.js +2 -2
- package/dist/Table/components/TableHeaderCell/components/Heading/Heading.d.ts +2 -3
- package/dist/Table/components/TablePagination/TablePagination.d.ts +3 -2
- package/dist/Table/components/TablePagination/TablePagination.style.cjs +1 -1
- package/dist/Table/components/TablePagination/TablePagination.style.d.ts +3 -2
- package/dist/Table/components/TablePagination/TablePagination.style.js +1 -1
- package/dist/Table/components/TableRoot/TableRoot.cjs +6 -3
- package/dist/Table/components/TableRoot/TableRoot.js +7 -4
- package/dist/Table/components/TableTopBar/TableTopBar.cjs +12 -0
- package/dist/Table/components/TableTopBar/TableTopBar.d.ts +2 -0
- package/dist/Table/components/TableTopBar/TableTopBar.js +12 -0
- package/dist/Table/components/TableTopBar/TableTopBar.test.d.ts +1 -0
- package/dist/Table/index.d.ts +1 -0
- package/dist/Table/plugins/ColumnVisibilityPlugin.cjs +14 -0
- package/dist/Table/plugins/ColumnVisibilityPlugin.d.ts +10 -0
- package/dist/Table/plugins/ColumnVisibilityPlugin.js +14 -0
- package/dist/Table/plugins/ColumnVisibilityPlugin.test.d.ts +1 -0
- package/dist/Table/plugins/ExpandableRowPlugin.cjs +16 -3
- package/dist/Table/plugins/ExpandableRowPlugin.d.ts +3 -1
- package/dist/Table/plugins/ExpandableRowPlugin.js +14 -1
- package/dist/Table/plugins/FilteringPlugin.cjs +25 -0
- package/dist/Table/plugins/FilteringPlugin.d.ts +20 -0
- package/dist/Table/plugins/FilteringPlugin.js +25 -0
- package/dist/Table/plugins/FilteringPlugin.test.d.ts +1 -0
- package/dist/Table/plugins/PaginationPlugin.d.ts +1 -1
- package/dist/Table/plugins/RowNavigationPlugin.d.ts +1 -1
- package/dist/Table/plugins/RowSelectionPlugin.cjs +11 -1
- package/dist/Table/plugins/RowSelectionPlugin.d.ts +3 -1
- package/dist/Table/plugins/RowSelectionPlugin.js +11 -1
- package/dist/Table/tanStackExtendedTypes.d.ts +3 -3
- package/dist/Table/utils/plugin.utils.cjs +17 -2
- package/dist/Table/utils/plugin.utils.d.ts +5 -2
- package/dist/Table/utils/plugin.utils.js +18 -3
- package/dist/Table/utils/table.utils.cjs +13 -0
- package/dist/Table/utils/table.utils.d.ts +12 -0
- package/dist/Table/utils/table.utils.js +13 -0
- package/dist/index.cjs +2 -0
- package/dist/index.js +2 -0
- package/package.json +4 -4
|
@@ -6,11 +6,11 @@ import { useTableContext } from "./Table.context.js";
|
|
|
6
6
|
const TableContainer = _styled.div.withConfig({
|
|
7
7
|
displayName: "Tablestyle__TableContainer",
|
|
8
8
|
componentId: "RedisUI__sc-o0xfty-0"
|
|
9
|
-
})(["width:100%;border-radius:
|
|
10
|
-
const
|
|
11
|
-
displayName: "
|
|
9
|
+
})(["width:100%;border-radius:", ";box-shadow:", ";background-color:", ";overflow:hidden;display:flex;flex-direction:column;"], () => useTheme().components.table.table.tableContainer.borderRadius, () => useTheme().components.table.table.tableContainer.boxShadow, () => useTheme().components.table.table.tableContainer.backgroundColor);
|
|
10
|
+
const TableScroller = _styled.div.withConfig({
|
|
11
|
+
displayName: "Tablestyle__TableScroller",
|
|
12
12
|
componentId: "RedisUI__sc-o0xfty-1"
|
|
13
|
-
})(["width:100%;
|
|
13
|
+
})(["flex:1;width:100%;overflow:auto;", ""], () => {
|
|
14
14
|
const {
|
|
15
15
|
table
|
|
16
16
|
} = useTableContext();
|
|
@@ -18,33 +18,66 @@ const Table = _styled.table.withConfig({
|
|
|
18
18
|
overflow-x: ${table.getRowModel().rows.length ? "auto" : "hidden"};
|
|
19
19
|
`;
|
|
20
20
|
});
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
...props
|
|
24
|
-
})).withConfig({
|
|
25
|
-
displayName: "Tablestyle__TableHead",
|
|
21
|
+
const TableTopBar = _styled.div.withConfig({
|
|
22
|
+
displayName: "Tablestyle__TableTopBar",
|
|
26
23
|
componentId: "RedisUI__sc-o0xfty-2"
|
|
27
|
-
})(["
|
|
24
|
+
})(["", ""], () => {
|
|
25
|
+
const styles = useTheme().components.table.table.topBar;
|
|
26
|
+
return css`
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: ${styles.gap};
|
|
30
|
+
padding: ${styles.padding};
|
|
31
|
+
min-height: ${styles.minHeight};
|
|
32
|
+
border-bottom: ${styles.separator.width} solid ${styles.separator.color};
|
|
33
|
+
background-color: ${styles.bgColor};
|
|
34
|
+
`;
|
|
35
|
+
});
|
|
36
|
+
const TableBottomBar = _styled.div.withConfig({
|
|
37
|
+
displayName: "Tablestyle__TableBottomBar",
|
|
38
|
+
componentId: "RedisUI__sc-o0xfty-3"
|
|
39
|
+
})(["", ""], () => {
|
|
40
|
+
const styles = useTheme().components.table.table.bottomBar;
|
|
41
|
+
return css`
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
gap: ${styles.gap};
|
|
45
|
+
padding: ${styles.padding};
|
|
46
|
+
min-height: ${styles.minHeight};
|
|
47
|
+
border-top: ${styles.separator.width} solid ${styles.separator.color};
|
|
48
|
+
background-color: ${styles.bgColor};
|
|
49
|
+
`;
|
|
50
|
+
});
|
|
51
|
+
const Table = _styled.table.withConfig({
|
|
52
|
+
displayName: "Tablestyle__Table",
|
|
53
|
+
componentId: "RedisUI__sc-o0xfty-4"
|
|
54
|
+
})(["border-collapse:separate;border-spacing:0;width:100%;table-layout:fixed;min-width:", ";"], () => {
|
|
28
55
|
const {
|
|
56
|
+
table,
|
|
29
57
|
minWidth
|
|
30
58
|
} = useTableContext();
|
|
31
|
-
return
|
|
32
|
-
min-width: ${minWidth || void 0};
|
|
33
|
-
`;
|
|
59
|
+
return table.getRowModel().rows.length && minWidth || void 0;
|
|
34
60
|
});
|
|
61
|
+
const TableHead = _styled.thead.attrs((props) => ({
|
|
62
|
+
"data-role": "table-header",
|
|
63
|
+
...props
|
|
64
|
+
})).withConfig({
|
|
65
|
+
displayName: "Tablestyle__TableHead",
|
|
66
|
+
componentId: "RedisUI__sc-o0xfty-5"
|
|
67
|
+
})(["position:sticky;top:0;z-index:3;background-color:", ";"], () => useTheme().components.table.table.tableHeaderRow.bgColor);
|
|
35
68
|
const TableHeaderRow = _styled.tr.withConfig({
|
|
36
69
|
displayName: "Tablestyle__TableHeaderRow",
|
|
37
|
-
componentId: "RedisUI__sc-o0xfty-
|
|
38
|
-
})(["height:
|
|
70
|
+
componentId: "RedisUI__sc-o0xfty-6"
|
|
71
|
+
})(["height:", ";"], () => useTheme().components.table.table.tableHeaderRow.minHeight);
|
|
39
72
|
const SortableHeadingCompose = _styled.button.withConfig({
|
|
40
73
|
displayName: "Tablestyle__SortableHeadingCompose",
|
|
41
|
-
componentId: "RedisUI__sc-o0xfty-
|
|
74
|
+
componentId: "RedisUI__sc-o0xfty-7"
|
|
42
75
|
})(["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:", ";", " svg{flex:none;}"], ({
|
|
43
76
|
$custom
|
|
44
77
|
}) => $custom ? void 0 : "hidden", getFocusStyle("0.6rem"));
|
|
45
78
|
const HeaderTitleWrapper = _styled(Typography.Body).withConfig({
|
|
46
79
|
displayName: "Tablestyle__HeaderTitleWrapper",
|
|
47
|
-
componentId: "RedisUI__sc-o0xfty-
|
|
80
|
+
componentId: "RedisUI__sc-o0xfty-8"
|
|
48
81
|
})(["flex:0 1 auto;white-space:inherit;text-align:start;", ""], ({
|
|
49
82
|
$isTextual
|
|
50
83
|
}) => $isTextual ? null : css`
|
|
@@ -52,28 +85,18 @@ const HeaderTitleWrapper = _styled(Typography.Body).withConfig({
|
|
|
52
85
|
align-items: center;
|
|
53
86
|
justify-content: flex-start;
|
|
54
87
|
`);
|
|
55
|
-
const
|
|
56
|
-
displayName: "
|
|
57
|
-
componentId: "RedisUI__sc-o0xfty-
|
|
58
|
-
})(["padding:
|
|
88
|
+
const TableHeaderCell = _styled.th.withConfig({
|
|
89
|
+
displayName: "Tablestyle__TableHeaderCell",
|
|
90
|
+
componentId: "RedisUI__sc-o0xfty-9"
|
|
91
|
+
})(["padding:", ";color:", ";user-select:none;white-space:nowrap;word-break:break-word;line-height:normal;position:relative;overflow:hidden;border-bottom:", " solid ", ";&[aria-sort]{cursor:pointer;}&:not(:last-child)::after{content:'';position:absolute;inset-inline-end:0;inset-block:", ";border-right:", " solid ", ";}"], () => useTheme().components.table.table.tableHeaderCell.padding, () => useTheme().components.table.table.tableHeaderCell.color, () => useTheme().components.table.table.tableHeaderRow.separator.width, () => useTheme().components.table.table.tableHeaderRow.separator.color, () => useTheme().components.table.table.tableHeaderCell.separator.blockPadding, () => useTheme().components.table.table.tableHeaderCell.separator.width, () => useTheme().components.table.table.tableHeaderCell.separator.color);
|
|
59
92
|
const TableBody = _styled.tbody.withConfig({
|
|
60
93
|
displayName: "Tablestyle__TableBody",
|
|
61
|
-
componentId: "RedisUI__sc-o0xfty-
|
|
62
|
-
})([""
|
|
63
|
-
const {
|
|
64
|
-
maxHeight,
|
|
65
|
-
minWidth,
|
|
66
|
-
table
|
|
67
|
-
} = useTableContext();
|
|
68
|
-
return css`
|
|
69
|
-
max-height: ${maxHeight};
|
|
70
|
-
min-width: ${table.getRowModel().rows.length && minWidth || void 0};
|
|
71
|
-
`;
|
|
72
|
-
});
|
|
94
|
+
componentId: "RedisUI__sc-o0xfty-10"
|
|
95
|
+
})([""]);
|
|
73
96
|
const TableBodyRow = _styled.tr.withConfig({
|
|
74
97
|
displayName: "Tablestyle__TableBodyRow",
|
|
75
|
-
componentId: "RedisUI__sc-o0xfty-
|
|
76
|
-
})(["border-top:
|
|
98
|
+
componentId: "RedisUI__sc-o0xfty-11"
|
|
99
|
+
})(["> *{border-top:", " solid transparent;}&:not(:first-child) > *{border-top-color:", ";}height:", ";transition:box-shadow 0.2s ease-in-out;position:relative;&:hover,&:focus,&:focus-within{cursor:", ";z-index:1;box-shadow:", ";", "{opacity:1;visibility:visible;}}", ""], () => useTheme().components.table.table.tableBodyRow.separator.width, () => useTheme().components.table.table.tableBodyRow.separator.color, () => useTheme().components.table.table.tableBodyRow.minHeight, ({
|
|
77
100
|
onClick
|
|
78
101
|
}) => onClick ? "pointer" : "default", () => useTheme().components.table.table.tableBodyRow.hoverBoxShadow, ShowOnRowHover, ({
|
|
79
102
|
$stripedRows
|
|
@@ -84,11 +107,11 @@ const TableBodyRow = _styled.tr.withConfig({
|
|
|
84
107
|
`);
|
|
85
108
|
const TableBodyCell = _styled.td.withConfig({
|
|
86
109
|
displayName: "Tablestyle__TableBodyCell",
|
|
87
|
-
componentId: "RedisUI__sc-o0xfty-
|
|
88
|
-
})(["color:", ";padding:
|
|
110
|
+
componentId: "RedisUI__sc-o0xfty-12"
|
|
111
|
+
})(["color:", ";padding:", ";text-overflow:ellipsis;overflow:hidden;white-space:nowrap;"], () => useTheme().components.table.table.tableBodyCell.color, () => useTheme().components.table.table.tableBodyCell.padding);
|
|
89
112
|
const EmptyStateContainer = _styled.div.withConfig({
|
|
90
113
|
displayName: "Tablestyle__EmptyStateContainer",
|
|
91
|
-
componentId: "RedisUI__sc-o0xfty-
|
|
114
|
+
componentId: "RedisUI__sc-o0xfty-13"
|
|
92
115
|
})(["text-align:center;"]);
|
|
93
116
|
export {
|
|
94
117
|
EmptyStateContainer,
|
|
@@ -98,8 +121,11 @@ export {
|
|
|
98
121
|
TableBody,
|
|
99
122
|
TableBodyCell,
|
|
100
123
|
TableBodyRow,
|
|
124
|
+
TableBottomBar,
|
|
101
125
|
TableContainer,
|
|
102
126
|
TableHead,
|
|
127
|
+
TableHeaderCell,
|
|
103
128
|
TableHeaderRow,
|
|
104
|
-
|
|
129
|
+
TableScroller,
|
|
130
|
+
TableTopBar
|
|
105
131
|
};
|
|
@@ -1,32 +1,20 @@
|
|
|
1
|
-
import type { CellContext, ColumnDef, PaginationState, Row, SortingState } from '@tanstack/react-table';
|
|
2
1
|
import { TableExpandableRowParams } from './plugins/ExpandableRowPlugin';
|
|
3
2
|
import { TablePaginationParams } from './plugins/PaginationPlugin';
|
|
4
3
|
import { TableRowSelectionParams } from './plugins/RowSelectionPlugin';
|
|
5
4
|
import { TableSortingParams } from './plugins/SortingPlugin';
|
|
6
|
-
import {
|
|
5
|
+
import { TableFilteringParams } from './plugins/FilteringPlugin';
|
|
7
6
|
import { TableRowNavigationParams } from './plugins/RowNavigationPlugin';
|
|
7
|
+
import { OwnPluggableTableProps, RestPluggableTableProps } from './components/PluggableTable/PluggableTable';
|
|
8
|
+
import { TableColumnVisibilityParams } from './plugins/ColumnVisibilityPlugin';
|
|
8
9
|
export * from '@tanstack/react-table';
|
|
9
|
-
/** @deprecated use ColumnDef */
|
|
10
|
-
export type ColumnDefinition<T extends object> = ColumnDef<T>;
|
|
11
|
-
/** @deprecated use Row */
|
|
12
|
-
export type RowDefinition<T extends object> = Row<T>;
|
|
13
|
-
/** @deprecated use CellContext */
|
|
14
|
-
export type CellDefinition<T extends object, D> = CellContext<T, D>;
|
|
15
|
-
/** @deprecated use PaginationState */
|
|
16
|
-
export type PaginationTypes = PaginationState;
|
|
17
|
-
/** @deprecated use SortingState */
|
|
18
|
-
export type SortingTypes = SortingState;
|
|
19
10
|
type TableExpandableRowProps<T extends object> = Omit<TableExpandableRowParams<T>, 'getRowCanExpand'> & {
|
|
20
11
|
getIsRowExpandable?: (rowData: T) => boolean;
|
|
21
12
|
};
|
|
22
|
-
export interface TableProps<T extends object> extends TableSortingParams, TableExpandableRowProps<T>, TablePaginationParams, TableRowSelectionParams<T>, TableRowNavigationParams {
|
|
23
|
-
data: T[];
|
|
24
|
-
columns: ColumnDef<T>[];
|
|
13
|
+
export interface TableProps<T extends object> extends TableSortingParams, TableColumnVisibilityParams, TableFilteringParams<T>, TableExpandableRowProps<T>, TablePaginationParams, TableRowSelectionParams<T>, TableRowNavigationParams, Omit<OwnPluggableTableProps<T>, 'tableOptions' | 'pluginsData' | 'emptyStateRender' | 'components'>, RestPluggableTableProps {
|
|
25
14
|
getRowId?: (rowData: T, index: number) => string;
|
|
26
15
|
onRowClick?: (rowData: T) => void;
|
|
27
|
-
emptyState?:
|
|
28
|
-
maxHeight?: string;
|
|
29
|
-
minWidth?: string;
|
|
30
|
-
stripedRows?: boolean;
|
|
31
|
-
caption?: string;
|
|
16
|
+
emptyState?: OwnPluggableTableProps<T>['emptyStateRender'];
|
|
32
17
|
}
|
|
18
|
+
export type ColumnSizeUnit = 'fraction' | 'px' | 'rem';
|
|
19
|
+
/** @deprecated use {@link ColumnSizeUnit} instead */
|
|
20
|
+
export type CellSizingUnits = ColumnSizeUnit;
|
|
@@ -12,19 +12,17 @@ const TableCompose = ({
|
|
|
12
12
|
pluginsData,
|
|
13
13
|
tableOptions,
|
|
14
14
|
components,
|
|
15
|
-
maxHeight,
|
|
16
15
|
minWidth,
|
|
17
16
|
stripedRows,
|
|
18
17
|
...restProps
|
|
19
18
|
}) => {
|
|
20
|
-
const mergedPluginsData = plugin_utils.mergePluginsData(pluginsData);
|
|
19
|
+
const mergedPluginsData = plugin_utils.mergePluginsData(pluginsData, tableOptions);
|
|
21
20
|
const table = index.useReactTable({
|
|
22
21
|
data,
|
|
23
|
-
columns,
|
|
22
|
+
columns: plugin_utils.normalizeColumns(columns),
|
|
24
23
|
getCoreRowModel: index$1.getCoreRowModel(),
|
|
25
24
|
enableSorting: false,
|
|
26
25
|
enableColumnResizing: false,
|
|
27
|
-
...tableOptions,
|
|
28
26
|
...mergedPluginsData == null ? void 0 : mergedPluginsData.tableOptions
|
|
29
27
|
});
|
|
30
28
|
const tableContext = {
|
|
@@ -32,13 +30,13 @@ const TableCompose = ({
|
|
|
32
30
|
plugins: mergedPluginsData.context,
|
|
33
31
|
components,
|
|
34
32
|
stripedRows,
|
|
35
|
-
maxHeight,
|
|
36
33
|
minWidth
|
|
37
34
|
};
|
|
38
35
|
return jsxRuntime.jsxRuntimeExports.jsx(Table_context.TableContextProvider, {
|
|
39
36
|
value: tableContext,
|
|
40
37
|
children: jsxRuntime.jsxRuntimeExports.jsx(Table_style.TableContainer, {
|
|
41
|
-
...restProps
|
|
38
|
+
...restProps,
|
|
39
|
+
"data-role": "table-container"
|
|
42
40
|
})
|
|
43
41
|
});
|
|
44
42
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { TablePluginData } from '../../utils/plugin.utils';
|
|
1
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
2
|
+
import { ComposeElementProps, NoInfer } from '@redislabsdev/redis-ui-components';
|
|
3
|
+
import { TablePluginData, UserTableOptions } from '../../utils/plugin.utils';
|
|
5
4
|
import { CompositionContextProps, TableMainContextProps } from '../../Table.context';
|
|
6
|
-
export type OwnTableComposeProps<T extends object> = TableMainContextProps &
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
export type OwnTableComposeProps<T extends object> = TableMainContextProps & {
|
|
6
|
+
data: T[];
|
|
7
|
+
columns: ColumnDef<NoInfer<T>, any>[];
|
|
8
|
+
tableOptions?: UserTableOptions<T>;
|
|
9
|
+
pluginsData?: TablePluginData<NoInfer<T>>[];
|
|
10
|
+
components?: Partial<CompositionContextProps<any>>;
|
|
10
11
|
};
|
|
11
12
|
export type RestTableComposeProps = ComposeElementProps;
|
|
12
13
|
export type TableComposeProps<T extends object> = OwnTableComposeProps<T> & RestTableComposeProps;
|
|
13
|
-
export declare const TableCompose: <T extends object>({ data, columns, pluginsData, tableOptions, components,
|
|
14
|
+
export declare const TableCompose: <T extends object>({ data, columns, pluginsData, tableOptions, components, minWidth, stripedRows, ...restProps }: TableComposeProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
2
|
import { useReactTable } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
3
|
-
import { mergePluginsData } from "../../utils/plugin.utils.js";
|
|
3
|
+
import { mergePluginsData, normalizeColumns } from "../../utils/plugin.utils.js";
|
|
4
4
|
import { TableContextProvider } from "../../Table.context.js";
|
|
5
5
|
import { TableContainer } from "../../Table.style.js";
|
|
6
6
|
import { getCoreRowModel } from "../../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
@@ -10,19 +10,17 @@ const TableCompose = ({
|
|
|
10
10
|
pluginsData,
|
|
11
11
|
tableOptions,
|
|
12
12
|
components,
|
|
13
|
-
maxHeight,
|
|
14
13
|
minWidth,
|
|
15
14
|
stripedRows,
|
|
16
15
|
...restProps
|
|
17
16
|
}) => {
|
|
18
|
-
const mergedPluginsData = mergePluginsData(pluginsData);
|
|
17
|
+
const mergedPluginsData = mergePluginsData(pluginsData, tableOptions);
|
|
19
18
|
const table = useReactTable({
|
|
20
19
|
data,
|
|
21
|
-
columns,
|
|
20
|
+
columns: normalizeColumns(columns),
|
|
22
21
|
getCoreRowModel: getCoreRowModel(),
|
|
23
22
|
enableSorting: false,
|
|
24
23
|
enableColumnResizing: false,
|
|
25
|
-
...tableOptions,
|
|
26
24
|
...mergedPluginsData == null ? void 0 : mergedPluginsData.tableOptions
|
|
27
25
|
});
|
|
28
26
|
const tableContext = {
|
|
@@ -30,13 +28,13 @@ const TableCompose = ({
|
|
|
30
28
|
plugins: mergedPluginsData.context,
|
|
31
29
|
components,
|
|
32
30
|
stripedRows,
|
|
33
|
-
maxHeight,
|
|
34
31
|
minWidth
|
|
35
32
|
};
|
|
36
33
|
return jsxRuntimeExports.jsx(TableContextProvider, {
|
|
37
34
|
value: tableContext,
|
|
38
35
|
children: jsxRuntimeExports.jsx(TableContainer, {
|
|
39
|
-
...restProps
|
|
36
|
+
...restProps,
|
|
37
|
+
"data-role": "table-container"
|
|
40
38
|
})
|
|
41
39
|
});
|
|
42
40
|
};
|
|
@@ -5,15 +5,21 @@ const compositionComponents = require("./compositionComponents.cjs");
|
|
|
5
5
|
const PluggableTable = ({
|
|
6
6
|
caption,
|
|
7
7
|
emptyStateRender,
|
|
8
|
+
topBar,
|
|
9
|
+
bottomBar,
|
|
8
10
|
...restProps
|
|
9
11
|
}) => jsxRuntime.jsxRuntimeExports.jsxs(compositionComponents.compositionComponents.Compose, {
|
|
10
12
|
...restProps,
|
|
11
|
-
children: [jsxRuntime.jsxRuntimeExports.
|
|
13
|
+
children: [jsxRuntime.jsxRuntimeExports.jsx(compositionComponents.compositionComponents.TopBar, {
|
|
14
|
+
children: topBar
|
|
15
|
+
}), jsxRuntime.jsxRuntimeExports.jsxs(compositionComponents.compositionComponents.Root, {
|
|
12
16
|
children: [jsxRuntime.jsxRuntimeExports.jsx(compositionComponents.compositionComponents.SRCaption, {
|
|
13
17
|
caption
|
|
14
18
|
}), jsxRuntime.jsxRuntimeExports.jsx(compositionComponents.compositionComponents.Header, {}), jsxRuntime.jsxRuntimeExports.jsx(compositionComponents.compositionComponents.EmptyState, {
|
|
15
19
|
emptyStateRender
|
|
16
20
|
}), jsxRuntime.jsxRuntimeExports.jsx(compositionComponents.compositionComponents.Body, {})]
|
|
21
|
+
}), jsxRuntime.jsxRuntimeExports.jsx(compositionComponents.compositionComponents.BottomBar, {
|
|
22
|
+
children: bottomBar
|
|
17
23
|
}), jsxRuntime.jsxRuntimeExports.jsx(compositionComponents.compositionComponents.Pagination, {}), jsxRuntime.jsxRuntimeExports.jsx(compositionComponents.compositionComponents.SRSortingNotification, {})]
|
|
18
24
|
});
|
|
19
25
|
exports.PluggableTable = PluggableTable;
|
|
@@ -4,7 +4,9 @@ import { OwnTableComposeProps, RestTableComposeProps } from '../Compose/Compose'
|
|
|
4
4
|
export type OwnPluggableTableProps<T extends object> = OwnTableComposeProps<T> & {
|
|
5
5
|
caption?: string;
|
|
6
6
|
emptyStateRender?: (() => ReactNode) | string;
|
|
7
|
+
topBar?: ReactNode;
|
|
8
|
+
bottomBar?: ReactNode;
|
|
7
9
|
};
|
|
8
10
|
export type RestPluggableTableProps = ChildFree<RestTableComposeProps>;
|
|
9
11
|
export type PluggableTableProps<T extends object> = OwnPluggableTableProps<T> & RestPluggableTableProps;
|
|
10
|
-
export declare const PluggableTable: <T extends object>({ caption, emptyStateRender, ...restProps }: PluggableTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const PluggableTable: <T extends object>({ caption, emptyStateRender, topBar, bottomBar, ...restProps }: PluggableTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,15 +3,21 @@ import { compositionComponents } from "./compositionComponents.js";
|
|
|
3
3
|
const PluggableTable = ({
|
|
4
4
|
caption,
|
|
5
5
|
emptyStateRender,
|
|
6
|
+
topBar,
|
|
7
|
+
bottomBar,
|
|
6
8
|
...restProps
|
|
7
9
|
}) => jsxRuntimeExports.jsxs(compositionComponents.Compose, {
|
|
8
10
|
...restProps,
|
|
9
|
-
children: [jsxRuntimeExports.
|
|
11
|
+
children: [jsxRuntimeExports.jsx(compositionComponents.TopBar, {
|
|
12
|
+
children: topBar
|
|
13
|
+
}), jsxRuntimeExports.jsxs(compositionComponents.Root, {
|
|
10
14
|
children: [jsxRuntimeExports.jsx(compositionComponents.SRCaption, {
|
|
11
15
|
caption
|
|
12
16
|
}), jsxRuntimeExports.jsx(compositionComponents.Header, {}), jsxRuntimeExports.jsx(compositionComponents.EmptyState, {
|
|
13
17
|
emptyStateRender
|
|
14
18
|
}), jsxRuntimeExports.jsx(compositionComponents.Body, {})]
|
|
19
|
+
}), jsxRuntimeExports.jsx(compositionComponents.BottomBar, {
|
|
20
|
+
children: bottomBar
|
|
15
21
|
}), jsxRuntimeExports.jsx(compositionComponents.Pagination, {}), jsxRuntimeExports.jsx(compositionComponents.SRSortingNotification, {})]
|
|
16
22
|
});
|
|
17
23
|
export {
|
|
@@ -8,8 +8,12 @@ const EmptyState = require("../EmptyState/EmptyState.cjs");
|
|
|
8
8
|
const TableBody = require("../TableBody/TableBody.cjs");
|
|
9
9
|
const TablePagination = require("../TablePagination/TablePagination.cjs");
|
|
10
10
|
const SRSortingNotification = require("../TableHeaderCell/SRSortingNotification.cjs");
|
|
11
|
+
const TableTopBar = require("../TableTopBar/TableTopBar.cjs");
|
|
12
|
+
const TableBottomBar = require("../TableBottomBar/TableBottomBar.cjs");
|
|
11
13
|
const compositionComponents = {
|
|
12
14
|
Compose: Compose.TableCompose,
|
|
15
|
+
TopBar: TableTopBar.TableTopBar,
|
|
16
|
+
BottomBar: TableBottomBar.TableBottomBar,
|
|
13
17
|
Root: TableRoot.TableRoot,
|
|
14
18
|
SRCaption: HiddenCaption.HiddenCaption,
|
|
15
19
|
Header: TableHeader.TableHeader,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SRSortingNotification } from '../TableHeaderCell/SRSortingNotification';
|
|
3
3
|
export declare const compositionComponents: {
|
|
4
|
-
Compose: <T extends object>({ data, columns, pluginsData, tableOptions, components,
|
|
4
|
+
Compose: <T extends object>({ data, columns, pluginsData, tableOptions, components, minWidth, stripedRows, ...restProps }: import("../Compose/Compose").TableComposeProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
TopBar: (props: import("@redislabsdev/redis-ui-components").ComposeElementProps<HTMLElement>) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
BottomBar: (props: import("@redislabsdev/redis-ui-components").ComposeElementProps<HTMLElement>) => import("react/jsx-runtime").JSX.Element | null;
|
|
5
7
|
Root: (props: import("react").HTMLAttributes<HTMLTableElement>) => import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
SRCaption: ({ caption }: {
|
|
7
9
|
caption?: string | undefined;
|
|
@@ -12,7 +14,7 @@ export declare const compositionComponents: {
|
|
|
12
14
|
Compose: import("styled-components").StyledComponent<"tr", any, {}, never>;
|
|
13
15
|
};
|
|
14
16
|
Cell: (<T_3 extends object>(props: import("../TableHeaderCell/TableHeaderCell").OwnTableHeaderCellProps<T_3> & import("../TableHeaderCell/TableHeaderCell").RestTableHeaderCellProps & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null) & {
|
|
15
|
-
Compose: <T_4 extends object>(props: import("../TableHeaderCell/components/Compose/Compose").OwnTableHeaderCellComposeProps<T_4> & import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "
|
|
17
|
+
Compose: <T_4 extends object>(props: import("../TableHeaderCell/components/Compose/Compose").OwnTableHeaderCellComposeProps<T_4> & import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "children" | "content"> & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null;
|
|
16
18
|
SortableHeading: (({ children, ...restProps }: import("@redislabsdev/redis-ui-components").ComposeElementProps<HTMLElement>) => import("react/jsx-runtime").JSX.Element) & {
|
|
17
19
|
Compose: ((props: import("@redislabsdev/redis-ui-components").ComposeElementProps<HTMLElement>) => import("react/jsx-runtime").JSX.Element) & {
|
|
18
20
|
SortIndicator: () => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -26,7 +28,7 @@ export declare const compositionComponents: {
|
|
|
26
28
|
Body: (<T_5 extends object>(props: import("../TableBody/TableBody").RestTableBodyProps) => import("react/jsx-runtime").JSX.Element | null) & {
|
|
27
29
|
Compose: (props: import("../TableBody/components/Compose/Compose").TableBodyComposeProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
30
|
Row: (<T_6 extends object>(props: import("../TableBodyRow/TableBodyRow").OwnTableBodyRowProps<T_6> & import("../TableBodyRow/TableBodyRow").RestTableBodyRowProps & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null) & {
|
|
29
|
-
Compose: (props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableRowElement>, "
|
|
31
|
+
Compose: (props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableRowElement>, "children" | "content"> & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null;
|
|
30
32
|
useHandleClickableRow: <T_7 extends object>({ row, onClick, onKeyDown }: {
|
|
31
33
|
row: import("@tanstack/table-core").Row<T_7>;
|
|
32
34
|
onClick?: import("react").MouseEventHandler<HTMLTableRowElement> | undefined;
|
|
@@ -38,7 +40,7 @@ export declare const compositionComponents: {
|
|
|
38
40
|
};
|
|
39
41
|
ExpandableRow: <T_8 extends object>(props: import("../TableBodyRow/TableBodyRow").OwnTableBodyRowProps<T_8> & import("../TableBodyRow/TableBodyRow").RestTableBodyRowProps & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null;
|
|
40
42
|
Cell: (<T_9 extends object>(props: import("../TableBodyCell/TableBodyCell").OwnTableBodyCellProps<T_9> & import("../TableBodyCell/TableBodyCell").RestTableBodyCellProps & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null) & {
|
|
41
|
-
Compose: <T_10 extends object>(props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "
|
|
43
|
+
Compose: <T_10 extends object>(props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "children" | "content"> & import("../TableBodyCell/components/Compose/Compose").OwnTableBodyCellComposeProps<T_10> & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null;
|
|
42
44
|
};
|
|
43
45
|
};
|
|
44
46
|
Pagination: (() => import("react/jsx-runtime").JSX.Element | null) & {
|
|
@@ -52,11 +54,11 @@ export declare const compositionComponents: {
|
|
|
52
54
|
InfoLabel: import("styled-components").StyledComponent<({ renderer, ...restProps }: import("@redislabsdev/redis-ui-components").PaginationInfoLabelProps) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
|
|
53
55
|
PageSelect: import("styled-components").StyledComponent<{
|
|
54
56
|
({ ...restProps }: import("@redislabsdev/redis-ui-components").PaginationPageSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
-
Label: ({ children, ...restProps }: import("@redislabsdev/redis-ui-components").TypographyBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
Label: ({ children, ...restProps }: import("@redislabsdev/redis-ui-components").TypographyBodyProps & import("react").RefAttributes<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
|
|
56
58
|
}, any, {}, never>;
|
|
57
59
|
PageSizeSelect: import("styled-components").StyledComponent<{
|
|
58
60
|
({ pageSizes, ...restProps }: import("@redislabsdev/redis-ui-components").PaginationPageSizeSelectProps): import("react/jsx-runtime").JSX.Element | null;
|
|
59
|
-
Label: ({ children, ...restProps }: import("@redislabsdev/redis-ui-components").TypographyBodyProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
61
|
+
Label: ({ children, ...restProps }: import("@redislabsdev/redis-ui-components").TypographyBodyProps & import("react").RefAttributes<HTMLElement>) => import("react/jsx-runtime").JSX.Element | null;
|
|
60
62
|
}, any, {}, never>;
|
|
61
63
|
NavigationButton: import("styled-components").StyledComponent<({ navType, ...restProps }: import("@redislabsdev/redis-ui-components").PaginationNavigationButtonProps) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
|
|
62
64
|
PageSizeGroup: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -6,8 +6,12 @@ import { EmptyState } from "../EmptyState/EmptyState.js";
|
|
|
6
6
|
import { TableBody } from "../TableBody/TableBody.js";
|
|
7
7
|
import TablePagination from "../TablePagination/TablePagination.js";
|
|
8
8
|
import { SRSortingNotification } from "../TableHeaderCell/SRSortingNotification.js";
|
|
9
|
+
import { TableTopBar } from "../TableTopBar/TableTopBar.js";
|
|
10
|
+
import { TableBottomBar } from "../TableBottomBar/TableBottomBar.js";
|
|
9
11
|
const compositionComponents = {
|
|
10
12
|
Compose: TableCompose,
|
|
13
|
+
TopBar: TableTopBar,
|
|
14
|
+
BottomBar: TableBottomBar,
|
|
11
15
|
Root: TableRoot,
|
|
12
16
|
SRCaption: HiddenCaption,
|
|
13
17
|
Header: TableHeader,
|
|
@@ -11,7 +11,6 @@ const useRowSelectionColumn = ({
|
|
|
11
11
|
} = {}) => ({
|
|
12
12
|
id: "row-selection",
|
|
13
13
|
size: 4.2,
|
|
14
|
-
minSize: 4.2,
|
|
15
14
|
sizeUnit: "rem",
|
|
16
15
|
header: (props) => !disableSelectAll && props.table.options.enableMultiRowSelection ? jsxRuntime.jsxRuntimeExports.jsx(HeaderMultiRowSelectionButton.HeaderMultiRowSelectionButton, {
|
|
17
16
|
...props,
|
|
@@ -9,7 +9,6 @@ const useRowSelectionColumn = ({
|
|
|
9
9
|
} = {}) => ({
|
|
10
10
|
id: "row-selection",
|
|
11
11
|
size: 4.2,
|
|
12
|
-
minSize: 4.2,
|
|
13
12
|
sizeUnit: "rem",
|
|
14
13
|
header: (props) => !disableSelectAll && props.table.options.enableMultiRowSelection ? jsxRuntimeExports.jsx(HeaderMultiRowSelectionButton, {
|
|
15
14
|
...props,
|
|
@@ -6,7 +6,7 @@ export type TableBodyProps = RestTableBodyProps;
|
|
|
6
6
|
export declare const TableBody: (<T extends object>(props: TableBodyProps) => import("react/jsx-runtime").JSX.Element | null) & {
|
|
7
7
|
Compose: (props: TableBodyComposeProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
Row: (<T_1 extends object>(props: import("../TableBodyRow/TableBodyRow").OwnTableBodyRowProps<T_1> & import("../TableBodyRow/TableBodyRow").RestTableBodyRowProps & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null) & {
|
|
9
|
-
Compose: (props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableRowElement>, "
|
|
9
|
+
Compose: (props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableRowElement>, "children" | "content"> & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null;
|
|
10
10
|
useHandleClickableRow: <T_2 extends object>({ row, onClick, onKeyDown }: {
|
|
11
11
|
row: import("@tanstack/table-core").Row<T_2>;
|
|
12
12
|
onClick?: import("react").MouseEventHandler<HTMLTableRowElement> | undefined;
|
|
@@ -18,6 +18,6 @@ export declare const TableBody: (<T extends object>(props: TableBodyProps) => im
|
|
|
18
18
|
};
|
|
19
19
|
ExpandableRow: <T_3 extends object>(props: import("../TableBodyRow/TableBodyRow").OwnTableBodyRowProps<T_3> & import("../TableBodyRow/TableBodyRow").RestTableBodyRowProps & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null;
|
|
20
20
|
Cell: (<T_4 extends object>(props: import("../TableBodyCell/TableBodyCell").OwnTableBodyCellProps<T_4> & import("../TableBodyCell/TableBodyCell").RestTableBodyCellProps & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null) & {
|
|
21
|
-
Compose: <T_5 extends object>(props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "
|
|
21
|
+
Compose: <T_5 extends object>(props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "children" | "content"> & import("../TableBodyCell/components/Compose/Compose").OwnTableBodyCellComposeProps<T_5> & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
@@ -5,5 +5,5 @@ export type OwnTableBodyCellProps<T extends object> = OwnTableBodyCellComposePro
|
|
|
5
5
|
export type RestTableBodyCellProps = ChildFree<RestTableBodyCellComposeProps>;
|
|
6
6
|
export type TableBodyCellProps<T extends object> = OwnTableBodyCellProps<T> & RestTableBodyCellProps;
|
|
7
7
|
export declare const TableBodyCell: (<T extends object>(props: OwnTableBodyCellProps<T> & RestTableBodyCellProps & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null) & {
|
|
8
|
-
Compose: <T_1 extends object>(props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "
|
|
8
|
+
Compose: <T_1 extends object>(props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "children" | "content"> & OwnTableBodyCellComposeProps<T_1> & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null;
|
|
9
9
|
};
|
|
@@ -6,4 +6,4 @@ export type OwnTableBodyCellComposeProps<T extends object> = {
|
|
|
6
6
|
};
|
|
7
7
|
export type RestTableBodyCellComposeProps = ComposeElementProps<HTMLTableCellElement>;
|
|
8
8
|
export type TableBodyCellComposeProps<T extends object> = RestTableBodyCellComposeProps & OwnTableBodyCellComposeProps<T>;
|
|
9
|
-
export declare const TableBodyCellCompose: <T extends object>(props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "
|
|
9
|
+
export declare const TableBodyCellCompose: <T extends object>(props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "children" | "content"> & OwnTableBodyCellComposeProps<T> & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null;
|
|
@@ -8,7 +8,7 @@ export type OwnTableBodyRowProps<T extends object> = {
|
|
|
8
8
|
export type RestTableBodyRowProps = ChildFree<RestTableBodyRowComposeProps>;
|
|
9
9
|
export type TableBodyRowProps<T extends object> = OwnTableBodyRowProps<T> & RestTableBodyRowProps;
|
|
10
10
|
export declare const TableBodyRow: (<T extends object>(props: OwnTableBodyRowProps<T> & RestTableBodyRowProps & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null) & {
|
|
11
|
-
Compose: (props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableRowElement>, "
|
|
11
|
+
Compose: (props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableRowElement>, "children" | "content"> & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null;
|
|
12
12
|
useHandleClickableRow: <T_1 extends object>({ row, onClick, onKeyDown }: {
|
|
13
13
|
row: Row<T_1>;
|
|
14
14
|
onClick?: import("react").MouseEventHandler<HTMLTableRowElement> | undefined;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
import { ComposeElementProps } from '@redislabsdev/redis-ui-components';
|
|
3
3
|
export type RestTableBodyRowComposeProps = ComposeElementProps<HTMLTableRowElement>;
|
|
4
4
|
export type TableBodyRowComposeProps = RestTableBodyRowComposeProps;
|
|
5
|
-
export declare const TableBodyRowCompose: (props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableRowElement>, "
|
|
5
|
+
export declare const TableBodyRowCompose: (props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableRowElement>, "children" | "content"> & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const Table_style = require("../../Table.style.cjs");
|
|
6
|
+
const TableBottomBar = (props) => (
|
|
7
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
8
|
+
React.Children.toArray(props.children).filter((ch) => ch !== "").length ? jsxRuntime.jsxRuntimeExports.jsx(Table_style.TableBottomBar, {
|
|
9
|
+
...props
|
|
10
|
+
}) : null
|
|
11
|
+
);
|
|
12
|
+
exports.TableBottomBar = TableBottomBar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { Children } from "react";
|
|
3
|
+
import { TableBottomBar as TableBottomBar$1 } from "../../Table.style.js";
|
|
4
|
+
const TableBottomBar = (props) => (
|
|
5
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
6
|
+
Children.toArray(props.children).filter((ch) => ch !== "").length ? jsxRuntimeExports.jsx(TableBottomBar$1, {
|
|
7
|
+
...props
|
|
8
|
+
}) : null
|
|
9
|
+
);
|
|
10
|
+
export {
|
|
11
|
+
TableBottomBar
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,6 +6,7 @@ const index = require("../../../node_modules/@radix-ui/react-compose-refs/dist/i
|
|
|
6
6
|
const TableAnimatedExpandedRow_style = require("./TableAnimatedExpandedRow.style.cjs");
|
|
7
7
|
const TableAnimatedExpandedRow = ({
|
|
8
8
|
rowRef,
|
|
9
|
+
contentWrapper = (content) => content,
|
|
9
10
|
...restProps
|
|
10
11
|
}) => {
|
|
11
12
|
const innerRowRef = React.useRef(null);
|
|
@@ -24,10 +25,16 @@ const TableAnimatedExpandedRow = ({
|
|
|
24
25
|
}
|
|
25
26
|
return void 0;
|
|
26
27
|
}, [isExpanded]);
|
|
28
|
+
const wrapContentForAnimation = (content) => jsxRuntime.jsxRuntimeExports.jsx(TableAnimatedExpandedRow_style.AnimatedContainer, {
|
|
29
|
+
children: jsxRuntime.jsxRuntimeExports.jsx(TableAnimatedExpandedRow_style.AnimatedContent, {
|
|
30
|
+
children: contentWrapper(content)
|
|
31
|
+
})
|
|
32
|
+
});
|
|
27
33
|
return jsxRuntime.jsxRuntimeExports.jsx(TableAnimatedExpandedRow_style.AnimatedExpandedRow, {
|
|
28
34
|
rowRef: composedRowRef,
|
|
29
35
|
...restProps,
|
|
30
|
-
keepInDom: true
|
|
36
|
+
keepInDom: true,
|
|
37
|
+
contentWrapper: wrapContentForAnimation
|
|
31
38
|
});
|
|
32
39
|
};
|
|
33
40
|
exports.TableAnimatedExpandedRow = TableAnimatedExpandedRow;
|