@redis-ui/table 2.12.0 → 2.22.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 +95 -146
- package/dist/Table/Table.context.cjs +16 -1
- package/dist/Table/Table.context.d.ts +23 -4
- package/dist/Table/Table.context.js +16 -1
- package/dist/Table/Table.d.ts +88 -5
- package/dist/Table/Table.js +95 -146
- package/dist/Table/Table.style.cjs +43 -13
- package/dist/Table/Table.style.d.ts +6 -6
- package/dist/Table/Table.style.js +43 -13
- package/dist/Table/Table.types.d.ts +22 -38
- package/dist/Table/components/Compose/Compose.cjs +45 -0
- package/dist/Table/components/Compose/Compose.d.ts +13 -0
- package/dist/Table/components/Compose/Compose.js +45 -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/ExpandRowButton/ExpandAllRowsButton.cjs +20 -0
- package/dist/Table/components/ExpandRowButton/ExpandAllRowsButton.d.ts +8 -0
- package/dist/Table/components/ExpandRowButton/ExpandAllRowsButton.js +20 -0
- package/dist/Table/components/ExpandRowButton/ExpandAllRowsButton.test.d.ts +1 -0
- package/dist/Table/components/ExpandRowButton/useExpanderColumn.cjs +19 -0
- package/dist/Table/components/ExpandRowButton/useExpanderColumn.d.ts +6 -0
- package/dist/Table/components/ExpandRowButton/useExpanderColumn.js +19 -0
- package/dist/Table/components/ExpandRowButton/useExpanderColumn.test.d.ts +1 -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/RowSelection/HeaderMultiRowSelectionButton.cjs +1 -0
- package/dist/Table/components/RowSelection/HeaderMultiRowSelectionButton.d.ts +1 -1
- package/dist/Table/components/RowSelection/HeaderMultiRowSelectionButton.js +1 -0
- package/dist/Table/components/RowSelection/useRowSelectionColumn.cjs +26 -0
- package/dist/Table/components/RowSelection/useRowSelectionColumn.d.ts +8 -0
- package/dist/Table/components/RowSelection/useRowSelectionColumn.js +26 -0
- package/dist/Table/components/RowSelection/useRowSelectionColumn.test.d.ts +1 -0
- package/dist/Table/components/ShowOnRowHover/ShowOnRowHover.style.cjs +3 -1
- package/dist/Table/components/ShowOnRowHover/ShowOnRowHover.style.js +3 -1
- 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 +8 -0
- package/dist/Table/components/TableBody/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TableBody/components/Compose/Compose.js +8 -0
- package/dist/Table/components/TableBodyCell/TableBodyCell.cjs +18 -0
- package/dist/Table/components/TableBodyCell/TableBodyCell.d.ts +9 -0
- package/dist/Table/components/TableBodyCell/TableBodyCell.js +18 -0
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.cjs +25 -0
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.d.ts +9 -0
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.js +25 -0
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.test.d.ts +1 -0
- package/dist/Table/components/TableBodyRow/TableBodyRow.cjs +48 -0
- package/dist/Table/components/TableBodyRow/TableBodyRow.d.ts +20 -0
- package/dist/Table/components/TableBodyRow/TableBodyRow.js +48 -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 +5 -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 +18 -0
- package/dist/Table/components/TableHeaderCell/SRSortingNotification.d.ts +1 -0
- package/dist/Table/components/TableHeaderCell/SRSortingNotification.js +18 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.cjs +15 -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 +15 -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 +48 -0
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.d.ts +9 -0
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.js +48 -0
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.test.d.ts +1 -0
- package/dist/Table/components/TableHeaderCell/components/Heading/Heading.cjs +35 -0
- package/dist/Table/components/TableHeaderCell/components/Heading/Heading.d.ts +5 -0
- package/dist/Table/components/TableHeaderCell/components/Heading/Heading.js +35 -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 +24 -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 +24 -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 +13 -0
- package/dist/Table/components/TableRoot/TableRoot.d.ts +2 -0
- package/dist/Table/components/TableRoot/TableRoot.js +13 -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 +44 -0
- package/dist/Table/plugins/ExpandableRowPlugin.d.ts +28 -0
- package/dist/Table/plugins/ExpandableRowPlugin.js +44 -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/RowNavigationPlugin.cjs +139 -0
- package/dist/Table/plugins/RowNavigationPlugin.d.ts +44 -0
- package/dist/Table/plugins/RowNavigationPlugin.js +139 -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 +20 -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/Table/utils/table.utils.cjs +13 -0
- package/dist/Table/utils/table.utils.d.ts +2 -0
- package/dist/Table/utils/table.utils.js +13 -0
- package/dist/Table/utils/table.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
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
minWidth,
|
|
15
|
+
stripedRows,
|
|
16
|
+
...restProps
|
|
17
|
+
}) => {
|
|
18
|
+
const mergedPluginsData = mergePluginsData(pluginsData);
|
|
19
|
+
const table = useReactTable({
|
|
20
|
+
data,
|
|
21
|
+
columns,
|
|
22
|
+
getCoreRowModel: getCoreRowModel(),
|
|
23
|
+
enableSorting: false,
|
|
24
|
+
enableColumnResizing: 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
|
+
minWidth
|
|
35
|
+
};
|
|
36
|
+
return jsxRuntimeExports.jsx(TableContextProvider, {
|
|
37
|
+
value: tableContext,
|
|
38
|
+
children: jsxRuntimeExports.jsx(TableContainer, {
|
|
39
|
+
...restProps
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
TableCompose
|
|
45
|
+
};
|
|
@@ -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,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
|
|
4
|
+
const redisUiComponents = require("@redislabsdev/redis-ui-components");
|
|
5
|
+
const redisUiIcons = require("@redislabsdev/redis-ui-icons");
|
|
6
|
+
const ExpandAllRowsButton = ({
|
|
7
|
+
table,
|
|
8
|
+
expandedIcon,
|
|
9
|
+
collapsedIcon,
|
|
10
|
+
...restProps
|
|
11
|
+
}) => table.getCanSomeRowsExpand() ? jsxRuntime.jsxRuntimeExports.jsx(redisUiComponents.IconButton, {
|
|
12
|
+
...restProps,
|
|
13
|
+
icon: table.getIsAllRowsExpanded() ? expandedIcon ?? redisUiIcons.DoubleChevronUpIcon : collapsedIcon ?? redisUiIcons.DoubleChevronDownIcon,
|
|
14
|
+
"aria-label": table.getIsAllRowsExpanded() ? "Collapse All" : "Expand All",
|
|
15
|
+
onClick: (e) => {
|
|
16
|
+
e.stopPropagation();
|
|
17
|
+
table.toggleAllRowsExpanded();
|
|
18
|
+
}
|
|
19
|
+
}) : null;
|
|
20
|
+
exports.ExpandAllRowsButton = ExpandAllRowsButton;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IconButtonProps } from '@redislabsdev/redis-ui-components';
|
|
2
|
+
import { Table } from '@tanstack/react-table';
|
|
3
|
+
export interface ExpandAllRowsButtonProps extends Omit<IconButtonProps, 'icon' | 'onClick'> {
|
|
4
|
+
table: Table<any>;
|
|
5
|
+
expandedIcon?: IconButtonProps['icon'];
|
|
6
|
+
collapsedIcon?: IconButtonProps['icon'];
|
|
7
|
+
}
|
|
8
|
+
export declare const ExpandAllRowsButton: ({ table, expandedIcon, collapsedIcon, ...restProps }: ExpandAllRowsButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { IconButton } from "@redislabsdev/redis-ui-components";
|
|
3
|
+
import { DoubleChevronUpIcon, DoubleChevronDownIcon } from "@redislabsdev/redis-ui-icons";
|
|
4
|
+
const ExpandAllRowsButton = ({
|
|
5
|
+
table,
|
|
6
|
+
expandedIcon,
|
|
7
|
+
collapsedIcon,
|
|
8
|
+
...restProps
|
|
9
|
+
}) => table.getCanSomeRowsExpand() ? jsxRuntimeExports.jsx(IconButton, {
|
|
10
|
+
...restProps,
|
|
11
|
+
icon: table.getIsAllRowsExpanded() ? expandedIcon ?? DoubleChevronUpIcon : collapsedIcon ?? DoubleChevronDownIcon,
|
|
12
|
+
"aria-label": table.getIsAllRowsExpanded() ? "Collapse All" : "Expand All",
|
|
13
|
+
onClick: (e) => {
|
|
14
|
+
e.stopPropagation();
|
|
15
|
+
table.toggleAllRowsExpanded();
|
|
16
|
+
}
|
|
17
|
+
}) : null;
|
|
18
|
+
export {
|
|
19
|
+
ExpandAllRowsButton
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const ExpandAllRowsButton = require("./ExpandAllRowsButton.cjs");
|
|
4
|
+
const ExpandRowButton = require("./ExpandRowButton.cjs");
|
|
5
|
+
const useExpanderColumn = ({
|
|
6
|
+
allowExpandAll,
|
|
7
|
+
...colDef
|
|
8
|
+
} = {}) => ({
|
|
9
|
+
id: "expander",
|
|
10
|
+
size: 4,
|
|
11
|
+
minSize: 4,
|
|
12
|
+
sizeUnit: "rem",
|
|
13
|
+
header: allowExpandAll ? ExpandAllRowsButton.ExpandAllRowsButton : "expander",
|
|
14
|
+
isHeaderCustom: !!allowExpandAll,
|
|
15
|
+
isHeaderHidden: !allowExpandAll,
|
|
16
|
+
cell: ExpandRowButton.ExpandRowButton,
|
|
17
|
+
...colDef
|
|
18
|
+
});
|
|
19
|
+
exports.useExpanderColumn = useExpanderColumn;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
2
|
+
export type UseExpanderColumnParams<T extends object> = Partial<ColumnDef<T>> & {
|
|
3
|
+
/** Show Expand All rows button in column header */
|
|
4
|
+
allowExpandAll?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const useExpanderColumn: <T extends object>({ allowExpandAll, ...colDef }?: UseExpanderColumnParams<T>) => ColumnDef<T, unknown>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ExpandAllRowsButton } from "./ExpandAllRowsButton.js";
|
|
2
|
+
import { ExpandRowButton } from "./ExpandRowButton.js";
|
|
3
|
+
const useExpanderColumn = ({
|
|
4
|
+
allowExpandAll,
|
|
5
|
+
...colDef
|
|
6
|
+
} = {}) => ({
|
|
7
|
+
id: "expander",
|
|
8
|
+
size: 4,
|
|
9
|
+
minSize: 4,
|
|
10
|
+
sizeUnit: "rem",
|
|
11
|
+
header: allowExpandAll ? ExpandAllRowsButton : "expander",
|
|
12
|
+
isHeaderCustom: !!allowExpandAll,
|
|
13
|
+
isHeaderHidden: !allowExpandAll,
|
|
14
|
+
cell: ExpandRowButton,
|
|
15
|
+
...colDef
|
|
16
|
+
});
|
|
17
|
+
export {
|
|
18
|
+
useExpanderColumn
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChildFree } from '@redislabsdev/redis-ui-components';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { OwnTableComposeProps, RestTableComposeProps } from '../Compose/Compose';
|
|
4
|
+
export type OwnPluggableTableProps<T extends object> = OwnTableComposeProps<T> & {
|
|
5
|
+
caption?: string;
|
|
6
|
+
emptyStateRender?: (() => ReactNode) | string;
|
|
7
|
+
};
|
|
8
|
+
export type RestPluggableTableProps = ChildFree<RestTableComposeProps>;
|
|
9
|
+
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;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { compositionComponents } from "./compositionComponents.js";
|
|
3
|
+
const PluggableTable = ({
|
|
4
|
+
caption,
|
|
5
|
+
emptyStateRender,
|
|
6
|
+
...restProps
|
|
7
|
+
}) => jsxRuntimeExports.jsxs(compositionComponents.Compose, {
|
|
8
|
+
...restProps,
|
|
9
|
+
children: [jsxRuntimeExports.jsxs(compositionComponents.Root, {
|
|
10
|
+
children: [jsxRuntimeExports.jsx(compositionComponents.SRCaption, {
|
|
11
|
+
caption
|
|
12
|
+
}), jsxRuntimeExports.jsx(compositionComponents.Header, {}), jsxRuntimeExports.jsx(compositionComponents.EmptyState, {
|
|
13
|
+
emptyStateRender
|
|
14
|
+
}), jsxRuntimeExports.jsx(compositionComponents.Body, {})]
|
|
15
|
+
}), jsxRuntimeExports.jsx(compositionComponents.Pagination, {}), jsxRuntimeExports.jsx(compositionComponents.SRSortingNotification, {})]
|
|
16
|
+
});
|
|
17
|
+
export {
|
|
18
|
+
PluggableTable
|
|
19
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const Compose = require("../Compose/Compose.cjs");
|
|
4
|
+
const TableRoot = require("../TableRoot/TableRoot.cjs");
|
|
5
|
+
const HiddenCaption = require("../HiddenCaption/HiddenCaption.cjs");
|
|
6
|
+
const TableHeader = require("../TableHeader/TableHeader.cjs");
|
|
7
|
+
const EmptyState = require("../EmptyState/EmptyState.cjs");
|
|
8
|
+
const TableBody = require("../TableBody/TableBody.cjs");
|
|
9
|
+
const TablePagination = require("../TablePagination/TablePagination.cjs");
|
|
10
|
+
const SRSortingNotification = require("../TableHeaderCell/SRSortingNotification.cjs");
|
|
11
|
+
const compositionComponents = {
|
|
12
|
+
Compose: Compose.TableCompose,
|
|
13
|
+
Root: TableRoot.TableRoot,
|
|
14
|
+
SRCaption: HiddenCaption.HiddenCaption,
|
|
15
|
+
Header: TableHeader.TableHeader,
|
|
16
|
+
EmptyState: EmptyState.EmptyState,
|
|
17
|
+
Body: TableBody.TableBody,
|
|
18
|
+
Pagination: TablePagination.default,
|
|
19
|
+
SRSortingNotification: SRSortingNotification.SRSortingNotification
|
|
20
|
+
};
|
|
21
|
+
exports.compositionComponents = compositionComponents;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SRSortingNotification } from '../TableHeaderCell/SRSortingNotification';
|
|
3
|
+
export declare const compositionComponents: {
|
|
4
|
+
Compose: <T extends object>({ data, columns, pluginsData, tableOptions, components, maxHeight, minWidth, stripedRows, ...restProps }: import("../Compose/Compose").TableComposeProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Root: (props: import("react").HTMLAttributes<HTMLTableElement>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
SRCaption: ({ caption }: {
|
|
7
|
+
caption?: string | undefined;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
Header: (<T_1 extends object>(props: import("../TableHeader/TableHeader").RestTableHeaderProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
10
|
+
Compose: import("styled-components").StyledComponent<"thead", any, {}, never>;
|
|
11
|
+
Row: (<T_2 extends object>(props: import("../TableHeaderRow/TableHeaderRow").OwnTableHeaderRowProps<T_2> & import("../TableHeaderRow/TableHeaderRow").RestTableHeaderRowProps & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null) & {
|
|
12
|
+
Compose: import("styled-components").StyledComponent<"tr", any, {}, never>;
|
|
13
|
+
};
|
|
14
|
+
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>, "content" | "children"> & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null;
|
|
16
|
+
SortableHeading: (({ children, ...restProps }: import("@redislabsdev/redis-ui-components").ComposeElementProps<HTMLElement>) => import("react/jsx-runtime").JSX.Element) & {
|
|
17
|
+
Compose: ((props: import("@redislabsdev/redis-ui-components").ComposeElementProps<HTMLElement>) => import("react/jsx-runtime").JSX.Element) & {
|
|
18
|
+
SortIndicator: () => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
19
|
+
};
|
|
20
|
+
SortIndicator: () => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
21
|
+
};
|
|
22
|
+
Heading: (props: import("../TableHeaderCell/components/Heading/Heading").RestTableHeaderCellHeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
EmptyState: ({ emptyStateRender, ...restProps }: import("../EmptyState/EmptyState").EmptyStateProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
Body: (<T_5 extends object>(props: import("../TableBody/TableBody").RestTableBodyProps) => import("react/jsx-runtime").JSX.Element | null) & {
|
|
27
|
+
Compose: (props: import("../TableBody/components/Compose/Compose").TableBodyComposeProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
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>, "content" | "children"> & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null;
|
|
30
|
+
useHandleClickableRow: <T_7 extends object>({ row, onClick, onKeyDown }: {
|
|
31
|
+
row: import("@tanstack/table-core").Row<T_7>;
|
|
32
|
+
onClick?: import("react").MouseEventHandler<HTMLTableRowElement> | undefined;
|
|
33
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLTableRowElement> | undefined;
|
|
34
|
+
}) => {
|
|
35
|
+
onClick: import("react").MouseEventHandler<HTMLTableRowElement> | undefined;
|
|
36
|
+
onKeyDown: ((event: import("react").KeyboardEvent<HTMLTableRowElement>) => void) | undefined;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
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
|
+
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>, "content" | "children"> & import("../TableBodyCell/components/Compose/Compose").OwnTableBodyCellComposeProps<T_10> & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
Pagination: (() => import("react/jsx-runtime").JSX.Element | null) & {
|
|
45
|
+
Compose: ({ children }: import("@redislabsdev/redis-ui-components").ComposeChildrenProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
46
|
+
Bar: import("styled-components").StyledComponent<"nav", any, {
|
|
47
|
+
'aria-label': string;
|
|
48
|
+
} & {
|
|
49
|
+
'aria-label': string;
|
|
50
|
+
}, "aria-label">;
|
|
51
|
+
Split: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
52
|
+
InfoLabel: import("styled-components").StyledComponent<({ renderer, ...restProps }: import("@redislabsdev/redis-ui-components").PaginationInfoLabelProps) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
|
|
53
|
+
PageSelect: import("styled-components").StyledComponent<{
|
|
54
|
+
({ ...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;
|
|
56
|
+
}, any, {}, never>;
|
|
57
|
+
PageSizeSelect: import("styled-components").StyledComponent<{
|
|
58
|
+
({ 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;
|
|
60
|
+
}, any, {}, never>;
|
|
61
|
+
NavigationButton: import("styled-components").StyledComponent<({ navType, ...restProps }: import("@redislabsdev/redis-ui-components").PaginationNavigationButtonProps) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
|
|
62
|
+
PageSizeGroup: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
63
|
+
PageNavGroup: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
64
|
+
PageSelectGroup: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
65
|
+
};
|
|
66
|
+
SRSortingNotification: typeof SRSortingNotification;
|
|
67
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TableCompose } from "../Compose/Compose.js";
|
|
2
|
+
import { TableRoot } from "../TableRoot/TableRoot.js";
|
|
3
|
+
import { HiddenCaption } from "../HiddenCaption/HiddenCaption.js";
|
|
4
|
+
import { TableHeader } from "../TableHeader/TableHeader.js";
|
|
5
|
+
import { EmptyState } from "../EmptyState/EmptyState.js";
|
|
6
|
+
import { TableBody } from "../TableBody/TableBody.js";
|
|
7
|
+
import TablePagination from "../TablePagination/TablePagination.js";
|
|
8
|
+
import { SRSortingNotification } from "../TableHeaderCell/SRSortingNotification.js";
|
|
9
|
+
const compositionComponents = {
|
|
10
|
+
Compose: TableCompose,
|
|
11
|
+
Root: TableRoot,
|
|
12
|
+
SRCaption: HiddenCaption,
|
|
13
|
+
Header: TableHeader,
|
|
14
|
+
EmptyState,
|
|
15
|
+
Body: TableBody,
|
|
16
|
+
Pagination: TablePagination,
|
|
17
|
+
SRSortingNotification
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
compositionComponents
|
|
21
|
+
};
|
|
@@ -4,4 +4,4 @@ export interface HeaderMultiRowSelectionButtonProps<T extends object> extends Om
|
|
|
4
4
|
table: Table<T>;
|
|
5
5
|
managePage?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare const HeaderMultiRowSelectionButton: <T extends object>({ table, managePage, ...restProps }: HeaderMultiRowSelectionButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const HeaderMultiRowSelectionButton: <T extends object>({ table, managePage, ...restProps }: HeaderMultiRowSelectionButtonProps<T>) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
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 HeaderMultiRowSelectionButton = require("./HeaderMultiRowSelectionButton.cjs");
|
|
6
|
+
const RowSelectionButton = require("./RowSelectionButton.cjs");
|
|
7
|
+
const useRowSelectionColumn = ({
|
|
8
|
+
disableSelectAll,
|
|
9
|
+
managePage,
|
|
10
|
+
...colDef
|
|
11
|
+
} = {}) => ({
|
|
12
|
+
id: "row-selection",
|
|
13
|
+
size: 4.2,
|
|
14
|
+
minSize: 4.2,
|
|
15
|
+
sizeUnit: "rem",
|
|
16
|
+
header: (props) => !disableSelectAll && props.table.options.enableMultiRowSelection ? jsxRuntime.jsxRuntimeExports.jsx(HeaderMultiRowSelectionButton.HeaderMultiRowSelectionButton, {
|
|
17
|
+
...props,
|
|
18
|
+
managePage
|
|
19
|
+
}) : jsxRuntime.jsxRuntimeExports.jsx(index.VisuallyHidden, {
|
|
20
|
+
children: "row selection"
|
|
21
|
+
}),
|
|
22
|
+
isHeaderCustom: true,
|
|
23
|
+
cell: RowSelectionButton.RowSelectionButton,
|
|
24
|
+
...colDef
|
|
25
|
+
});
|
|
26
|
+
exports.useRowSelectionColumn = useRowSelectionColumn;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
2
|
+
export type UseRowSelectionColumnParams<T extends object> = Partial<ColumnDef<T>> & {
|
|
3
|
+
/** Disable Select All checkbox in header, even if multi-select is enabled */
|
|
4
|
+
disableSelectAll?: boolean;
|
|
5
|
+
/** Force Select All checkbox toggle selection on current page only, if pagination is enabled */
|
|
6
|
+
managePage?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const useRowSelectionColumn: <T extends object>({ disableSelectAll, managePage, ...colDef }?: UseRowSelectionColumnParams<T>) => ColumnDef<T, unknown>;
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
import { HeaderMultiRowSelectionButton } from "./HeaderMultiRowSelectionButton.js";
|
|
4
|
+
import { RowSelectionButton } from "./RowSelectionButton.js";
|
|
5
|
+
const useRowSelectionColumn = ({
|
|
6
|
+
disableSelectAll,
|
|
7
|
+
managePage,
|
|
8
|
+
...colDef
|
|
9
|
+
} = {}) => ({
|
|
10
|
+
id: "row-selection",
|
|
11
|
+
size: 4.2,
|
|
12
|
+
minSize: 4.2,
|
|
13
|
+
sizeUnit: "rem",
|
|
14
|
+
header: (props) => !disableSelectAll && props.table.options.enableMultiRowSelection ? jsxRuntimeExports.jsx(HeaderMultiRowSelectionButton, {
|
|
15
|
+
...props,
|
|
16
|
+
managePage
|
|
17
|
+
}) : jsxRuntimeExports.jsx(VisuallyHidden, {
|
|
18
|
+
children: "row selection"
|
|
19
|
+
}),
|
|
20
|
+
isHeaderCustom: true,
|
|
21
|
+
cell: RowSelectionButton,
|
|
22
|
+
...colDef
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
useRowSelectionColumn
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,8 +4,10 @@ const _styled = require("styled-components");
|
|
|
4
4
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
5
5
|
const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
|
|
6
6
|
const ShowOnRowHover = _styled__default.default.div`
|
|
7
|
+
table:where([tabindex='0']) & {
|
|
8
|
+
visibility: hidden;
|
|
9
|
+
}
|
|
7
10
|
opacity: 0;
|
|
8
|
-
visibility: hidden;
|
|
9
11
|
transition: opacity 0.3s ease-in-out;
|
|
10
12
|
`;
|
|
11
13
|
exports.ShowOnRowHover = ShowOnRowHover;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 TableBodyCell = require("../TableBodyCell/TableBodyCell.cjs");
|
|
6
|
+
const TableBodyRow = require("../TableBodyRow/TableBodyRow.cjs");
|
|
7
|
+
const Compose = require("./components/Compose/Compose.cjs");
|
|
8
|
+
const TableBodyRowExpandable = require("../TableBodyRow/TableBodyRowExpandable.cjs");
|
|
9
|
+
const TableBody = Object.assign((props) => {
|
|
10
|
+
const {
|
|
11
|
+
table
|
|
12
|
+
} = Table_context.useTableContext();
|
|
13
|
+
const {
|
|
14
|
+
TableBodyRow: Row
|
|
15
|
+
} = Table_context.useComposeContext({
|
|
16
|
+
TableBodyRow: TableBodyRowExpandable.TableBodyRowExpandable
|
|
17
|
+
});
|
|
18
|
+
const {
|
|
19
|
+
rows
|
|
20
|
+
} = table.getRowModel();
|
|
21
|
+
return rows.length ? jsxRuntime.jsxRuntimeExports.jsx(TableBody.Compose, {
|
|
22
|
+
...props,
|
|
23
|
+
children: rows.map((row) => jsxRuntime.jsxRuntimeExports.jsx(Row, {
|
|
24
|
+
row
|
|
25
|
+
}, row.id))
|
|
26
|
+
}) : null;
|
|
27
|
+
}, {
|
|
28
|
+
Compose: Compose.TableBodyCompose,
|
|
29
|
+
Row: TableBodyRow.TableBodyRow,
|
|
30
|
+
ExpandableRow: TableBodyRowExpandable.TableBodyRowExpandable,
|
|
31
|
+
Cell: TableBodyCell.TableBodyCell
|
|
32
|
+
});
|
|
33
|
+
exports.TableBody = TableBody;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ChildFree } from '@redislabsdev/redis-ui-components';
|
|
3
|
+
import { TableBodyComposeProps } from './components/Compose/Compose';
|
|
4
|
+
export type RestTableBodyProps = ChildFree<TableBodyComposeProps>;
|
|
5
|
+
export type TableBodyProps = RestTableBodyProps;
|
|
6
|
+
export declare const TableBody: (<T extends object>(props: TableBodyProps) => import("react/jsx-runtime").JSX.Element | null) & {
|
|
7
|
+
Compose: (props: TableBodyComposeProps) => import("react/jsx-runtime").JSX.Element;
|
|
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>, "content" | "children"> & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null;
|
|
10
|
+
useHandleClickableRow: <T_2 extends object>({ row, onClick, onKeyDown }: {
|
|
11
|
+
row: import("@tanstack/table-core").Row<T_2>;
|
|
12
|
+
onClick?: import("react").MouseEventHandler<HTMLTableRowElement> | undefined;
|
|
13
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLTableRowElement> | undefined;
|
|
14
|
+
}) => {
|
|
15
|
+
onClick: import("react").MouseEventHandler<HTMLTableRowElement> | undefined;
|
|
16
|
+
onKeyDown: ((event: import("react").KeyboardEvent<HTMLTableRowElement>) => void) | undefined;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
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
|
+
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>, "content" | "children"> & import("../TableBodyCell/components/Compose/Compose").OwnTableBodyCellComposeProps<T_5> & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null;
|
|
22
|
+
};
|
|
23
|
+
};
|