Skip to content

Commit 4588417

Browse files
Merge pull request #321 from softnetics/supakorn/fix/components
fix: table shadow and table example.
2 parents 087754e + 05f3938 commit 4588417

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

.changeset/moody-moose-argue.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@example/ui-playground': patch
3+
'@genseki/ui': patch
4+
---
5+
6+
fix: table shadow and table example.

examples/ui-playground/src/app/playground/shadcn/table/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ function BasicStickyColumnTable() {
483483
getPaginationRowModel: getPaginationRowModel(),
484484
columns,
485485
state: {
486-
columnPinning: { left: ['id'] },
486+
columnPinning: { left: ['id'], right: ['notes'] },
487487
pagination: { pageIndex: pageIndex, pageSize: pageSize },
488488
},
489489
})
@@ -495,7 +495,7 @@ function BasicStickyColumnTable() {
495495
<TanstackTableContainer>
496496
<TanstackTable table={table} />
497497

498-
<PaginationBarContainer>
498+
<PaginationBarContainer className="sticky left-0 bottom-0">
499499
<Pagination>
500500
<PaginationContent>
501501
<PaginationItem disabled={firstLage}>

packages/ui/src/components/primitives/tanstack-table.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,16 @@ const getCommonPinningClassesAndStyle = (column: Column<any>) => {
5050
const isLastLeftPinnedColumn = isPinned === 'left' && column.getIsLastColumn('left')
5151
const isFirstRightPinnedColumn = isPinned === 'right' && column.getIsFirstColumn('right')
5252

53-
const className = cn(
54-
isPinned ? 'sticky z-[1]' : 'relative',
55-
isLastLeftPinnedColumn && 'shadow-[inset_-4px_0_4px_-4px_gray]',
56-
isFirstRightPinnedColumn && 'shadow-[inset_4px_0_4px_-4px_gray]'
57-
)
53+
const className = cn(isPinned ? 'sticky z-[1]' : 'relative')
5854

5955
const style: CSSProperties = {
6056
left: isPinned === 'left' ? `${column.getStart('left')}px` : undefined,
6157
right: isPinned === 'right' ? `${column.getAfter('right')}px` : undefined,
58+
boxShadow: isLastLeftPinnedColumn
59+
? 'inset -4px 0 4px -4px #bbbbbb'
60+
: isFirstRightPinnedColumn
61+
? 'inset 4px 0 4px -4px #bbbbbb'
62+
: undefined,
6263
width: column.getSize(),
6364
}
6465

0 commit comments

Comments
 (0)