-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
86 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,6 +232,7 @@ export function getColumns(): ColumnDef<Task>[] { | |
</> | ||
) | ||
}, | ||
size: 40, | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { type Column } from "@tanstack/react-table" | ||
|
||
export function getCommonPinningStyles<TData>({ | ||
column, | ||
}: { | ||
column: Column<TData> | ||
}): React.CSSProperties { | ||
const isPinned = column.getIsPinned() | ||
const isLastLeftPinnedColumn = | ||
isPinned === "left" && column.getIsLastColumn("left") | ||
const isFirstRightPinnedColumn = | ||
isPinned === "right" && column.getIsFirstColumn("right") | ||
|
||
return { | ||
boxShadow: isLastLeftPinnedColumn | ||
? "-5px 0 5px -5px hsl(var(--border)) inset" | ||
: isFirstRightPinnedColumn | ||
? "5px 0 5px -5px hsl(var(--border)) inset" | ||
: undefined, | ||
left: isPinned === "left" ? `${column.getStart("left")}px` : undefined, | ||
right: isPinned === "right" ? `${column.getAfter("right")}px` : undefined, | ||
opacity: isPinned ? 0.95 : 1, | ||
position: isPinned ? "sticky" : "relative", | ||
background: isPinned ? "hsl(var(--background))" : undefined, | ||
width: column.getSize(), | ||
zIndex: isPinned ? 1 : 0, | ||
} | ||
} |