@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,24 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../../../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { getColumnSortLabel, formatColumnSortNotification } from "../../../../TableHeaderCell.utils.js";
|
|
3
|
+
import { useTableHeaderCellContext } from "../../../../TableHeaderCell.context.js";
|
|
4
|
+
import { SortIndicator } from "../SortIndicator/SortIndicator.js";
|
|
5
|
+
import { SortableHeadingCompose as SortableHeadingCompose$1 } from "../../../../../../Table.style.js";
|
|
6
|
+
const SortableHeadingCompose = Object.assign((props) => {
|
|
7
|
+
const {
|
|
8
|
+
header
|
|
9
|
+
} = useTableHeaderCellContext();
|
|
10
|
+
return jsxRuntimeExports.jsx(
|
|
11
|
+
SortableHeadingCompose$1,
|
|
12
|
+
{
|
|
13
|
+
"aria-description": getColumnSortLabel(header, formatColumnSortNotification),
|
|
14
|
+
...props,
|
|
15
|
+
"$custom": header.column.columnDef.isHeaderCustom || false,
|
|
16
|
+
as: header.column.getCanSort() ? void 0 : "div"
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}, {
|
|
20
|
+
SortIndicator
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
SortableHeadingCompose
|
|
24
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const TableHeaderCell_utils = require("../../../../TableHeaderCell.utils.cjs");
|
|
4
|
+
const TableHeaderCell_context = require("../../../../TableHeaderCell.context.cjs");
|
|
5
|
+
const SortIndicator = () => TableHeaderCell_utils.getSortSign(TableHeaderCell_context.useTableHeaderCellContext().header);
|
|
6
|
+
exports.SortIndicator = SortIndicator;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 TableHeaderCell = require("../TableHeaderCell/TableHeaderCell.cjs");
|
|
6
|
+
const Compose = require("./components/Compose/Compose.cjs");
|
|
7
|
+
const Table_context = require("../../Table.context.cjs");
|
|
8
|
+
const TableHeaderRow = Object.assign(redisUiComponents.forwardRefWithGenerics(({
|
|
9
|
+
headerGroup,
|
|
10
|
+
...restProps
|
|
11
|
+
}, ref) => {
|
|
12
|
+
const {
|
|
13
|
+
TableHeaderCell: Cell
|
|
14
|
+
} = Table_context.useComposeContext({
|
|
15
|
+
TableHeaderCell: TableHeaderCell.TableHeaderCell
|
|
16
|
+
});
|
|
17
|
+
return jsxRuntime.jsxRuntimeExports.jsx(TableHeaderRow.Compose, {
|
|
18
|
+
...restProps,
|
|
19
|
+
ref,
|
|
20
|
+
children: headerGroup.headers.map((header) => jsxRuntime.jsxRuntimeExports.jsx(Cell, {
|
|
21
|
+
header
|
|
22
|
+
}, header.id))
|
|
23
|
+
});
|
|
24
|
+
}), {
|
|
25
|
+
Compose: Compose.TableHeaderRowCompose
|
|
26
|
+
});
|
|
27
|
+
exports.TableHeaderRow = TableHeaderRow;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { HeaderGroup } from '@tanstack/react-table';
|
|
3
|
+
import { ChildFree } from '@redislabsdev/redis-ui-components';
|
|
4
|
+
import { TableHeaderRowComposeProps } from './components/Compose/Compose';
|
|
5
|
+
export type OwnTableHeaderRowProps<T extends object> = {
|
|
6
|
+
headerGroup: HeaderGroup<T>;
|
|
7
|
+
};
|
|
8
|
+
export type RestTableHeaderRowProps = ChildFree<TableHeaderRowComposeProps>;
|
|
9
|
+
export type TableHeaderRowProps<T extends object> = OwnTableHeaderRowProps<T> & RestTableHeaderRowProps;
|
|
10
|
+
export declare const TableHeaderRow: (<T extends object>(props: OwnTableHeaderRowProps<T> & RestTableHeaderRowProps & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null) & {
|
|
11
|
+
Compose: import("styled-components").StyledComponent<"tr", any, {}, never>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { forwardRefWithGenerics } from "@redislabsdev/redis-ui-components";
|
|
3
|
+
import { TableHeaderCell } from "../TableHeaderCell/TableHeaderCell.js";
|
|
4
|
+
import { TableHeaderRowCompose } from "./components/Compose/Compose.js";
|
|
5
|
+
import { useComposeContext } from "../../Table.context.js";
|
|
6
|
+
const TableHeaderRow = Object.assign(forwardRefWithGenerics(({
|
|
7
|
+
headerGroup,
|
|
8
|
+
...restProps
|
|
9
|
+
}, ref) => {
|
|
10
|
+
const {
|
|
11
|
+
TableHeaderCell: Cell
|
|
12
|
+
} = useComposeContext({
|
|
13
|
+
TableHeaderCell
|
|
14
|
+
});
|
|
15
|
+
return jsxRuntimeExports.jsx(TableHeaderRow.Compose, {
|
|
16
|
+
...restProps,
|
|
17
|
+
ref,
|
|
18
|
+
children: headerGroup.headers.map((header) => jsxRuntimeExports.jsx(Cell, {
|
|
19
|
+
header
|
|
20
|
+
}, header.id))
|
|
21
|
+
});
|
|
22
|
+
}), {
|
|
23
|
+
Compose: TableHeaderRowCompose
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
TableHeaderRow
|
|
27
|
+
};
|
|
@@ -1,112 +1,78 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const redisUiComponents = require("@redislabsdev/redis-ui-components");
|
|
5
|
+
const PaginationPlugin = require("../../plugins/PaginationPlugin.cjs");
|
|
6
|
+
const Compose = require("./components/Compose/Compose.cjs");
|
|
7
7
|
const TablePagination_style = require("./TablePagination.style.cjs");
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
const renderRowCount = ({
|
|
9
|
+
visibleItemCount,
|
|
10
|
+
totalItemCount
|
|
11
|
+
}) => `Showing ${visibleItemCount} out of ${totalItemCount} rows`;
|
|
12
|
+
const renderPageCount = ({
|
|
13
|
+
pageIndex,
|
|
14
|
+
pageCount
|
|
15
|
+
}) => `${pageIndex + 1} of ${pageCount}`;
|
|
16
|
+
const renderTotalPageCount = ({
|
|
17
|
+
pageCount
|
|
18
|
+
}) => `of ${pageCount}`;
|
|
19
|
+
const TablePagination = Object.assign(() => {
|
|
20
|
+
const pagination = PaginationPlugin.usePaginationContext();
|
|
21
|
+
if (!pagination) {
|
|
18
22
|
return null;
|
|
19
23
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return jsxRuntime.jsxRuntimeExports.jsx(TablePagination_style.PaginationRow, {
|
|
33
|
-
"data-role": "pagination",
|
|
34
|
-
children: jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, {
|
|
35
|
-
children: [jsxRuntime.jsxRuntimeExports.jsxs(TablePagination_style.CountInfo, {
|
|
36
|
-
children: ["Showing ", table.getRowModel().rows.length, " out of ", totalRowCount, " rows"]
|
|
37
|
-
}), jsxRuntime.jsxRuntimeExports.jsxs("div", {
|
|
38
|
-
style: {
|
|
39
|
-
display: "flex",
|
|
40
|
-
alignItems: "center",
|
|
41
|
-
gap: "1rem"
|
|
42
|
-
},
|
|
43
|
-
children: [jsxRuntime.jsxRuntimeExports.jsx(TablePagination_style.ItemPerPageText, {
|
|
44
|
-
children: jsxRuntime.jsxRuntimeExports.jsx(TablePagination_style.Label, {
|
|
45
|
-
htmlFor: perPageId,
|
|
46
|
-
children: "Items per page:"
|
|
47
|
-
})
|
|
48
|
-
}), jsxRuntime.jsxRuntimeExports.jsx(TablePagination_style.Select, {
|
|
49
|
-
id: perPageId,
|
|
50
|
-
value: pageSize.toString(),
|
|
51
|
-
onChange: handlePageSizeChange,
|
|
52
|
-
disabled: pageSizes[0] > totalRowCount,
|
|
53
|
-
options: pageSizes.map(String).map((value) => ({
|
|
54
|
-
value
|
|
55
|
-
}))
|
|
24
|
+
return jsxRuntime.jsxRuntimeExports.jsx(TablePagination.Compose, {
|
|
25
|
+
children: jsxRuntime.jsxRuntimeExports.jsxs(TablePagination.Bar, {
|
|
26
|
+
"data-role": "pagination",
|
|
27
|
+
children: [jsxRuntime.jsxRuntimeExports.jsx(TablePagination.InfoLabel, {
|
|
28
|
+
renderer: renderRowCount,
|
|
29
|
+
ellipsis: true,
|
|
30
|
+
tooltipOnEllipsis: true
|
|
31
|
+
}), jsxRuntime.jsxRuntimeExports.jsx(TablePagination.Split, {}), jsxRuntime.jsxRuntimeExports.jsxs(TablePagination.PageSizeGroup, {
|
|
32
|
+
children: [jsxRuntime.jsxRuntimeExports.jsx(TablePagination.PageSizeSelect.Label, {
|
|
33
|
+
children: "Items per page:"
|
|
34
|
+
}), jsxRuntime.jsxRuntimeExports.jsx(TablePagination.PageSizeSelect, {
|
|
35
|
+
pageSizes: pagination.pageSizes
|
|
56
36
|
})]
|
|
57
|
-
}), jsxRuntime.jsxRuntimeExports.jsxs(
|
|
58
|
-
children: [jsxRuntime.jsxRuntimeExports.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
children: [pageIndex + 1, " of ", pageCount]
|
|
75
|
-
}), jsxRuntime.jsxRuntimeExports.jsx(TablePagination_style.PaginationIconButton, {
|
|
76
|
-
icon: redisUiIcons.ChevronRightIcon,
|
|
77
|
-
size: "S",
|
|
78
|
-
onClick: () => handlePageIndexChange(pageIndex + 1),
|
|
79
|
-
disabled: pageIndex === pageCount - 1,
|
|
80
|
-
title: "Next page",
|
|
81
|
-
"aria-label": "next page"
|
|
82
|
-
}), jsxRuntime.jsxRuntimeExports.jsx(TablePagination_style.PaginationIconButton, {
|
|
83
|
-
icon: redisUiIcons.DoubleChevronRightIcon,
|
|
84
|
-
size: "S",
|
|
85
|
-
onClick: () => handlePageIndexChange(pageCount - 1),
|
|
86
|
-
disabled: pageIndex === pageCount - 1,
|
|
87
|
-
title: "Last page",
|
|
88
|
-
"aria-label": "last page"
|
|
37
|
+
}), jsxRuntime.jsxRuntimeExports.jsxs(TablePagination.PageNavGroup, {
|
|
38
|
+
children: [jsxRuntime.jsxRuntimeExports.jsxs("div", {
|
|
39
|
+
children: [jsxRuntime.jsxRuntimeExports.jsx(TablePagination.NavigationButton, {
|
|
40
|
+
navType: "first"
|
|
41
|
+
}), jsxRuntime.jsxRuntimeExports.jsx(TablePagination.NavigationButton, {
|
|
42
|
+
navType: "prev"
|
|
43
|
+
})]
|
|
44
|
+
}), jsxRuntime.jsxRuntimeExports.jsx(TablePagination.InfoLabel, {
|
|
45
|
+
ellipsis: true,
|
|
46
|
+
tooltipOnEllipsis: true,
|
|
47
|
+
renderer: renderPageCount
|
|
48
|
+
}), jsxRuntime.jsxRuntimeExports.jsxs("div", {
|
|
49
|
+
children: [jsxRuntime.jsxRuntimeExports.jsx(TablePagination.NavigationButton, {
|
|
50
|
+
navType: "next"
|
|
51
|
+
}), jsxRuntime.jsxRuntimeExports.jsx(TablePagination.NavigationButton, {
|
|
52
|
+
navType: "last"
|
|
53
|
+
})]
|
|
89
54
|
})]
|
|
90
|
-
}), jsxRuntime.jsxRuntimeExports.jsxs(
|
|
91
|
-
children: [jsxRuntime.jsxRuntimeExports.jsx(
|
|
92
|
-
children:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
id: pageNumId,
|
|
98
|
-
value: (pageIndex + 1).toString(),
|
|
99
|
-
onChange: (value) => handlePageIndexChange(Number(value) - 1),
|
|
100
|
-
options: Array.from({
|
|
101
|
-
length: pageCount
|
|
102
|
-
}, (_, i) => String(i + 1)).map((value) => ({
|
|
103
|
-
value
|
|
104
|
-
}))
|
|
105
|
-
}), jsxRuntime.jsxRuntimeExports.jsxs(TablePagination_style.TotalPagesText, {
|
|
106
|
-
children: ["of ", pageCount]
|
|
55
|
+
}), jsxRuntime.jsxRuntimeExports.jsxs(TablePagination.PageSelectGroup, {
|
|
56
|
+
children: [jsxRuntime.jsxRuntimeExports.jsx(TablePagination.PageSelect.Label, {
|
|
57
|
+
children: "Page"
|
|
58
|
+
}), jsxRuntime.jsxRuntimeExports.jsx(TablePagination.PageSelect, {}), jsxRuntime.jsxRuntimeExports.jsx(TablePagination.InfoLabel, {
|
|
59
|
+
ellipsis: true,
|
|
60
|
+
tooltipOnEllipsis: true,
|
|
61
|
+
renderer: renderTotalPageCount
|
|
107
62
|
})]
|
|
108
63
|
})]
|
|
109
64
|
})
|
|
110
65
|
});
|
|
111
|
-
}
|
|
66
|
+
}, {
|
|
67
|
+
Compose: Compose.TablePaginationCompose,
|
|
68
|
+
Bar: TablePagination_style.PaginationBar,
|
|
69
|
+
Split: redisUiComponents.Pagination.Split,
|
|
70
|
+
InfoLabel: TablePagination_style.InfoLabel,
|
|
71
|
+
PageSelect: TablePagination_style.PageSelect,
|
|
72
|
+
PageSizeSelect: TablePagination_style.PageSizeSelect,
|
|
73
|
+
NavigationButton: TablePagination_style.NavigationButton,
|
|
74
|
+
PageSizeGroup: TablePagination_style.PageSizeGroup,
|
|
75
|
+
PageNavGroup: TablePagination_style.PageNavGroup,
|
|
76
|
+
PageSelectGroup: TablePagination_style.PageSelectGroup
|
|
77
|
+
});
|
|
112
78
|
exports.default = TablePagination;
|
|
@@ -1,4 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
1
|
+
import { PaginationInfoLabelProps } from '@redislabsdev/redis-ui-components';
|
|
2
|
+
declare const TablePagination: (() => import("react/jsx-runtime").JSX.Element | null) & {
|
|
3
|
+
Compose: ({ children }: import("@redislabsdev/redis-ui-components").ComposeChildrenProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
+
Bar: import("styled-components").StyledComponent<"nav", any, {
|
|
5
|
+
'aria-label': string;
|
|
6
|
+
} & {
|
|
7
|
+
'aria-label': string;
|
|
8
|
+
}, "aria-label">;
|
|
9
|
+
Split: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
|
+
InfoLabel: import("styled-components").StyledComponent<({ renderer, ...restProps }: PaginationInfoLabelProps) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
|
|
11
|
+
PageSelect: import("styled-components").StyledComponent<{
|
|
12
|
+
({ ...restProps }: import("@redislabsdev/redis-ui-components").PaginationPageSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
Label: ({ children, ...restProps }: import("@redislabsdev/redis-ui-components").TypographyBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
}, any, {}, never>;
|
|
15
|
+
PageSizeSelect: import("styled-components").StyledComponent<{
|
|
16
|
+
({ pageSizes, ...restProps }: import("@redislabsdev/redis-ui-components").PaginationPageSizeSelectProps): import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
Label: ({ children, ...restProps }: import("@redislabsdev/redis-ui-components").TypographyBodyProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
}, any, {}, never>;
|
|
19
|
+
NavigationButton: import("styled-components").StyledComponent<({ navType, ...restProps }: import("@redislabsdev/redis-ui-components").PaginationNavigationButtonProps) => import("react/jsx-runtime").JSX.Element, any, {}, never>;
|
|
20
|
+
PageSizeGroup: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
21
|
+
PageNavGroup: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
22
|
+
PageSelectGroup: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
23
|
+
};
|
|
4
24
|
export default TablePagination;
|
|
@@ -1,112 +1,78 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
import { Pagination } from "@redislabsdev/redis-ui-components";
|
|
3
|
+
import { usePaginationContext } from "../../plugins/PaginationPlugin.js";
|
|
4
|
+
import { TablePaginationCompose } from "./components/Compose/Compose.js";
|
|
5
|
+
import { PaginationBar, InfoLabel, PageSelect, PageSizeSelect, NavigationButton, PageSizeGroup, PageNavGroup, PageSelectGroup } from "./TablePagination.style.js";
|
|
6
|
+
const renderRowCount = ({
|
|
7
|
+
visibleItemCount,
|
|
8
|
+
totalItemCount
|
|
9
|
+
}) => `Showing ${visibleItemCount} out of ${totalItemCount} rows`;
|
|
10
|
+
const renderPageCount = ({
|
|
11
|
+
pageIndex,
|
|
12
|
+
pageCount
|
|
13
|
+
}) => `${pageIndex + 1} of ${pageCount}`;
|
|
14
|
+
const renderTotalPageCount = ({
|
|
15
|
+
pageCount
|
|
16
|
+
}) => `of ${pageCount}`;
|
|
17
|
+
const TablePagination = Object.assign(() => {
|
|
18
|
+
const pagination = usePaginationContext();
|
|
19
|
+
if (!pagination) {
|
|
16
20
|
return null;
|
|
17
21
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return jsxRuntimeExports.jsx(PaginationRow, {
|
|
31
|
-
"data-role": "pagination",
|
|
32
|
-
children: jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
33
|
-
children: [jsxRuntimeExports.jsxs(CountInfo, {
|
|
34
|
-
children: ["Showing ", table.getRowModel().rows.length, " out of ", totalRowCount, " rows"]
|
|
35
|
-
}), jsxRuntimeExports.jsxs("div", {
|
|
36
|
-
style: {
|
|
37
|
-
display: "flex",
|
|
38
|
-
alignItems: "center",
|
|
39
|
-
gap: "1rem"
|
|
40
|
-
},
|
|
41
|
-
children: [jsxRuntimeExports.jsx(ItemPerPageText, {
|
|
42
|
-
children: jsxRuntimeExports.jsx(Label, {
|
|
43
|
-
htmlFor: perPageId,
|
|
44
|
-
children: "Items per page:"
|
|
45
|
-
})
|
|
46
|
-
}), jsxRuntimeExports.jsx(Select, {
|
|
47
|
-
id: perPageId,
|
|
48
|
-
value: pageSize.toString(),
|
|
49
|
-
onChange: handlePageSizeChange,
|
|
50
|
-
disabled: pageSizes[0] > totalRowCount,
|
|
51
|
-
options: pageSizes.map(String).map((value) => ({
|
|
52
|
-
value
|
|
53
|
-
}))
|
|
22
|
+
return jsxRuntimeExports.jsx(TablePagination.Compose, {
|
|
23
|
+
children: jsxRuntimeExports.jsxs(TablePagination.Bar, {
|
|
24
|
+
"data-role": "pagination",
|
|
25
|
+
children: [jsxRuntimeExports.jsx(TablePagination.InfoLabel, {
|
|
26
|
+
renderer: renderRowCount,
|
|
27
|
+
ellipsis: true,
|
|
28
|
+
tooltipOnEllipsis: true
|
|
29
|
+
}), jsxRuntimeExports.jsx(TablePagination.Split, {}), jsxRuntimeExports.jsxs(TablePagination.PageSizeGroup, {
|
|
30
|
+
children: [jsxRuntimeExports.jsx(TablePagination.PageSizeSelect.Label, {
|
|
31
|
+
children: "Items per page:"
|
|
32
|
+
}), jsxRuntimeExports.jsx(TablePagination.PageSizeSelect, {
|
|
33
|
+
pageSizes: pagination.pageSizes
|
|
54
34
|
})]
|
|
55
|
-
}), jsxRuntimeExports.jsxs(
|
|
56
|
-
children: [jsxRuntimeExports.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
children: [pageIndex + 1, " of ", pageCount]
|
|
73
|
-
}), jsxRuntimeExports.jsx(PaginationIconButton, {
|
|
74
|
-
icon: ChevronRightIcon,
|
|
75
|
-
size: "S",
|
|
76
|
-
onClick: () => handlePageIndexChange(pageIndex + 1),
|
|
77
|
-
disabled: pageIndex === pageCount - 1,
|
|
78
|
-
title: "Next page",
|
|
79
|
-
"aria-label": "next page"
|
|
80
|
-
}), jsxRuntimeExports.jsx(PaginationIconButton, {
|
|
81
|
-
icon: DoubleChevronRightIcon,
|
|
82
|
-
size: "S",
|
|
83
|
-
onClick: () => handlePageIndexChange(pageCount - 1),
|
|
84
|
-
disabled: pageIndex === pageCount - 1,
|
|
85
|
-
title: "Last page",
|
|
86
|
-
"aria-label": "last page"
|
|
35
|
+
}), jsxRuntimeExports.jsxs(TablePagination.PageNavGroup, {
|
|
36
|
+
children: [jsxRuntimeExports.jsxs("div", {
|
|
37
|
+
children: [jsxRuntimeExports.jsx(TablePagination.NavigationButton, {
|
|
38
|
+
navType: "first"
|
|
39
|
+
}), jsxRuntimeExports.jsx(TablePagination.NavigationButton, {
|
|
40
|
+
navType: "prev"
|
|
41
|
+
})]
|
|
42
|
+
}), jsxRuntimeExports.jsx(TablePagination.InfoLabel, {
|
|
43
|
+
ellipsis: true,
|
|
44
|
+
tooltipOnEllipsis: true,
|
|
45
|
+
renderer: renderPageCount
|
|
46
|
+
}), jsxRuntimeExports.jsxs("div", {
|
|
47
|
+
children: [jsxRuntimeExports.jsx(TablePagination.NavigationButton, {
|
|
48
|
+
navType: "next"
|
|
49
|
+
}), jsxRuntimeExports.jsx(TablePagination.NavigationButton, {
|
|
50
|
+
navType: "last"
|
|
51
|
+
})]
|
|
87
52
|
})]
|
|
88
|
-
}), jsxRuntimeExports.jsxs(
|
|
89
|
-
children: [jsxRuntimeExports.jsx(
|
|
90
|
-
children:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
id: pageNumId,
|
|
96
|
-
value: (pageIndex + 1).toString(),
|
|
97
|
-
onChange: (value) => handlePageIndexChange(Number(value) - 1),
|
|
98
|
-
options: Array.from({
|
|
99
|
-
length: pageCount
|
|
100
|
-
}, (_, i) => String(i + 1)).map((value) => ({
|
|
101
|
-
value
|
|
102
|
-
}))
|
|
103
|
-
}), jsxRuntimeExports.jsxs(TotalPagesText, {
|
|
104
|
-
children: ["of ", pageCount]
|
|
53
|
+
}), jsxRuntimeExports.jsxs(TablePagination.PageSelectGroup, {
|
|
54
|
+
children: [jsxRuntimeExports.jsx(TablePagination.PageSelect.Label, {
|
|
55
|
+
children: "Page"
|
|
56
|
+
}), jsxRuntimeExports.jsx(TablePagination.PageSelect, {}), jsxRuntimeExports.jsx(TablePagination.InfoLabel, {
|
|
57
|
+
ellipsis: true,
|
|
58
|
+
tooltipOnEllipsis: true,
|
|
59
|
+
renderer: renderTotalPageCount
|
|
105
60
|
})]
|
|
106
61
|
})]
|
|
107
62
|
})
|
|
108
63
|
});
|
|
109
|
-
}
|
|
64
|
+
}, {
|
|
65
|
+
Compose: TablePaginationCompose,
|
|
66
|
+
Bar: PaginationBar,
|
|
67
|
+
Split: Pagination.Split,
|
|
68
|
+
InfoLabel,
|
|
69
|
+
PageSelect,
|
|
70
|
+
PageSizeSelect,
|
|
71
|
+
NavigationButton,
|
|
72
|
+
PageSizeGroup,
|
|
73
|
+
PageNavGroup,
|
|
74
|
+
PageSelectGroup
|
|
75
|
+
});
|
|
110
76
|
export {
|
|
111
77
|
TablePagination as default
|
|
112
78
|
};
|