@redis-ui/table 2.12.0 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Table/Table.cjs +70 -145
- package/dist/Table/Table.context.cjs +16 -1
- package/dist/Table/Table.context.d.ts +22 -4
- package/dist/Table/Table.context.js +16 -1
- package/dist/Table/Table.d.ts +83 -5
- package/dist/Table/Table.js +70 -145
- package/dist/Table/Table.style.cjs +10 -5
- package/dist/Table/Table.style.d.ts +3 -3
- package/dist/Table/Table.style.js +10 -5
- package/dist/Table/Table.types.d.ts +20 -38
- package/dist/Table/components/Compose/Compose.cjs +42 -0
- package/dist/Table/components/Compose/Compose.d.ts +13 -0
- package/dist/Table/components/Compose/Compose.js +42 -0
- package/dist/Table/components/EmptyState/EmptyState.cjs +31 -0
- package/dist/Table/components/EmptyState/EmptyState.d.ts +6 -0
- package/dist/Table/components/EmptyState/EmptyState.js +31 -0
- package/dist/Table/components/HiddenCaption/HiddenCaption.cjs +13 -0
- package/dist/Table/components/HiddenCaption/HiddenCaption.d.ts +3 -0
- package/dist/Table/components/HiddenCaption/HiddenCaption.js +13 -0
- package/dist/Table/components/PluggableTable/PluggableTable.cjs +19 -0
- package/dist/Table/components/PluggableTable/PluggableTable.d.ts +10 -0
- package/dist/Table/components/PluggableTable/PluggableTable.js +19 -0
- package/dist/Table/components/PluggableTable/compositionComponents.cjs +21 -0
- package/dist/Table/components/PluggableTable/compositionComponents.d.ts +67 -0
- package/dist/Table/components/PluggableTable/compositionComponents.js +21 -0
- package/dist/Table/components/TableBody/TableBody.cjs +33 -0
- package/dist/Table/components/TableBody/TableBody.d.ts +23 -0
- package/dist/Table/components/TableBody/TableBody.js +33 -0
- package/dist/Table/components/TableBody/components/Compose/Compose.cjs +10 -0
- package/dist/Table/components/TableBody/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TableBody/components/Compose/Compose.js +10 -0
- package/dist/Table/components/TableBodyCell/TableBodyCell.cjs +22 -0
- package/dist/Table/components/TableBodyCell/TableBodyCell.d.ts +12 -0
- package/dist/Table/components/TableBodyCell/TableBodyCell.js +22 -0
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.cjs +5 -0
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.js +5 -0
- package/dist/Table/components/TableBodyRow/TableBodyRow.cjs +38 -0
- package/dist/Table/components/TableBodyRow/TableBodyRow.d.ts +20 -0
- package/dist/Table/components/TableBodyRow/TableBodyRow.js +38 -0
- package/dist/Table/components/TableBodyRow/TableBodyRowExpandable.cjs +33 -0
- package/dist/Table/components/TableBodyRow/TableBodyRowExpandable.d.ts +2 -0
- package/dist/Table/components/TableBodyRow/TableBodyRowExpandable.js +33 -0
- package/dist/Table/components/TableBodyRow/components/Compose/Compose.cjs +17 -0
- package/dist/Table/components/TableBodyRow/components/Compose/Compose.d.ts +4 -0
- package/dist/Table/components/TableBodyRow/components/Compose/Compose.js +17 -0
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.cjs +3 -4
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.d.ts +1 -1
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.js +3 -4
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.cjs +9 -4
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.d.ts +1 -1
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.js +9 -4
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.types.d.ts +3 -5
- package/dist/Table/components/TableHeader/TableHeader.cjs +28 -0
- package/dist/Table/components/TableHeader/TableHeader.d.ts +21 -0
- package/dist/Table/components/TableHeader/TableHeader.js +28 -0
- package/dist/Table/components/TableHeader/components/Compose/Compose.cjs +5 -0
- package/dist/Table/components/TableHeader/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TableHeader/components/Compose/Compose.js +5 -0
- package/dist/Table/components/TableHeaderCell/SRSortingNotification.cjs +19 -0
- package/dist/Table/components/TableHeaderCell/SRSortingNotification.d.ts +1 -0
- package/dist/Table/components/TableHeaderCell/SRSortingNotification.js +19 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.cjs +19 -33
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.context.cjs +15 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.context.d.ts +8 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.context.js +15 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.d.ts +16 -4
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.js +19 -33
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.test.d.ts +1 -0
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.utils.cjs +0 -22
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.utils.d.ts +0 -1
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.utils.js +1 -23
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.cjs +40 -0
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.d.ts +9 -0
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.js +40 -0
- package/dist/Table/components/TableHeaderCell/components/Heading/Heading.cjs +34 -0
- package/dist/Table/components/TableHeaderCell/components/Heading/Heading.d.ts +5 -0
- package/dist/Table/components/TableHeaderCell/components/Heading/Heading.js +34 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/SortableHeading.cjs +16 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/SortableHeading.d.ts +8 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/SortableHeading.js +16 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/Compose/Compose.cjs +23 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/Compose/Compose.d.ts +5 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/Compose/Compose.js +23 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/SortIndicator/SortIndicator.cjs +6 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/SortIndicator/SortIndicator.d.ts +2 -0
- package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/SortIndicator/SortIndicator.js +6 -0
- package/dist/Table/components/TableHeaderRow/TableHeaderRow.cjs +27 -0
- package/dist/Table/components/TableHeaderRow/TableHeaderRow.d.ts +12 -0
- package/dist/Table/components/TableHeaderRow/TableHeaderRow.js +27 -0
- package/dist/Table/components/TableHeaderRow/components/Compose/Compose.cjs +5 -0
- package/dist/Table/components/TableHeaderRow/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TableHeaderRow/components/Compose/Compose.js +5 -0
- package/dist/Table/components/TablePagination/TablePagination.cjs +65 -99
- package/dist/Table/components/TablePagination/TablePagination.d.ts +23 -3
- package/dist/Table/components/TablePagination/TablePagination.js +66 -100
- package/dist/Table/components/TablePagination/TablePagination.style.cjs +70 -50
- package/dist/Table/components/TablePagination/TablePagination.style.d.ts +17 -50
- package/dist/Table/components/TablePagination/TablePagination.style.js +72 -52
- package/dist/Table/components/TablePagination/components/Compose/Compose.cjs +41 -0
- package/dist/Table/components/TablePagination/components/Compose/Compose.d.ts +3 -0
- package/dist/Table/components/TablePagination/components/Compose/Compose.js +41 -0
- package/dist/Table/components/TableRoot/TableRoot.cjs +5 -0
- package/dist/Table/components/TableRoot/TableRoot.d.ts +1 -0
- package/dist/Table/components/TableRoot/TableRoot.js +5 -0
- package/dist/Table/index.d.ts +3 -6
- package/dist/Table/plugins/ClickableRowPlugin.cjs +48 -0
- package/dist/Table/plugins/ClickableRowPlugin.d.ts +25 -0
- package/dist/Table/plugins/ClickableRowPlugin.js +48 -0
- package/dist/Table/plugins/ExpandableRowPlugin.cjs +38 -0
- package/dist/Table/plugins/ExpandableRowPlugin.d.ts +22 -0
- package/dist/Table/plugins/ExpandableRowPlugin.js +38 -0
- package/dist/Table/plugins/PaginationPlugin.cjs +45 -0
- package/dist/Table/plugins/PaginationPlugin.d.ts +16 -0
- package/dist/Table/plugins/PaginationPlugin.js +45 -0
- package/dist/Table/plugins/RowSelectionPlugin.cjs +28 -0
- package/dist/Table/plugins/RowSelectionPlugin.d.ts +12 -0
- package/dist/Table/plugins/RowSelectionPlugin.js +28 -0
- package/dist/Table/plugins/SortingPlugin.cjs +44 -0
- package/dist/Table/plugins/SortingPlugin.d.ts +18 -0
- package/dist/Table/plugins/SortingPlugin.js +44 -0
- package/dist/Table/tanStackExtendedTypes.d.ts +11 -0
- package/dist/Table/utils/plugin.utils.cjs +49 -0
- package/dist/Table/utils/plugin.utils.d.ts +17 -0
- package/dist/Table/utils/plugin.utils.js +49 -0
- package/dist/Table/utils/plugin.utils.test.d.ts +1 -0
- package/dist/index.cjs +60 -0
- package/dist/index.js +61 -1
- package/dist/node_modules/@tanstack/react-table/build/lib/index.cjs +7 -0
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js +8 -1
- package/dist/node_modules/@tanstack/table-core/build/lib/index.cjs +361 -4
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +361 -4
- package/package.json +6 -5
- package/dist/Table/components/EmptyStateRow/EmptyStateRow.cjs +0 -16
- package/dist/Table/components/EmptyStateRow/EmptyStateRow.d.ts +0 -8
- package/dist/Table/components/EmptyStateRow/EmptyStateRow.js +0 -16
- package/dist/node_modules/@radix-ui/react-id/dist/index.cjs +0 -32
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +0 -14
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +0 -24
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -6
|
@@ -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, stripedRows, ...restProps }: import("../Compose/Compose").TableComposeProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Root: import("styled-components").StyledComponent<"table", any, {}, never>;
|
|
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<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element) & {
|
|
17
|
+
Compose: ((props: import("@redislabsdev/redis-ui-components").ComposeElementProps<HTMLDivElement>) => 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: import("styled-components").StyledComponent<"td", any, {}, never>;
|
|
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
|
+
};
|
|
@@ -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: import("styled-components").StyledComponent<"td", any, {}, never>;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { useTableContext, useComposeContext } from "../../Table.context.js";
|
|
3
|
+
import { TableBodyCell } from "../TableBodyCell/TableBodyCell.js";
|
|
4
|
+
import { TableBodyRow } from "../TableBodyRow/TableBodyRow.js";
|
|
5
|
+
import { TableBodyCompose } from "./components/Compose/Compose.js";
|
|
6
|
+
import { TableBodyRowExpandable } from "../TableBodyRow/TableBodyRowExpandable.js";
|
|
7
|
+
const TableBody = Object.assign((props) => {
|
|
8
|
+
const {
|
|
9
|
+
table
|
|
10
|
+
} = useTableContext();
|
|
11
|
+
const {
|
|
12
|
+
TableBodyRow: Row
|
|
13
|
+
} = useComposeContext({
|
|
14
|
+
TableBodyRow: TableBodyRowExpandable
|
|
15
|
+
});
|
|
16
|
+
const {
|
|
17
|
+
rows
|
|
18
|
+
} = table.getRowModel();
|
|
19
|
+
return rows.length ? jsxRuntimeExports.jsx(TableBody.Compose, {
|
|
20
|
+
...props,
|
|
21
|
+
children: rows.map((row) => jsxRuntimeExports.jsx(Row, {
|
|
22
|
+
row
|
|
23
|
+
}, row.id))
|
|
24
|
+
}) : null;
|
|
25
|
+
}, {
|
|
26
|
+
Compose: TableBodyCompose,
|
|
27
|
+
Row: TableBodyRow,
|
|
28
|
+
ExpandableRow: TableBodyRowExpandable,
|
|
29
|
+
Cell: TableBodyCell
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
TableBody
|
|
33
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("../../../../../node_modules/react/jsx-runtime.cjs");
|
|
4
|
+
const Table_style = require("../../../../Table.style.cjs");
|
|
5
|
+
const Table_context = require("../../../../Table.context.cjs");
|
|
6
|
+
const TableBodyCompose = (props) => jsxRuntime.jsxRuntimeExports.jsx(Table_style.TableBody, {
|
|
7
|
+
...props,
|
|
8
|
+
maxHeight: Table_context.useTableContext().maxHeight
|
|
9
|
+
});
|
|
10
|
+
exports.TableBodyCompose = TableBodyCompose;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { TableBody } from "../../../../Table.style.js";
|
|
3
|
+
import { useTableContext } from "../../../../Table.context.js";
|
|
4
|
+
const TableBodyCompose = (props) => jsxRuntimeExports.jsx(TableBody, {
|
|
5
|
+
...props,
|
|
6
|
+
maxHeight: useTableContext().maxHeight
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
TableBodyCompose
|
|
10
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
|
|
4
|
+
const index = require("../../../node_modules/@tanstack/react-table/build/lib/index.cjs");
|
|
5
|
+
const redisUiComponents = require("@redislabsdev/redis-ui-components");
|
|
6
|
+
const Compose = require("./components/Compose/Compose.cjs");
|
|
7
|
+
const TableBodyCell = Object.assign(redisUiComponents.forwardRefWithGenerics(({
|
|
8
|
+
cell,
|
|
9
|
+
style,
|
|
10
|
+
...restProps
|
|
11
|
+
}, ref) => jsxRuntime.jsxRuntimeExports.jsx(TableBodyCell.Compose, {
|
|
12
|
+
...restProps,
|
|
13
|
+
ref,
|
|
14
|
+
style: {
|
|
15
|
+
width: cell.column.getSize(),
|
|
16
|
+
...style
|
|
17
|
+
},
|
|
18
|
+
children: index.flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
19
|
+
})), {
|
|
20
|
+
Compose: Compose.TableBodyCellCompose
|
|
21
|
+
});
|
|
22
|
+
exports.TableBodyCell = TableBodyCell;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Cell } from '@tanstack/react-table';
|
|
3
|
+
import { ChildFree } from '@redislabsdev/redis-ui-components';
|
|
4
|
+
import { TableBodyCellComposeProps } from './components/Compose/Compose';
|
|
5
|
+
export type OwnTableBodyCellProps<T extends object> = {
|
|
6
|
+
cell: Cell<T, unknown>;
|
|
7
|
+
};
|
|
8
|
+
export type RestTableBodyCellProps = ChildFree<TableBodyCellComposeProps>;
|
|
9
|
+
export type TableBodyCellProps<T extends object> = OwnTableBodyCellProps<T> & RestTableBodyCellProps;
|
|
10
|
+
export declare const TableBodyCell: (<T extends object>(props: OwnTableBodyCellProps<T> & RestTableBodyCellProps & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null) & {
|
|
11
|
+
Compose: import("styled-components").StyledComponent<"td", any, {}, never>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { flexRender } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
3
|
+
import { forwardRefWithGenerics } from "@redislabsdev/redis-ui-components";
|
|
4
|
+
import { TableBodyCellCompose } from "./components/Compose/Compose.js";
|
|
5
|
+
const TableBodyCell = Object.assign(forwardRefWithGenerics(({
|
|
6
|
+
cell,
|
|
7
|
+
style,
|
|
8
|
+
...restProps
|
|
9
|
+
}, ref) => jsxRuntimeExports.jsx(TableBodyCell.Compose, {
|
|
10
|
+
...restProps,
|
|
11
|
+
ref,
|
|
12
|
+
style: {
|
|
13
|
+
width: cell.column.getSize(),
|
|
14
|
+
...style
|
|
15
|
+
},
|
|
16
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
17
|
+
})), {
|
|
18
|
+
Compose: TableBodyCellCompose
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
TableBodyCell
|
|
22
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
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 Table_context = require("../../Table.context.cjs");
|
|
6
|
+
const TableBodyCell = require("../TableBodyCell/TableBodyCell.cjs");
|
|
7
|
+
const Compose = require("./components/Compose/Compose.cjs");
|
|
8
|
+
const ClickableRowPlugin = require("../../plugins/ClickableRowPlugin.cjs");
|
|
9
|
+
const TableBodyRow = Object.assign(redisUiComponents.forwardRefWithGenerics(({
|
|
10
|
+
row,
|
|
11
|
+
onClick,
|
|
12
|
+
onKeyDown,
|
|
13
|
+
...restProps
|
|
14
|
+
}, ref) => {
|
|
15
|
+
const {
|
|
16
|
+
TableBodyCell: Cell
|
|
17
|
+
} = Table_context.useComposeContext({
|
|
18
|
+
TableBodyCell: TableBodyCell.TableBodyCell
|
|
19
|
+
});
|
|
20
|
+
const clickableProps = ClickableRowPlugin.useHandleClickableRow({
|
|
21
|
+
row,
|
|
22
|
+
onClick,
|
|
23
|
+
onKeyDown
|
|
24
|
+
});
|
|
25
|
+
return jsxRuntime.jsxRuntimeExports.jsx(TableBodyRow.Compose, {
|
|
26
|
+
tabIndex: 0,
|
|
27
|
+
...restProps,
|
|
28
|
+
...clickableProps,
|
|
29
|
+
ref,
|
|
30
|
+
children: row.getVisibleCells().map((cell) => jsxRuntime.jsxRuntimeExports.jsx(Cell, {
|
|
31
|
+
cell
|
|
32
|
+
}, cell.id))
|
|
33
|
+
});
|
|
34
|
+
}), {
|
|
35
|
+
Compose: Compose.TableBodyRowCompose,
|
|
36
|
+
useHandleClickableRow: ClickableRowPlugin.useHandleClickableRow
|
|
37
|
+
});
|
|
38
|
+
exports.TableBodyRow = TableBodyRow;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Row } from '@tanstack/react-table';
|
|
3
|
+
import { ChildFree } from '@redislabsdev/redis-ui-components';
|
|
4
|
+
import { TableBodyRowComposeProps } from './components/Compose/Compose';
|
|
5
|
+
export type OwnTableBodyRowProps<T extends object> = {
|
|
6
|
+
row: Row<T>;
|
|
7
|
+
};
|
|
8
|
+
export type RestTableBodyRowProps = ChildFree<TableBodyRowComposeProps>;
|
|
9
|
+
export type TableBodyRowProps<T extends object> = OwnTableBodyRowProps<T> & RestTableBodyRowProps;
|
|
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>, "content" | "children"> & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null;
|
|
12
|
+
useHandleClickableRow: <T_1 extends object>({ row, onClick, onKeyDown }: {
|
|
13
|
+
row: Row<T_1>;
|
|
14
|
+
onClick?: import("react").MouseEventHandler<HTMLTableRowElement> | undefined;
|
|
15
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLTableRowElement> | undefined;
|
|
16
|
+
}) => {
|
|
17
|
+
onClick: import("react").MouseEventHandler<HTMLTableRowElement> | undefined;
|
|
18
|
+
onKeyDown: ((event: import("react").KeyboardEvent<HTMLTableRowElement>) => void) | undefined;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { forwardRefWithGenerics } from "@redislabsdev/redis-ui-components";
|
|
3
|
+
import { useComposeContext } from "../../Table.context.js";
|
|
4
|
+
import { TableBodyCell } from "../TableBodyCell/TableBodyCell.js";
|
|
5
|
+
import { TableBodyRowCompose } from "./components/Compose/Compose.js";
|
|
6
|
+
import { useHandleClickableRow } from "../../plugins/ClickableRowPlugin.js";
|
|
7
|
+
const TableBodyRow = Object.assign(forwardRefWithGenerics(({
|
|
8
|
+
row,
|
|
9
|
+
onClick,
|
|
10
|
+
onKeyDown,
|
|
11
|
+
...restProps
|
|
12
|
+
}, ref) => {
|
|
13
|
+
const {
|
|
14
|
+
TableBodyCell: Cell
|
|
15
|
+
} = useComposeContext({
|
|
16
|
+
TableBodyCell
|
|
17
|
+
});
|
|
18
|
+
const clickableProps = useHandleClickableRow({
|
|
19
|
+
row,
|
|
20
|
+
onClick,
|
|
21
|
+
onKeyDown
|
|
22
|
+
});
|
|
23
|
+
return jsxRuntimeExports.jsx(TableBodyRow.Compose, {
|
|
24
|
+
tabIndex: 0,
|
|
25
|
+
...restProps,
|
|
26
|
+
...clickableProps,
|
|
27
|
+
ref,
|
|
28
|
+
children: row.getVisibleCells().map((cell) => jsxRuntimeExports.jsx(Cell, {
|
|
29
|
+
cell
|
|
30
|
+
}, cell.id))
|
|
31
|
+
});
|
|
32
|
+
}), {
|
|
33
|
+
Compose: TableBodyRowCompose,
|
|
34
|
+
useHandleClickableRow
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
TableBodyRow
|
|
38
|
+
};
|
|
@@ -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 redisUiComponents = require("@redislabsdev/redis-ui-components");
|
|
5
|
+
const ExpandableRowPlugin = require("../../plugins/ExpandableRowPlugin.cjs");
|
|
6
|
+
const TableExpandedRow = require("../TableExpandedRow/TableExpandedRow.cjs");
|
|
7
|
+
require("react");
|
|
8
|
+
require("../TableExpandedRow/TableAnimatedExpandedRow.style.cjs");
|
|
9
|
+
const TableBodyRow = require("./TableBodyRow.cjs");
|
|
10
|
+
const TableBodyRowExpandable = redisUiComponents.forwardRefWithGenerics(({
|
|
11
|
+
row,
|
|
12
|
+
...restProps
|
|
13
|
+
}, ref) => {
|
|
14
|
+
const {
|
|
15
|
+
renderExpandedRow,
|
|
16
|
+
expandedRowComponent: ExpandedRow = TableExpandedRow.TableExpandedRow
|
|
17
|
+
} = ExpandableRowPlugin.useExpandableRowContext() || {};
|
|
18
|
+
return jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, {
|
|
19
|
+
children: [
|
|
20
|
+
jsxRuntime.jsxRuntimeExports.jsx(TableBodyRow.TableBodyRow, {
|
|
21
|
+
...restProps,
|
|
22
|
+
row,
|
|
23
|
+
"data-row-type": "regular",
|
|
24
|
+
ref
|
|
25
|
+
}),
|
|
26
|
+
// 2nd row is a custom 1 cell row for expanded part
|
|
27
|
+
renderExpandedRow && row.getCanExpand() && jsxRuntime.jsxRuntimeExports.jsx(ExpandedRow, {
|
|
28
|
+
row
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
exports.TableBodyRowExpandable = TableBodyRowExpandable;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const TableBodyRowExpandable: <T extends object>(props: import("./TableBodyRow").OwnTableBodyRowProps<T> & import("./TableBodyRow").RestTableBodyRowProps & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { forwardRefWithGenerics } from "@redislabsdev/redis-ui-components";
|
|
3
|
+
import { useExpandableRowContext } from "../../plugins/ExpandableRowPlugin.js";
|
|
4
|
+
import { TableExpandedRow } from "../TableExpandedRow/TableExpandedRow.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "../TableExpandedRow/TableAnimatedExpandedRow.style.js";
|
|
7
|
+
import { TableBodyRow } from "./TableBodyRow.js";
|
|
8
|
+
const TableBodyRowExpandable = forwardRefWithGenerics(({
|
|
9
|
+
row,
|
|
10
|
+
...restProps
|
|
11
|
+
}, ref) => {
|
|
12
|
+
const {
|
|
13
|
+
renderExpandedRow,
|
|
14
|
+
expandedRowComponent: ExpandedRow = TableExpandedRow
|
|
15
|
+
} = useExpandableRowContext() || {};
|
|
16
|
+
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
17
|
+
children: [
|
|
18
|
+
jsxRuntimeExports.jsx(TableBodyRow, {
|
|
19
|
+
...restProps,
|
|
20
|
+
row,
|
|
21
|
+
"data-row-type": "regular",
|
|
22
|
+
ref
|
|
23
|
+
}),
|
|
24
|
+
// 2nd row is a custom 1 cell row for expanded part
|
|
25
|
+
renderExpandedRow && row.getCanExpand() && jsxRuntimeExports.jsx(ExpandedRow, {
|
|
26
|
+
row
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
TableBodyRowExpandable
|
|
33
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
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 Table_context = require("../../../../Table.context.cjs");
|
|
6
|
+
const Table_style = require("../../../../Table.style.cjs");
|
|
7
|
+
const TableBodyRowCompose = redisUiComponents.forwardRefWithGenerics((props, ref) => {
|
|
8
|
+
const {
|
|
9
|
+
stripedRows = false
|
|
10
|
+
} = Table_context.useTableContext();
|
|
11
|
+
return jsxRuntime.jsxRuntimeExports.jsx(Table_style.TableBodyRow, {
|
|
12
|
+
...props,
|
|
13
|
+
ref,
|
|
14
|
+
"$stripedRows": stripedRows
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
exports.TableBodyRowCompose = TableBodyRowCompose;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComposeElementProps } from '@redislabsdev/redis-ui-components';
|
|
3
|
+
export type TableBodyRowComposeProps = ComposeElementProps<HTMLTableRowElement>;
|
|
4
|
+
export declare const TableBodyRowCompose: (props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableRowElement>, "content" | "children"> & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { forwardRefWithGenerics } from "@redislabsdev/redis-ui-components";
|
|
3
|
+
import { useTableContext } from "../../../../Table.context.js";
|
|
4
|
+
import { TableBodyRow } from "../../../../Table.style.js";
|
|
5
|
+
const TableBodyRowCompose = forwardRefWithGenerics((props, ref) => {
|
|
6
|
+
const {
|
|
7
|
+
stripedRows = false
|
|
8
|
+
} = useTableContext();
|
|
9
|
+
return jsxRuntimeExports.jsx(TableBodyRow, {
|
|
10
|
+
...props,
|
|
11
|
+
ref,
|
|
12
|
+
"$stripedRows": stripedRows
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
TableBodyRowCompose
|
|
17
|
+
};
|
|
@@ -5,14 +5,14 @@ const React = require("react");
|
|
|
5
5
|
const index = require("../../../node_modules/@radix-ui/react-compose-refs/dist/index.cjs");
|
|
6
6
|
const TableAnimatedExpandedRow_style = require("./TableAnimatedExpandedRow.style.cjs");
|
|
7
7
|
const TableAnimatedExpandedRow = ({
|
|
8
|
-
expanded,
|
|
9
8
|
rowRef,
|
|
10
9
|
...restProps
|
|
11
10
|
}) => {
|
|
12
11
|
const innerRowRef = React.useRef(null);
|
|
13
12
|
const composedRowRef = index.useComposedRefs(rowRef, innerRowRef);
|
|
13
|
+
const isExpanded = restProps.row.getIsExpanded();
|
|
14
14
|
React.useEffect(() => {
|
|
15
|
-
if (
|
|
15
|
+
if (isExpanded) {
|
|
16
16
|
const timer = setTimeout(() => {
|
|
17
17
|
var _a;
|
|
18
18
|
return (_a = innerRowRef.current) == null ? void 0 : _a.scrollIntoView({
|
|
@@ -23,10 +23,9 @@ const TableAnimatedExpandedRow = ({
|
|
|
23
23
|
return () => clearTimeout(timer);
|
|
24
24
|
}
|
|
25
25
|
return void 0;
|
|
26
|
-
}, [
|
|
26
|
+
}, [isExpanded]);
|
|
27
27
|
return jsxRuntime.jsxRuntimeExports.jsx(TableAnimatedExpandedRow_style.AnimatedExpandedRow, {
|
|
28
28
|
rowRef: composedRowRef,
|
|
29
|
-
expanded,
|
|
30
29
|
...restProps,
|
|
31
30
|
keepInDom: true
|
|
32
31
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TableExpandedRowProps } from './TableExpandedRow.types';
|
|
2
|
-
export declare const TableAnimatedExpandedRow: <T extends object>({
|
|
2
|
+
export declare const TableAnimatedExpandedRow: <T extends object>({ rowRef, ...restProps }: TableExpandedRowProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,14 +3,14 @@ import { useRef, useEffect } from "react";
|
|
|
3
3
|
import { useComposedRefs } from "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js";
|
|
4
4
|
import { AnimatedExpandedRow } from "./TableAnimatedExpandedRow.style.js";
|
|
5
5
|
const TableAnimatedExpandedRow = ({
|
|
6
|
-
expanded,
|
|
7
6
|
rowRef,
|
|
8
7
|
...restProps
|
|
9
8
|
}) => {
|
|
10
9
|
const innerRowRef = useRef(null);
|
|
11
10
|
const composedRowRef = useComposedRefs(rowRef, innerRowRef);
|
|
11
|
+
const isExpanded = restProps.row.getIsExpanded();
|
|
12
12
|
useEffect(() => {
|
|
13
|
-
if (
|
|
13
|
+
if (isExpanded) {
|
|
14
14
|
const timer = setTimeout(() => {
|
|
15
15
|
var _a;
|
|
16
16
|
return (_a = innerRowRef.current) == null ? void 0 : _a.scrollIntoView({
|
|
@@ -21,10 +21,9 @@ const TableAnimatedExpandedRow = ({
|
|
|
21
21
|
return () => clearTimeout(timer);
|
|
22
22
|
}
|
|
23
23
|
return void 0;
|
|
24
|
-
}, [
|
|
24
|
+
}, [isExpanded]);
|
|
25
25
|
return jsxRuntimeExports.jsx(AnimatedExpandedRow, {
|
|
26
26
|
rowRef: composedRowRef,
|
|
27
|
-
expanded,
|
|
28
27
|
...restProps,
|
|
29
28
|
keepInDom: true
|
|
30
29
|
});
|