rez-table-listing-mui 2.0.5 → 2.0.7
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/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/listing/components/table-body/table-body.styles.ts +1 -2
- package/src/listing/components/table-head/table-head-dnd-cell.tsx +4 -2
- package/src/listing/components/table-head/table-head.styles.ts +1 -1
- package/src/listing/components/table-head/table-head.tsx +15 -3
package/package.json
CHANGED
|
@@ -48,8 +48,7 @@ export const TableBodyCell = styled("td", {
|
|
|
48
48
|
}>(({ theme, compact, isDragging, wrap }) => ({
|
|
49
49
|
fontSize: theme.typography.pxToRem(14),
|
|
50
50
|
padding: compact ? theme.spacing(0.25, 0.5) : theme.spacing(0.5, 1),
|
|
51
|
-
|
|
52
|
-
borderBottom: `0.5px solid ${theme.palette.grey[100]}`,
|
|
51
|
+
borderBottom: `1px solid ${theme.palette.grey[200]}`,
|
|
53
52
|
|
|
54
53
|
...(wrap && {
|
|
55
54
|
wordBreak: "break-all",
|
|
@@ -28,7 +28,9 @@ function DraggableTableHeader<T>({
|
|
|
28
28
|
// Popover
|
|
29
29
|
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
|
|
30
30
|
|
|
31
|
-
const
|
|
31
|
+
const handleMenuToggle = (event: React.MouseEvent<HTMLElement>) => {
|
|
32
|
+
if (header.column.getIsResizing()) return;
|
|
33
|
+
|
|
32
34
|
setAnchorEl((prev) => (prev ? null : event.currentTarget));
|
|
33
35
|
};
|
|
34
36
|
|
|
@@ -59,7 +61,7 @@ function DraggableTableHeader<T>({
|
|
|
59
61
|
}}
|
|
60
62
|
>
|
|
61
63
|
{header.isPlaceholder ? null : (
|
|
62
|
-
<TableHeadContent onClick={
|
|
64
|
+
<TableHeadContent onClick={handleMenuToggle}>
|
|
63
65
|
<TableHeadSort sortable={header.column.getCanSort()}>
|
|
64
66
|
{flexRender(header.column.columnDef.header, header.getContext())}
|
|
65
67
|
</TableHeadSort>
|
|
@@ -97,7 +97,7 @@ export const TableHeadCell = styled("th", {
|
|
|
97
97
|
}>(({ theme, compact, isDragging, isPinned, sticky }) => ({
|
|
98
98
|
position: "relative",
|
|
99
99
|
padding: compact ? theme.spacing(0.375, 0.675) : theme.spacing(0.75, 1),
|
|
100
|
-
border: `0.5px solid ${theme.palette.grey[
|
|
100
|
+
border: `0.5px solid ${theme.palette.grey[200]}`,
|
|
101
101
|
cursor: "pointer",
|
|
102
102
|
backgroundColor: theme.palette.common.white,
|
|
103
103
|
userSelect: "none",
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ColumnOrderState,
|
|
3
|
+
flexRender,
|
|
4
|
+
Header,
|
|
5
|
+
Table,
|
|
6
|
+
} from "@tanstack/react-table";
|
|
2
7
|
import {
|
|
3
8
|
CraftTableFeatureProps,
|
|
4
9
|
craftTableFilterSettingsOptionsProps,
|
|
@@ -52,7 +57,12 @@ function TableHead<T>({
|
|
|
52
57
|
// Popover
|
|
53
58
|
const [, setAnchorEl] = useState<HTMLElement | null>(null);
|
|
54
59
|
|
|
55
|
-
const
|
|
60
|
+
const handleMenuToggle = (
|
|
61
|
+
event: React.MouseEvent<HTMLElement>,
|
|
62
|
+
header: Header<T, unknown>
|
|
63
|
+
) => {
|
|
64
|
+
if (header.column.getIsResizing()) return;
|
|
65
|
+
|
|
56
66
|
setAnchorEl((prev) => (prev ? null : event.currentTarget));
|
|
57
67
|
};
|
|
58
68
|
|
|
@@ -105,7 +115,9 @@ function TableHead<T>({
|
|
|
105
115
|
}}
|
|
106
116
|
>
|
|
107
117
|
{header.isPlaceholder ? null : (
|
|
108
|
-
<TableHeadContent
|
|
118
|
+
<TableHeadContent
|
|
119
|
+
onClick={(event) => handleMenuToggle(event, header)}
|
|
120
|
+
>
|
|
109
121
|
<TableHeadSort sortable={header.column.getCanSort()}>
|
|
110
122
|
{flexRender(
|
|
111
123
|
header.column.columnDef.header,
|