diff --git a/apps/examples/calcom/app/(dashboard)/members/members-page-client.tsx b/apps/examples/calcom/app/(dashboard)/members/members-page-client.tsx index 21d01890d..97ab05926 100644 --- a/apps/examples/calcom/app/(dashboard)/members/members-page-client.tsx +++ b/apps/examples/calcom/app/(dashboard)/members/members-page-client.tsx @@ -41,12 +41,20 @@ import { cn } from "@coss/ui/lib/utils"; import { type Column, type ColumnDef, - type ColumnSizingState, + columnFilteringFeature, + columnPinningFeature, + columnResizingFeature, + columnSizingFeature, + columnVisibilityFeature, + createSortedRowModel, flexRender, - getCoreRowModel, - getSortedRowModel, + rowSelectionFeature, + rowSortingFeature, type SortingState, - useReactTable, + sortFn_alphanumeric, + sortFn_text, + tableFeatures, + useTable, } from "@tanstack/react-table"; import { ArrowUpRightIcon, @@ -127,6 +135,21 @@ type Member = { avatarUrl?: string; }; +const features = tableFeatures({ + columnFilteringFeature, + columnPinningFeature, + columnSizingFeature, + columnResizingFeature, + columnVisibilityFeature, + rowSelectionFeature, + rowSortingFeature, + sortedRowModel: createSortedRowModel(), + sortFns: { + alphanumeric: sortFn_alphanumeric, + text: sortFn_text, + }, +}); + const members: Member[] = [ { avatarUrl: @@ -352,25 +375,30 @@ function OptionalBadge({ value }: { value?: string }) { const FILLER_EXCLUDED_COLUMN_IDS = new Set(["select", "actions"]); const INITIAL_COLUMN_PINNING = { - left: ["select", "name"], - right: ["actions"], + end: ["actions"], + start: ["select", "name"], }; -function getPinningStyles(column: Column): CSSProperties { +function getPinningStyles( + column: Column, +): CSSProperties { const isPinned = column.getIsPinned(); return { - "--pinned-left-offset": - isPinned === "left" ? `${column.getStart("left")}px` : undefined, - left: undefined, - position: isPinned === "right" ? "sticky" : undefined, - right: isPinned === "right" ? `${column.getAfter("right")}px` : undefined, + "--pinned-start-offset": + isPinned === "start" ? `${column.getStart("start")}px` : undefined, + insetInlineEnd: + isPinned === "end" ? `${column.getAfter("end")}px` : undefined, + insetInlineStart: undefined, + position: isPinned === "end" ? "sticky" : undefined, zIndex: isPinned ? 1 : 0, } as CSSProperties; } -function getPinnedDataAttribute(column: Column): { - "data-pinned"?: "left" | "right"; +function getPinnedDataAttribute( + column: Column, +): { + "data-pinned"?: "end" | "start"; } { const isPinned = column.getIsPinned(); return isPinned ? { "data-pinned": isPinned } : {}; @@ -421,8 +449,8 @@ function getColumnDisplayWidth({ function getColumns( columnVisibility: Record, -): ColumnDef[] { - const cols: ColumnDef[] = [ +): ColumnDef[] { + const cols: ColumnDef[] = [ { cell: ({ row }) => (