diff --git a/.changeset/better-mice-dress.md b/.changeset/better-mice-dress.md new file mode 100644 index 00000000..33b1f1a4 --- /dev/null +++ b/.changeset/better-mice-dress.md @@ -0,0 +1,5 @@ +--- +'@genseki/react': patch +--- + +Fix pinning column size diff --git a/legacies/react/src/react/components/primitives/index.ts b/legacies/react/src/react/components/primitives/index.ts index fac291f7..9f2dbbff 100644 --- a/legacies/react/src/react/components/primitives/index.ts +++ b/legacies/react/src/react/components/primitives/index.ts @@ -1,4 +1,5 @@ export * from '../../../../v2/components/primitives/input-group' +export * from '../../../../v2/components/primitives/tanstack-table' export * from './annotation' export * from './avatar' export * from './badge' @@ -47,7 +48,6 @@ export * from './switch' export * from './tab' export * from './table' export * from './tag-group' -export * from './tanstack-table' export * from './text-area' export * from './text-field' export * from './time-field' diff --git a/legacies/react/src/react/views/collections/list/table/index.tsx b/legacies/react/src/react/views/collections/list/table/index.tsx index 0aa44406..150688ad 100644 --- a/legacies/react/src/react/views/collections/list/table/index.tsx +++ b/legacies/react/src/react/views/collections/list/table/index.tsx @@ -11,7 +11,7 @@ import { import { TanstackTable, type TanstackTableProps, -} from '../../../../components/primitives/tanstack-table' +} from '../../../../../../v2/components/primitives/tanstack-table' import { useTableStatesContext } from '../../../../providers/table' import type { BaseData } from '../../types' import { useCollectionList } from '../context' diff --git a/legacies/react/src/react/components/primitives/tanstack-table.tsx b/legacies/react/v2/components/primitives/tanstack-table.tsx similarity index 97% rename from legacies/react/src/react/components/primitives/tanstack-table.tsx rename to legacies/react/v2/components/primitives/tanstack-table.tsx index b2f8c2ff..746a3408 100644 --- a/legacies/react/src/react/components/primitives/tanstack-table.tsx +++ b/legacies/react/v2/components/primitives/tanstack-table.tsx @@ -12,10 +12,16 @@ import { type Table as TanstackTableCore, } from '@tanstack/react-table' -import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from './table' - -import { Typography } from '../../../../v2' -import { cn } from '../../utils/cn' +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from '../../../src/react/components/primitives/table' +import { cn } from '../../../src/react/utils/cn' +import { Typography } from '../..' type RowClickHandler = (row: Row, e: React.MouseEvent) => void @@ -58,6 +64,7 @@ const getCommonPinningClassesAndStyle = (column: Column) => { const style: CSSProperties = { left: isPinned === 'left' ? `${column.getStart('left')}px` : undefined, right: isPinned === 'right' ? `${column.getAfter('right')}px` : undefined, + width: column.getSize(), } return { className, style }