@redis-ui/table 2.25.0 → 3.4.1
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 +27 -4
- package/dist/Table/Table.context.d.ts +0 -1
- package/dist/Table/Table.d.ts +18 -14
- package/dist/Table/Table.js +27 -4
- package/dist/Table/Table.style.cjs +65 -39
- package/dist/Table/Table.style.d.ts +9 -6
- package/dist/Table/Table.style.js +65 -39
- package/dist/Table/Table.types.d.ts +13 -20
- package/dist/Table/components/Compose/Compose.cjs +2 -3
- package/dist/Table/components/Compose/Compose.d.ts +1 -1
- package/dist/Table/components/Compose/Compose.js +2 -3
- package/dist/Table/components/PluggableTable/PluggableTable.cjs +7 -1
- package/dist/Table/components/PluggableTable/PluggableTable.d.ts +3 -1
- package/dist/Table/components/PluggableTable/PluggableTable.js +7 -1
- package/dist/Table/components/PluggableTable/compositionComponents.cjs +4 -0
- package/dist/Table/components/PluggableTable/compositionComponents.d.ts +6 -4
- package/dist/Table/components/PluggableTable/compositionComponents.js +4 -0
- package/dist/Table/components/TableBody/TableBody.d.ts +2 -2
- package/dist/Table/components/TableBodyCell/TableBodyCell.d.ts +1 -1
- package/dist/Table/components/TableBodyCell/components/CellContainers/CellContainers.cjs +21 -0
- package/dist/Table/components/TableBodyCell/components/CellContainers/CellContainers.d.ts +2 -0
- package/dist/Table/components/TableBodyCell/components/CellContainers/CellContainers.js +21 -0
- package/dist/Table/components/TableBodyCell/components/CellContainers/CellContainers.style.cjs +16 -0
- package/dist/Table/components/TableBodyCell/components/CellContainers/CellContainers.style.d.ts +3 -0
- package/dist/Table/components/TableBodyCell/components/CellContainers/CellContainers.style.js +14 -0
- package/dist/Table/components/TableBodyCell/components/CellContainers/CellContainers.test.d.ts +1 -0
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.cjs +12 -3
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.d.ts +1 -1
- package/dist/Table/components/TableBodyCell/components/Compose/Compose.js +12 -3
- package/dist/Table/components/TableBodyRow/TableBodyRow.d.ts +1 -1
- package/dist/Table/components/TableBodyRow/components/Compose/Compose.d.ts +1 -1
- package/dist/Table/components/TableBottomBar/TableBottomBar.cjs +12 -0
- package/dist/Table/components/TableBottomBar/TableBottomBar.d.ts +2 -0
- package/dist/Table/components/TableBottomBar/TableBottomBar.js +12 -0
- package/dist/Table/components/TableBottomBar/TableBottomBar.test.d.ts +1 -0
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.cjs +8 -1
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.d.ts +1 -1
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.js +9 -2
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.style.cjs +11 -1
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.style.d.ts +3 -2
- package/dist/Table/components/TableExpandedRow/TableAnimatedExpandedRow.style.js +11 -1
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.cjs +2 -1
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.d.ts +1 -1
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.js +2 -1
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.style.cjs +2 -2
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.style.js +2 -2
- package/dist/Table/components/TableExpandedRow/TableExpandedRow.types.d.ts +3 -2
- package/dist/Table/components/TableHeader/TableHeader.d.ts +1 -1
- package/dist/Table/components/TableHeaderCell/TableHeaderCell.d.ts +1 -1
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.cjs +1 -1
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.d.ts +1 -1
- package/dist/Table/components/TableHeaderCell/components/Compose/Compose.js +2 -2
- package/dist/Table/components/TablePagination/TablePagination.style.cjs +1 -1
- package/dist/Table/components/TablePagination/TablePagination.style.js +1 -1
- package/dist/Table/components/TableRoot/TableRoot.cjs +6 -3
- package/dist/Table/components/TableRoot/TableRoot.js +7 -4
- package/dist/Table/components/TableTopBar/TableTopBar.cjs +12 -0
- package/dist/Table/components/TableTopBar/TableTopBar.d.ts +2 -0
- package/dist/Table/components/TableTopBar/TableTopBar.js +12 -0
- package/dist/Table/components/TableTopBar/TableTopBar.test.d.ts +1 -0
- package/dist/Table/index.d.ts +1 -0
- package/dist/Table/plugins/ColumnVisibilityPlugin.cjs +14 -0
- package/dist/Table/plugins/ColumnVisibilityPlugin.d.ts +10 -0
- package/dist/Table/plugins/ColumnVisibilityPlugin.js +14 -0
- package/dist/Table/plugins/ColumnVisibilityPlugin.test.d.ts +1 -0
- package/dist/Table/plugins/FilteringPlugin.cjs +25 -0
- package/dist/Table/plugins/FilteringPlugin.d.ts +20 -0
- package/dist/Table/plugins/FilteringPlugin.js +25 -0
- package/dist/Table/plugins/FilteringPlugin.test.d.ts +1 -0
- package/dist/Table/tanStackExtendedTypes.d.ts +5 -3
- package/dist/Table/utils/table.utils.cjs +13 -0
- package/dist/Table/utils/table.utils.d.ts +12 -0
- package/dist/Table/utils/table.utils.js +13 -0
- package/dist/index.cjs +2 -0
- package/dist/index.js +2 -0
- package/package.json +4 -4
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const Table_style = require("../../Table.style.cjs");
|
|
6
|
+
const TableBottomBar = (props) => (
|
|
7
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
8
|
+
React.Children.toArray(props.children).filter((ch) => ch !== "").length ? jsxRuntime.jsxRuntimeExports.jsx(Table_style.TableBottomBar, {
|
|
9
|
+
...props
|
|
10
|
+
}) : null
|
|
11
|
+
);
|
|
12
|
+
exports.TableBottomBar = TableBottomBar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { Children } from "react";
|
|
3
|
+
import { TableBottomBar as TableBottomBar$1 } from "../../Table.style.js";
|
|
4
|
+
const TableBottomBar = (props) => (
|
|
5
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
6
|
+
Children.toArray(props.children).filter((ch) => ch !== "").length ? jsxRuntimeExports.jsx(TableBottomBar$1, {
|
|
7
|
+
...props
|
|
8
|
+
}) : null
|
|
9
|
+
);
|
|
10
|
+
export {
|
|
11
|
+
TableBottomBar
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,6 +6,7 @@ const index = require("../../../node_modules/@radix-ui/react-compose-refs/dist/i
|
|
|
6
6
|
const TableAnimatedExpandedRow_style = require("./TableAnimatedExpandedRow.style.cjs");
|
|
7
7
|
const TableAnimatedExpandedRow = ({
|
|
8
8
|
rowRef,
|
|
9
|
+
contentWrapper = (content) => content,
|
|
9
10
|
...restProps
|
|
10
11
|
}) => {
|
|
11
12
|
const innerRowRef = React.useRef(null);
|
|
@@ -24,10 +25,16 @@ const TableAnimatedExpandedRow = ({
|
|
|
24
25
|
}
|
|
25
26
|
return void 0;
|
|
26
27
|
}, [isExpanded]);
|
|
28
|
+
const wrapContentForAnimation = (content) => jsxRuntime.jsxRuntimeExports.jsx(TableAnimatedExpandedRow_style.AnimatedContainer, {
|
|
29
|
+
children: jsxRuntime.jsxRuntimeExports.jsx(TableAnimatedExpandedRow_style.AnimatedContent, {
|
|
30
|
+
children: contentWrapper(content)
|
|
31
|
+
})
|
|
32
|
+
});
|
|
27
33
|
return jsxRuntime.jsxRuntimeExports.jsx(TableAnimatedExpandedRow_style.AnimatedExpandedRow, {
|
|
28
34
|
rowRef: composedRowRef,
|
|
29
35
|
...restProps,
|
|
30
|
-
keepInDom: true
|
|
36
|
+
keepInDom: true,
|
|
37
|
+
contentWrapper: wrapContentForAnimation
|
|
31
38
|
});
|
|
32
39
|
};
|
|
33
40
|
exports.TableAnimatedExpandedRow = TableAnimatedExpandedRow;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TableExpandedRowProps } from './TableExpandedRow.types';
|
|
2
|
-
export declare const TableAnimatedExpandedRow: <T extends object>({ rowRef, ...restProps }: TableExpandedRowProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const TableAnimatedExpandedRow: <T extends object>({ rowRef, contentWrapper, ...restProps }: TableExpandedRowProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
2
|
import { useRef, useEffect } from "react";
|
|
3
3
|
import { useComposedRefs } from "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js";
|
|
4
|
-
import { AnimatedExpandedRow } from "./TableAnimatedExpandedRow.style.js";
|
|
4
|
+
import { AnimatedExpandedRow, AnimatedContainer, AnimatedContent } from "./TableAnimatedExpandedRow.style.js";
|
|
5
5
|
const TableAnimatedExpandedRow = ({
|
|
6
6
|
rowRef,
|
|
7
|
+
contentWrapper = (content) => content,
|
|
7
8
|
...restProps
|
|
8
9
|
}) => {
|
|
9
10
|
const innerRowRef = useRef(null);
|
|
@@ -22,10 +23,16 @@ const TableAnimatedExpandedRow = ({
|
|
|
22
23
|
}
|
|
23
24
|
return void 0;
|
|
24
25
|
}, [isExpanded]);
|
|
26
|
+
const wrapContentForAnimation = (content) => jsxRuntimeExports.jsx(AnimatedContainer, {
|
|
27
|
+
children: jsxRuntimeExports.jsx(AnimatedContent, {
|
|
28
|
+
children: contentWrapper(content)
|
|
29
|
+
})
|
|
30
|
+
});
|
|
25
31
|
return jsxRuntimeExports.jsx(AnimatedExpandedRow, {
|
|
26
32
|
rowRef: composedRowRef,
|
|
27
33
|
...restProps,
|
|
28
|
-
keepInDom: true
|
|
34
|
+
keepInDom: true,
|
|
35
|
+
contentWrapper: wrapContentForAnimation
|
|
29
36
|
});
|
|
30
37
|
};
|
|
31
38
|
export {
|
|
@@ -7,5 +7,15 @@ const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
|
|
|
7
7
|
const AnimatedExpandedRow = _styled__default.default(TableExpandedRow.TableExpandedRow).withConfig({
|
|
8
8
|
displayName: "TableAnimatedExpandedRowstyle__AnimatedExpandedRow",
|
|
9
9
|
componentId: "RedisUI__sc-l3awb3-0"
|
|
10
|
-
})(["&&{display:
|
|
10
|
+
})(["@supports not (transition-behavior:allow-discrete){&&{display:table-row;}visibility:hidden;&[data-expanded='true']{visibility:visible;}}transition:all 0.5s;transition-behavior:allow-discrete;"]);
|
|
11
|
+
const AnimatedContainer = _styled__default.default.div.withConfig({
|
|
12
|
+
displayName: "TableAnimatedExpandedRowstyle__AnimatedContainer",
|
|
13
|
+
componentId: "RedisUI__sc-l3awb3-1"
|
|
14
|
+
})(["min-height:0;overflow:hidden;display:grid;grid-template-rows:0fr;transition:all 0.5s;[data-expanded='true']:where(", ") &{grid-template-rows:1fr;}@starting-style{&&{grid-template-rows:0fr;}}"], AnimatedExpandedRow);
|
|
15
|
+
const AnimatedContent = _styled__default.default.div.withConfig({
|
|
16
|
+
displayName: "TableAnimatedExpandedRowstyle__AnimatedContent",
|
|
17
|
+
componentId: "RedisUI__sc-l3awb3-2"
|
|
18
|
+
})(["min-height:0;overflow:hidden;"]);
|
|
19
|
+
exports.AnimatedContainer = AnimatedContainer;
|
|
20
|
+
exports.AnimatedContent = AnimatedContent;
|
|
11
21
|
exports.AnimatedExpandedRow = AnimatedExpandedRow;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const AnimatedExpandedRow: import("styled-components").StyledComponent<(<T extends object>({ row, keepInDom, rowRef, contentWrapper, ...restProps }: import("./TableExpandedRow.types").TableExpandedRowProps<T>) => import("react/jsx-runtime").JSX.Element | null), any, {}, never>;
|
|
2
|
+
export declare const AnimatedContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const AnimatedContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -3,7 +3,17 @@ import { TableExpandedRow } from "./TableExpandedRow.js";
|
|
|
3
3
|
const AnimatedExpandedRow = _styled(TableExpandedRow).withConfig({
|
|
4
4
|
displayName: "TableAnimatedExpandedRowstyle__AnimatedExpandedRow",
|
|
5
5
|
componentId: "RedisUI__sc-l3awb3-0"
|
|
6
|
-
})(["&&{display:
|
|
6
|
+
})(["@supports not (transition-behavior:allow-discrete){&&{display:table-row;}visibility:hidden;&[data-expanded='true']{visibility:visible;}}transition:all 0.5s;transition-behavior:allow-discrete;"]);
|
|
7
|
+
const AnimatedContainer = _styled.div.withConfig({
|
|
8
|
+
displayName: "TableAnimatedExpandedRowstyle__AnimatedContainer",
|
|
9
|
+
componentId: "RedisUI__sc-l3awb3-1"
|
|
10
|
+
})(["min-height:0;overflow:hidden;display:grid;grid-template-rows:0fr;transition:all 0.5s;[data-expanded='true']:where(", ") &{grid-template-rows:1fr;}@starting-style{&&{grid-template-rows:0fr;}}"], AnimatedExpandedRow);
|
|
11
|
+
const AnimatedContent = _styled.div.withConfig({
|
|
12
|
+
displayName: "TableAnimatedExpandedRowstyle__AnimatedContent",
|
|
13
|
+
componentId: "RedisUI__sc-l3awb3-2"
|
|
14
|
+
})(["min-height:0;overflow:hidden;"]);
|
|
7
15
|
export {
|
|
16
|
+
AnimatedContainer,
|
|
17
|
+
AnimatedContent,
|
|
8
18
|
AnimatedExpandedRow
|
|
9
19
|
};
|
|
@@ -9,6 +9,7 @@ const TableExpandedRow = ({
|
|
|
9
9
|
row,
|
|
10
10
|
keepInDom,
|
|
11
11
|
rowRef,
|
|
12
|
+
contentWrapper = (content) => content,
|
|
12
13
|
...restProps
|
|
13
14
|
}) => {
|
|
14
15
|
const innerRowRef = React.useRef(null);
|
|
@@ -34,7 +35,7 @@ const TableExpandedRow = ({
|
|
|
34
35
|
...restProps,
|
|
35
36
|
children: jsxRuntime.jsxRuntimeExports.jsx(TableExpandedRow_style.ExpandedCell, {
|
|
36
37
|
colSpan: row.getVisibleCells().length,
|
|
37
|
-
children: renderExpandedRow(row)
|
|
38
|
+
children: contentWrapper(renderExpandedRow(row))
|
|
38
39
|
})
|
|
39
40
|
}) : null;
|
|
40
41
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TableExpandedRowProps } from './TableExpandedRow.types';
|
|
2
|
-
export declare const TableExpandedRow: <T extends object>({ row, keepInDom, rowRef, ...restProps }: TableExpandedRowProps<T>) => import("react/jsx-runtime").JSX.Element | null;
|
|
2
|
+
export declare const TableExpandedRow: <T extends object>({ row, keepInDom, rowRef, contentWrapper, ...restProps }: TableExpandedRowProps<T>) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -7,6 +7,7 @@ const TableExpandedRow = ({
|
|
|
7
7
|
row,
|
|
8
8
|
keepInDom,
|
|
9
9
|
rowRef,
|
|
10
|
+
contentWrapper = (content) => content,
|
|
10
11
|
...restProps
|
|
11
12
|
}) => {
|
|
12
13
|
const innerRowRef = useRef(null);
|
|
@@ -32,7 +33,7 @@ const TableExpandedRow = ({
|
|
|
32
33
|
...restProps,
|
|
33
34
|
children: jsxRuntimeExports.jsx(ExpandedCell, {
|
|
34
35
|
colSpan: row.getVisibleCells().length,
|
|
35
|
-
children: renderExpandedRow(row)
|
|
36
|
+
children: contentWrapper(renderExpandedRow(row))
|
|
36
37
|
})
|
|
37
38
|
}) : null;
|
|
38
39
|
};
|
|
@@ -6,10 +6,10 @@ const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
|
|
|
6
6
|
const ExpandedRow = _styled__default.default.tr.withConfig({
|
|
7
7
|
displayName: "TableExpandedRowstyle__ExpandedRow",
|
|
8
8
|
componentId: "RedisUI__sc-2hwl98-0"
|
|
9
|
-
})(["
|
|
9
|
+
})(["&[data-expanded='false']{display:none;}"]);
|
|
10
10
|
const ExpandedCell = _styled__default.default.td.withConfig({
|
|
11
11
|
displayName: "TableExpandedRowstyle__ExpandedCell",
|
|
12
12
|
componentId: "RedisUI__sc-2hwl98-1"
|
|
13
|
-
})(["
|
|
13
|
+
})(["padding:0;overflow:hidden;"]);
|
|
14
14
|
exports.ExpandedCell = ExpandedCell;
|
|
15
15
|
exports.ExpandedRow = ExpandedRow;
|
|
@@ -2,11 +2,11 @@ import _styled from "styled-components";
|
|
|
2
2
|
const ExpandedRow = _styled.tr.withConfig({
|
|
3
3
|
displayName: "TableExpandedRowstyle__ExpandedRow",
|
|
4
4
|
componentId: "RedisUI__sc-2hwl98-0"
|
|
5
|
-
})(["
|
|
5
|
+
})(["&[data-expanded='false']{display:none;}"]);
|
|
6
6
|
const ExpandedCell = _styled.td.withConfig({
|
|
7
7
|
displayName: "TableExpandedRowstyle__ExpandedCell",
|
|
8
8
|
componentId: "RedisUI__sc-2hwl98-1"
|
|
9
|
-
})(["
|
|
9
|
+
})(["padding:0;overflow:hidden;"]);
|
|
10
10
|
export {
|
|
11
11
|
ExpandedCell,
|
|
12
12
|
ExpandedRow
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { HTMLAttributes, Ref } from 'react';
|
|
1
|
+
import { HTMLAttributes, Ref, ReactNode } from 'react';
|
|
2
2
|
import { Row } from '@tanstack/react-table';
|
|
3
3
|
export type TableExpandedRowProps<T extends object> = {
|
|
4
4
|
row: Row<T>;
|
|
5
5
|
keepInDom?: boolean;
|
|
6
6
|
rowRef?: Ref<HTMLTableRowElement>;
|
|
7
|
-
|
|
7
|
+
contentWrapper?: (content: ReactNode) => ReactNode;
|
|
8
|
+
} & Omit<HTMLAttributes<HTMLTableRowElement>, 'children'>;
|
|
@@ -9,7 +9,7 @@ export declare const TableHeader: (<T extends object>(props: TableHeaderProps) =
|
|
|
9
9
|
Compose: import("styled-components").StyledComponent<"tr", any, {}, never>;
|
|
10
10
|
};
|
|
11
11
|
Cell: (<T_2 extends object>(props: import("../TableHeaderCell/TableHeaderCell").OwnTableHeaderCellProps<T_2> & import("../TableHeaderCell/TableHeaderCell").RestTableHeaderCellProps & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null) & {
|
|
12
|
-
Compose: <T_3 extends object>(props: import("../TableHeaderCell/components/Compose/Compose").OwnTableHeaderCellComposeProps<T_3> & import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "
|
|
12
|
+
Compose: <T_3 extends object>(props: import("../TableHeaderCell/components/Compose/Compose").OwnTableHeaderCellComposeProps<T_3> & import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "children" | "content"> & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null;
|
|
13
13
|
SortableHeading: (({ children, ...restProps }: import("@redislabsdev/redis-ui-components").ComposeElementProps<HTMLElement>) => import("react/jsx-runtime").JSX.Element) & {
|
|
14
14
|
Compose: ((props: import("@redislabsdev/redis-ui-components").ComposeElementProps<HTMLElement>) => import("react/jsx-runtime").JSX.Element) & {
|
|
15
15
|
SortIndicator: () => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -5,7 +5,7 @@ export type OwnTableHeaderCellProps<T extends object> = OwnTableHeaderCellCompos
|
|
|
5
5
|
export type RestTableHeaderCellProps = ChildFree<RestTableHeaderCellComposeProps>;
|
|
6
6
|
export type TableHeaderCellProps<T extends object> = OwnTableHeaderCellProps<T> & RestTableHeaderCellProps;
|
|
7
7
|
export declare const TableHeaderCell: (<T extends object>(props: OwnTableHeaderCellProps<T> & RestTableHeaderCellProps & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null) & {
|
|
8
|
-
Compose: <T_1 extends object>(props: OwnTableHeaderCellComposeProps<T_1> & import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "
|
|
8
|
+
Compose: <T_1 extends object>(props: OwnTableHeaderCellComposeProps<T_1> & import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "children" | "content"> & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null;
|
|
9
9
|
SortableHeading: (({ children, ...restProps }: import("@redislabsdev/redis-ui-components").ComposeElementProps<HTMLElement>) => import("react/jsx-runtime").JSX.Element) & {
|
|
10
10
|
Compose: ((props: import("@redislabsdev/redis-ui-components").ComposeElementProps<HTMLElement>) => import("react/jsx-runtime").JSX.Element) & {
|
|
11
11
|
SortIndicator: () => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -24,7 +24,7 @@ const TableHeaderCellCompose = redisUiComponents.forwardRefWithGenerics(({
|
|
|
24
24
|
value: React.useMemo(() => ({
|
|
25
25
|
header
|
|
26
26
|
}), [header]),
|
|
27
|
-
children: jsxRuntime.jsxRuntimeExports.jsx(Table_style.
|
|
27
|
+
children: jsxRuntime.jsxRuntimeExports.jsx(Table_style.TableHeaderCell, {
|
|
28
28
|
...restProps,
|
|
29
29
|
...columnCellProps,
|
|
30
30
|
ref,
|
|
@@ -6,4 +6,4 @@ export type OwnTableHeaderCellComposeProps<T extends object> = {
|
|
|
6
6
|
};
|
|
7
7
|
export type RestTableHeaderCellComposeProps = ComposeElementProps<HTMLTableCellElement>;
|
|
8
8
|
export type TableHeaderCellComposeProps<T extends object> = OwnTableHeaderCellComposeProps<T> & RestTableHeaderCellComposeProps;
|
|
9
|
-
export declare const TableHeaderCellCompose: <T extends object>(props: OwnTableHeaderCellComposeProps<T> & import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "
|
|
9
|
+
export declare const TableHeaderCellCompose: <T extends object>(props: OwnTableHeaderCellComposeProps<T> & import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "children" | "content"> & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null;
|
|
@@ -5,7 +5,7 @@ import { useMemo } from "react";
|
|
|
5
5
|
import { normalizeCellSpan, getCurrentAriaSort } from "../../TableHeaderCell.utils.js";
|
|
6
6
|
import { TableHeaderCellContextProvider } from "../../TableHeaderCell.context.js";
|
|
7
7
|
import { getWidth } from "../../../../utils/table.utils.js";
|
|
8
|
-
import {
|
|
8
|
+
import { TableHeaderCell } from "../../../../Table.style.js";
|
|
9
9
|
const TableHeaderCellCompose = forwardRefWithGenerics(({
|
|
10
10
|
header,
|
|
11
11
|
children,
|
|
@@ -22,7 +22,7 @@ const TableHeaderCellCompose = forwardRefWithGenerics(({
|
|
|
22
22
|
value: useMemo(() => ({
|
|
23
23
|
header
|
|
24
24
|
}), [header]),
|
|
25
|
-
children: jsxRuntimeExports.jsx(
|
|
25
|
+
children: jsxRuntimeExports.jsx(TableHeaderCell, {
|
|
26
26
|
...restProps,
|
|
27
27
|
...columnCellProps,
|
|
28
28
|
ref,
|
|
@@ -28,7 +28,7 @@ const PaginationBar = _styled__default.default(redisUiComponents.Pagination.Bar)
|
|
|
28
28
|
})).withConfig({
|
|
29
29
|
displayName: "TablePaginationstyle__PaginationBar",
|
|
30
30
|
componentId: "RedisUI__sc-ccqfi0-1"
|
|
31
|
-
})(["", " width:100%;overflow:auto hidden;> *{flex:none;}"], () => {
|
|
31
|
+
})(["", " flex:none;width:100%;overflow:auto hidden;> *{flex:none;}"], () => {
|
|
32
32
|
const styles = redisUiStyles.useTheme().components.table.pagination.bar;
|
|
33
33
|
return _styled.css`
|
|
34
34
|
font-size: ${styles.fontSize};
|
|
@@ -24,7 +24,7 @@ const PaginationBar = _styled(Pagination.Bar).attrs(({
|
|
|
24
24
|
})).withConfig({
|
|
25
25
|
displayName: "TablePaginationstyle__PaginationBar",
|
|
26
26
|
componentId: "RedisUI__sc-ccqfi0-1"
|
|
27
|
-
})(["", " width:100%;overflow:auto hidden;> *{flex:none;}"], () => {
|
|
27
|
+
})(["", " flex:none;width:100%;overflow:auto hidden;> *{flex:none;}"], () => {
|
|
28
28
|
const styles = useTheme().components.table.pagination.bar;
|
|
29
29
|
return css`
|
|
30
30
|
font-size: ${styles.fontSize};
|
|
@@ -5,9 +5,12 @@ const Table_style = require("../../Table.style.cjs");
|
|
|
5
5
|
const RowNavigationPlugin = require("../../plugins/RowNavigationPlugin.cjs");
|
|
6
6
|
const TableRoot = (props) => {
|
|
7
7
|
const navigationProps = RowNavigationPlugin.useHandleRowNavigationOnTable(props);
|
|
8
|
-
return jsxRuntime.jsxRuntimeExports.jsx(Table_style.
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
return jsxRuntime.jsxRuntimeExports.jsx(Table_style.TableScroller, {
|
|
9
|
+
"data-role": "table-scroller",
|
|
10
|
+
children: jsxRuntime.jsxRuntimeExports.jsx(Table_style.Table, {
|
|
11
|
+
...props,
|
|
12
|
+
...navigationProps
|
|
13
|
+
})
|
|
11
14
|
});
|
|
12
15
|
};
|
|
13
16
|
exports.TableRoot = TableRoot;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
-
import { Table } from "../../Table.style.js";
|
|
2
|
+
import { TableScroller, Table } from "../../Table.style.js";
|
|
3
3
|
import { useHandleRowNavigationOnTable } from "../../plugins/RowNavigationPlugin.js";
|
|
4
4
|
const TableRoot = (props) => {
|
|
5
5
|
const navigationProps = useHandleRowNavigationOnTable(props);
|
|
6
|
-
return jsxRuntimeExports.jsx(
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
return jsxRuntimeExports.jsx(TableScroller, {
|
|
7
|
+
"data-role": "table-scroller",
|
|
8
|
+
children: jsxRuntimeExports.jsx(Table, {
|
|
9
|
+
...props,
|
|
10
|
+
...navigationProps
|
|
11
|
+
})
|
|
9
12
|
});
|
|
10
13
|
};
|
|
11
14
|
export {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const Table_style = require("../../Table.style.cjs");
|
|
6
|
+
const TableTopBar = (props) => (
|
|
7
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
8
|
+
React.Children.toArray(props.children).filter((ch) => ch !== "").length ? jsxRuntime.jsxRuntimeExports.jsx(Table_style.TableTopBar, {
|
|
9
|
+
...props
|
|
10
|
+
}) : null
|
|
11
|
+
);
|
|
12
|
+
exports.TableTopBar = TableTopBar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { Children } from "react";
|
|
3
|
+
import { TableTopBar as TableTopBar$1 } from "../../Table.style.js";
|
|
4
|
+
const TableTopBar = (props) => (
|
|
5
|
+
// eslint-disable-next-line react/destructuring-assignment
|
|
6
|
+
Children.toArray(props.children).filter((ch) => ch !== "").length ? jsxRuntimeExports.jsx(TableTopBar$1, {
|
|
7
|
+
...props
|
|
8
|
+
}) : null
|
|
9
|
+
);
|
|
10
|
+
export {
|
|
11
|
+
TableTopBar
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/Table/index.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export { ShowOnRowHover } from './components/ShowOnRowHover/ShowOnRowHover.style
|
|
|
3
3
|
export * from './Table.types';
|
|
4
4
|
export * from './Table.context';
|
|
5
5
|
export { type TablePluginData, buildPluginContext } from './utils/plugin.utils';
|
|
6
|
+
export { calcTableMinSize } from './utils/table.utils';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const useColumnVisibilityPlugin = ({
|
|
4
|
+
columnVisibility
|
|
5
|
+
}) => {
|
|
6
|
+
return columnVisibility ? {
|
|
7
|
+
tableOptions: {
|
|
8
|
+
state: {
|
|
9
|
+
columnVisibility
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
} : void 0;
|
|
13
|
+
};
|
|
14
|
+
exports.useColumnVisibilityPlugin = useColumnVisibilityPlugin;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VisibilityState } from '@tanstack/react-table';
|
|
2
|
+
import { TablePluginData } from '../utils/plugin.utils';
|
|
3
|
+
export interface TableColumnVisibilityParams {
|
|
4
|
+
/** Map of column id to column visibility */
|
|
5
|
+
columnVisibility?: VisibilityState;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Table plugin that enables column visibility control from external state only.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useColumnVisibilityPlugin: ({ columnVisibility }: TableColumnVisibilityParams) => TablePluginData<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const index = require("../../node_modules/@tanstack/table-core/build/lib/index.cjs");
|
|
4
|
+
const useFilteringPlugin = ({
|
|
5
|
+
globalFilter,
|
|
6
|
+
globalFilterFn = "includesString",
|
|
7
|
+
columnFilters,
|
|
8
|
+
enableFiltering = !!globalFilter || !!(columnFilters == null ? void 0 : columnFilters.length),
|
|
9
|
+
filterFns
|
|
10
|
+
} = {}) => {
|
|
11
|
+
return enableFiltering ? {
|
|
12
|
+
tableOptions: {
|
|
13
|
+
getFilteredRowModel: index.getFilteredRowModel(),
|
|
14
|
+
state: {
|
|
15
|
+
globalFilter,
|
|
16
|
+
columnFilters
|
|
17
|
+
},
|
|
18
|
+
enableGlobalFilter: !!globalFilter,
|
|
19
|
+
enableColumnFilters: !!(columnFilters == null ? void 0 : columnFilters.length),
|
|
20
|
+
globalFilterFn,
|
|
21
|
+
filterFns
|
|
22
|
+
}
|
|
23
|
+
} : void 0;
|
|
24
|
+
};
|
|
25
|
+
exports.useFilteringPlugin = useFilteringPlugin;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TableOptions, ColumnFiltersState } from '@tanstack/react-table';
|
|
2
|
+
import { TablePluginData } from '../utils/plugin.utils';
|
|
3
|
+
export interface TableFilteringParams<T extends object> extends Pick<TableOptions<T>, 'globalFilterFn' | 'filterFns'> {
|
|
4
|
+
/**
|
|
5
|
+
* String, for global search by all the columns<br/>
|
|
6
|
+
* To disable global search per specific column, set `enableGlobalFilter: false` on `columnDef`
|
|
7
|
+
*/
|
|
8
|
+
globalFilter?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Array of column filters data.<br/>
|
|
11
|
+
* Do not forget to define filterFn for columns on `columnDef`, depends on column data type
|
|
12
|
+
*/
|
|
13
|
+
columnFilters?: ColumnFiltersState;
|
|
14
|
+
/** Set false to disable filtering or for manual filtering out of table */
|
|
15
|
+
enableFiltering?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* This plugin is for outer filtering control (filters data comes from outside), but with inner filtering engine
|
|
19
|
+
*/
|
|
20
|
+
export declare const useFilteringPlugin: <T extends object>({ globalFilter, globalFilterFn, columnFilters, enableFiltering, filterFns }?: TableFilteringParams<T>) => TablePluginData<T>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getFilteredRowModel } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
2
|
+
const useFilteringPlugin = ({
|
|
3
|
+
globalFilter,
|
|
4
|
+
globalFilterFn = "includesString",
|
|
5
|
+
columnFilters,
|
|
6
|
+
enableFiltering = !!globalFilter || !!(columnFilters == null ? void 0 : columnFilters.length),
|
|
7
|
+
filterFns
|
|
8
|
+
} = {}) => {
|
|
9
|
+
return enableFiltering ? {
|
|
10
|
+
tableOptions: {
|
|
11
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
12
|
+
state: {
|
|
13
|
+
globalFilter,
|
|
14
|
+
columnFilters
|
|
15
|
+
},
|
|
16
|
+
enableGlobalFilter: !!globalFilter,
|
|
17
|
+
enableColumnFilters: !!(columnFilters == null ? void 0 : columnFilters.length),
|
|
18
|
+
globalFilterFn,
|
|
19
|
+
filterFns
|
|
20
|
+
}
|
|
21
|
+
} : void 0;
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
useFilteringPlugin
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import '@tanstack/table-core';
|
|
2
2
|
import { Cell, Header } from '@tanstack/react-table';
|
|
3
3
|
import { HTMLAttributes } from 'react';
|
|
4
|
+
import { ColumnCellContainer, ColumnSizeUnit } from './Table.types';
|
|
4
5
|
declare module '@tanstack/table-core' {
|
|
5
|
-
type CellSizingUnits = 'fraction' | 'px' | 'rem';
|
|
6
6
|
interface StringHeaderIdentifier {
|
|
7
7
|
isHeaderHidden?: boolean;
|
|
8
8
|
isHeaderCustom?: boolean;
|
|
9
|
-
sizeUnit?:
|
|
9
|
+
sizeUnit?: ColumnSizeUnit;
|
|
10
10
|
getHeaderCellProps?: VoidFunction;
|
|
11
11
|
getCellProps?: VoidFunction;
|
|
12
|
+
cellContainer?: ColumnCellContainer;
|
|
12
13
|
}
|
|
13
14
|
interface IdIdentifier<TData, TValue> {
|
|
14
15
|
isHeaderHidden?: boolean;
|
|
15
16
|
isHeaderCustom?: boolean;
|
|
16
|
-
sizeUnit?:
|
|
17
|
+
sizeUnit?: ColumnSizeUnit;
|
|
17
18
|
getHeaderCellProps?: (header: Header<TData, unknown>) => HTMLAttributes<HTMLTableCellElement> & Record<string, unknown>;
|
|
18
19
|
getCellProps?: (data: TData, cell: Cell<TData, unknown>) => HTMLAttributes<HTMLTableCellElement> & Record<string, unknown>;
|
|
20
|
+
cellContainer?: ColumnCellContainer;
|
|
19
21
|
}
|
|
20
22
|
}
|
|
@@ -10,4 +10,17 @@ const getWidth = (column) => {
|
|
|
10
10
|
const unit = !sizeUnit || sizeUnit === "fraction" ? "%" : sizeUnit;
|
|
11
11
|
return `${size}${unit}`;
|
|
12
12
|
};
|
|
13
|
+
const calcTableMinSize = (columns) => {
|
|
14
|
+
if (!(columns == null ? void 0 : columns.length)) return "0";
|
|
15
|
+
const sums = columns.reduce((acc, {
|
|
16
|
+
sizeUnit,
|
|
17
|
+
size = 150
|
|
18
|
+
}) => {
|
|
19
|
+
const unit = !sizeUnit || sizeUnit === "fraction" ? "px" : sizeUnit;
|
|
20
|
+
acc[unit] = (acc[unit] || 0) + size;
|
|
21
|
+
return acc;
|
|
22
|
+
}, {});
|
|
23
|
+
return `calc(${Object.entries(sums).map(([sizeUnit, size]) => `${size}${sizeUnit}`).join(" + ")})`;
|
|
24
|
+
};
|
|
25
|
+
exports.calcTableMinSize = calcTableMinSize;
|
|
13
26
|
exports.getWidth = getWidth;
|
|
@@ -1,2 +1,14 @@
|
|
|
1
1
|
import { Column } from '@tanstack/react-table';
|
|
2
|
+
import type { ColumnSizeUnit } from '../Table.types';
|
|
2
3
|
export declare const getWidth: <T extends object>(column: Column<T, unknown>) => string | number;
|
|
4
|
+
export type SizeParams = {
|
|
5
|
+
size?: number;
|
|
6
|
+
sizeUnit?: ColumnSizeUnit;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Calculates expected minimal table size, using column definition size and sizeUnit fields.
|
|
10
|
+
* Fractional size is accepted as absolute value in pixels, other units as is.
|
|
11
|
+
* Summary string is CSS-only value (`calc(...)`),
|
|
12
|
+
* that can be used for styling or can be passed to the minWidth prop of the table
|
|
13
|
+
*/
|
|
14
|
+
export declare const calcTableMinSize: (columns: SizeParams[]) => string;
|
|
@@ -8,6 +8,19 @@ const getWidth = (column) => {
|
|
|
8
8
|
const unit = !sizeUnit || sizeUnit === "fraction" ? "%" : sizeUnit;
|
|
9
9
|
return `${size}${unit}`;
|
|
10
10
|
};
|
|
11
|
+
const calcTableMinSize = (columns) => {
|
|
12
|
+
if (!(columns == null ? void 0 : columns.length)) return "0";
|
|
13
|
+
const sums = columns.reduce((acc, {
|
|
14
|
+
sizeUnit,
|
|
15
|
+
size = 150
|
|
16
|
+
}) => {
|
|
17
|
+
const unit = !sizeUnit || sizeUnit === "fraction" ? "px" : sizeUnit;
|
|
18
|
+
acc[unit] = (acc[unit] || 0) + size;
|
|
19
|
+
return acc;
|
|
20
|
+
}, {});
|
|
21
|
+
return `calc(${Object.entries(sums).map(([sizeUnit, size]) => `${size}${sizeUnit}`).join(" + ")})`;
|
|
22
|
+
};
|
|
11
23
|
export {
|
|
24
|
+
calcTableMinSize,
|
|
12
25
|
getWidth
|
|
13
26
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -5,6 +5,7 @@ const ShowOnRowHover_style = require("./Table/components/ShowOnRowHover/ShowOnRo
|
|
|
5
5
|
const index = require("./node_modules/@tanstack/react-table/build/lib/index.cjs");
|
|
6
6
|
const Table_context = require("./Table/Table.context.cjs");
|
|
7
7
|
const plugin_utils = require("./Table/utils/plugin.utils.cjs");
|
|
8
|
+
const table_utils = require("./Table/utils/table.utils.cjs");
|
|
8
9
|
const index$1 = require("./node_modules/@tanstack/table-core/build/lib/index.cjs");
|
|
9
10
|
exports.Table = Table.default;
|
|
10
11
|
exports.ShowOnRowHover = ShowOnRowHover_style.ShowOnRowHover;
|
|
@@ -15,6 +16,7 @@ exports.useComposeContext = Table_context.useComposeContext;
|
|
|
15
16
|
exports.usePluginContext = Table_context.usePluginContext;
|
|
16
17
|
exports.useTableContext = Table_context.useTableContext;
|
|
17
18
|
exports.buildPluginContext = plugin_utils.buildPluginContext;
|
|
19
|
+
exports.calcTableMinSize = table_utils.calcTableMinSize;
|
|
18
20
|
exports.ColumnFaceting = index$1.ColumnFaceting;
|
|
19
21
|
exports.ColumnFiltering = index$1.ColumnFiltering;
|
|
20
22
|
exports.ColumnGrouping = index$1.ColumnGrouping;
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { ShowOnRowHover } from "./Table/components/ShowOnRowHover/ShowOnRowHover
|
|
|
3
3
|
import { flexRender, useReactTable } from "./node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
4
|
import { TableContextProvider, useComposeContext, usePluginContext, useTableContext } from "./Table/Table.context.js";
|
|
5
5
|
import { buildPluginContext } from "./Table/utils/plugin.utils.js";
|
|
6
|
+
import { calcTableMinSize } from "./Table/utils/table.utils.js";
|
|
6
7
|
import { ColumnFaceting, ColumnFiltering, ColumnGrouping, ColumnOrdering, ColumnPinning, ColumnSizing, ColumnVisibility, GlobalFaceting, GlobalFiltering, Headers, RowExpanding, RowPagination, RowPinning, RowSelection, RowSorting, _getVisibleLeafColumns, aggregationFns, buildHeaderGroups, createCell, createColumn, createColumnHelper, createRow, createTable, defaultColumnSizing, expandRows, filterFns, flattenBy, functionalUpdate, getCoreRowModel, getExpandedRowModel, getFacetedMinMaxValues, getFacetedRowModel, getFacetedUniqueValues, getFilteredRowModel, getGroupedRowModel, getMemoOptions, getPaginationRowModel, getSortedRowModel, isFunction, isNumberArray, isRowSelected, isSubRowSelected, makeStateUpdater, memo, noop, orderColumns, passiveEventSupported, reSplitAlphaNumeric, selectRowsFn, shouldAutoRemoveFilter, sortingFns } from "./node_modules/@tanstack/table-core/build/lib/index.js";
|
|
7
8
|
export {
|
|
8
9
|
ColumnFaceting,
|
|
@@ -27,6 +28,7 @@ export {
|
|
|
27
28
|
aggregationFns,
|
|
28
29
|
buildHeaderGroups,
|
|
29
30
|
buildPluginContext,
|
|
31
|
+
calcTableMinSize,
|
|
30
32
|
createCell,
|
|
31
33
|
createColumn,
|
|
32
34
|
createColumnHelper,
|