@brightlocal/ui-components 0.1.0
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/LICENSE +21 -0
- package/README.md +349 -0
- package/dist/accordion.cjs +1 -0
- package/dist/accordion.d.ts +32 -0
- package/dist/accordion.d.ts.map +1 -0
- package/dist/accordion.js +107 -0
- package/dist/alert-dialog.cjs +1 -0
- package/dist/alert-dialog.d.ts +15 -0
- package/dist/alert-dialog.d.ts.map +1 -0
- package/dist/alert-dialog.js +146 -0
- package/dist/alert.cjs +1 -0
- package/dist/alert.d.ts +16 -0
- package/dist/alert.d.ts.map +1 -0
- package/dist/alert.js +174 -0
- package/dist/aspect-ratio.cjs +1 -0
- package/dist/aspect-ratio.d.ts +10 -0
- package/dist/aspect-ratio.d.ts.map +1 -0
- package/dist/aspect-ratio.js +22 -0
- package/dist/avatar.cjs +1 -0
- package/dist/avatar.d.ts +11 -0
- package/dist/avatar.d.ts.map +1 -0
- package/dist/avatar.js +46 -0
- package/dist/badge.cjs +1 -0
- package/dist/badge.d.ts +19 -0
- package/dist/badge.d.ts.map +1 -0
- package/dist/badge.js +50 -0
- package/dist/blocks/data-table.cjs +1 -0
- package/dist/blocks/data-table.d.ts +303 -0
- package/dist/blocks/data-table.d.ts.map +1 -0
- package/dist/blocks/data-table.js +555 -0
- package/dist/blocks/sidebar.cjs +1 -0
- package/dist/blocks/sidebar.d.ts +744 -0
- package/dist/blocks/sidebar.d.ts.map +1 -0
- package/dist/blocks/sidebar.js +839 -0
- package/dist/breadcrumb.cjs +1 -0
- package/dist/breadcrumb.d.ts +12 -0
- package/dist/breadcrumb.d.ts.map +1 -0
- package/dist/breadcrumb.js +102 -0
- package/dist/button.cjs +1 -0
- package/dist/button.d.ts +73 -0
- package/dist/button.d.ts.map +1 -0
- package/dist/button.js +195 -0
- package/dist/calendar.cjs +1 -0
- package/dist/calendar.d.ts +28 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +191 -0
- package/dist/card.cjs +1 -0
- package/dist/card.d.ts +28 -0
- package/dist/card.d.ts.map +1 -0
- package/dist/card.js +131 -0
- package/dist/carousel.cjs +1 -0
- package/dist/carousel.d.ts +21 -0
- package/dist/carousel.d.ts.map +1 -0
- package/dist/carousel.js +185 -0
- package/dist/centred-layout.cjs +1 -0
- package/dist/centred-layout.d.ts +49 -0
- package/dist/centred-layout.d.ts.map +1 -0
- package/dist/centred-layout.js +35 -0
- package/dist/chart.cjs +10 -0
- package/dist/chart.d.ts +83 -0
- package/dist/chart.d.ts.map +1 -0
- package/dist/chart.js +254 -0
- package/dist/checkbox.cjs +1 -0
- package/dist/checkbox.d.ts +15 -0
- package/dist/checkbox.d.ts.map +1 -0
- package/dist/checkbox.js +96 -0
- package/dist/collapsible.cjs +1 -0
- package/dist/collapsible.d.ts +18 -0
- package/dist/collapsible.d.ts.map +1 -0
- package/dist/collapsible.js +58 -0
- package/dist/combobox.cjs +1 -0
- package/dist/combobox.d.ts +65 -0
- package/dist/combobox.d.ts.map +1 -0
- package/dist/combobox.js +203 -0
- package/dist/command.cjs +1 -0
- package/dist/command.d.ts +44 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +166 -0
- package/dist/context-menu.cjs +1 -0
- package/dist/context-menu.d.ts +42 -0
- package/dist/context-menu.d.ts.map +1 -0
- package/dist/context-menu.js +226 -0
- package/dist/date-picker.cjs +1 -0
- package/dist/date-picker.d.ts +54 -0
- package/dist/date-picker.d.ts.map +1 -0
- package/dist/date-picker.js +95 -0
- package/dist/dialog.cjs +1 -0
- package/dist/dialog.d.ts +20 -0
- package/dist/dialog.d.ts.map +1 -0
- package/dist/dialog.js +130 -0
- package/dist/drawer.cjs +1 -0
- package/dist/drawer.d.ts +22 -0
- package/dist/drawer.d.ts.map +1 -0
- package/dist/drawer.js +149 -0
- package/dist/dropdown-menu.cjs +1 -0
- package/dist/dropdown-menu.d.ts +253 -0
- package/dist/dropdown-menu.d.ts.map +1 -0
- package/dist/dropdown-menu.js +325 -0
- package/dist/field.cjs +1 -0
- package/dist/field.d.ts +21 -0
- package/dist/field.d.ts.map +1 -0
- package/dist/field.js +148 -0
- package/dist/global-layout.cjs +1 -0
- package/dist/global-layout.d.ts +60 -0
- package/dist/global-layout.d.ts.map +1 -0
- package/dist/global-layout.js +87 -0
- package/dist/hooks/use-mobile.cjs +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hover-card.cjs +1 -0
- package/dist/hover-card.d.ts +43 -0
- package/dist/hover-card.d.ts.map +1 -0
- package/dist/hover-card.js +71 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +412 -0
- package/dist/input-base.cjs +1 -0
- package/dist/input-base.d.ts +28 -0
- package/dist/input-base.d.ts.map +1 -0
- package/dist/input-base.js +56 -0
- package/dist/input-group.cjs +1 -0
- package/dist/input-group.d.ts +26 -0
- package/dist/input-group.d.ts.map +1 -0
- package/dist/input-group.js +116 -0
- package/dist/input-otp.cjs +1 -0
- package/dist/input-otp.d.ts +45 -0
- package/dist/input-otp.d.ts.map +1 -0
- package/dist/input-otp.js +186 -0
- package/dist/input-password.cjs +1 -0
- package/dist/input-password.d.ts +38 -0
- package/dist/input-password.d.ts.map +1 -0
- package/dist/input-password.js +101 -0
- package/dist/input.cjs +1 -0
- package/dist/input.d.ts +32 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +146 -0
- package/dist/label.cjs +1 -0
- package/dist/label.d.ts +12 -0
- package/dist/label.d.ts.map +1 -0
- package/dist/label.js +34 -0
- package/dist/lib/utils.cjs +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +8 -0
- package/dist/link.cjs +1 -0
- package/dist/link.d.ts +29 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.figma.d.ts +2 -0
- package/dist/link.figma.d.ts.map +1 -0
- package/dist/link.js +71 -0
- package/dist/logo.cjs +1 -0
- package/dist/logo.d.ts +25 -0
- package/dist/logo.d.ts.map +1 -0
- package/dist/logo.js +71 -0
- package/dist/menubar.cjs +1 -0
- package/dist/menubar.d.ts +106 -0
- package/dist/menubar.d.ts.map +1 -0
- package/dist/menubar.js +270 -0
- package/dist/navigation-menu.cjs +1 -0
- package/dist/navigation-menu.d.ts +108 -0
- package/dist/navigation-menu.d.ts.map +1 -0
- package/dist/navigation-menu.js +175 -0
- package/dist/pagination.cjs +1 -0
- package/dist/pagination.d.ts +81 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +216 -0
- package/dist/popover.cjs +1 -0
- package/dist/popover.d.ts +8 -0
- package/dist/popover.d.ts.map +1 -0
- package/dist/popover.js +44 -0
- package/dist/progress.cjs +1 -0
- package/dist/progress.d.ts +29 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +64 -0
- package/dist/radio-group.cjs +1 -0
- package/dist/radio-group.d.ts +33 -0
- package/dist/radio-group.d.ts.map +1 -0
- package/dist/radio-group.js +193 -0
- package/dist/rating.cjs +1 -0
- package/dist/rating.d.ts +22 -0
- package/dist/rating.d.ts.map +1 -0
- package/dist/rating.js +51 -0
- package/dist/resizable.cjs +1 -0
- package/dist/resizable.d.ts +14 -0
- package/dist/resizable.d.ts.map +1 -0
- package/dist/resizable.js +46 -0
- package/dist/scroll-area.cjs +1 -0
- package/dist/scroll-area.d.ts +12 -0
- package/dist/scroll-area.d.ts.map +1 -0
- package/dist/scroll-area.js +67 -0
- package/dist/select.cjs +1 -0
- package/dist/select.d.ts +77 -0
- package/dist/select.d.ts.map +1 -0
- package/dist/select.js +259 -0
- package/dist/separator.cjs +1 -0
- package/dist/separator.d.ts +14 -0
- package/dist/separator.d.ts.map +1 -0
- package/dist/separator.js +43 -0
- package/dist/sheet.cjs +1 -0
- package/dist/sheet.d.ts +38 -0
- package/dist/sheet.d.ts.map +1 -0
- package/dist/sheet.js +190 -0
- package/dist/skeleton.cjs +1 -0
- package/dist/skeleton.d.ts +5 -0
- package/dist/skeleton.d.ts.map +1 -0
- package/dist/skeleton.js +15 -0
- package/dist/slider.cjs +1 -0
- package/dist/slider.d.ts +19 -0
- package/dist/slider.d.ts.map +1 -0
- package/dist/slider.js +69 -0
- package/dist/sonner.cjs +1 -0
- package/dist/sonner.d.ts +188 -0
- package/dist/sonner.d.ts.map +1 -0
- package/dist/sonner.js +150 -0
- package/dist/split-layout.cjs +1 -0
- package/dist/split-layout.d.ts +42 -0
- package/dist/split-layout.d.ts.map +1 -0
- package/dist/split-layout.js +108 -0
- package/dist/switch.cjs +1 -0
- package/dist/switch.d.ts +43 -0
- package/dist/switch.d.ts.map +1 -0
- package/dist/switch.figma.d.ts +2 -0
- package/dist/switch.figma.d.ts.map +1 -0
- package/dist/switch.js +110 -0
- package/dist/table.cjs +1 -0
- package/dist/table.d.ts +95 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/table.js +164 -0
- package/dist/tabs.cjs +1 -0
- package/dist/tabs.d.ts +29 -0
- package/dist/tabs.d.ts.map +1 -0
- package/dist/tabs.js +96 -0
- package/dist/textarea.cjs +1 -0
- package/dist/textarea.d.ts +23 -0
- package/dist/textarea.d.ts.map +1 -0
- package/dist/textarea.js +47 -0
- package/dist/toggle-group.cjs +1 -0
- package/dist/toggle-group.d.ts +25 -0
- package/dist/toggle-group.d.ts.map +1 -0
- package/dist/toggle-group.js +74 -0
- package/dist/toggle.cjs +1 -0
- package/dist/toggle.d.ts +44 -0
- package/dist/toggle.d.ts.map +1 -0
- package/dist/toggle.figma.d.ts +2 -0
- package/dist/toggle.figma.d.ts.map +1 -0
- package/dist/toggle.js +57 -0
- package/dist/tooltip.cjs +1 -0
- package/dist/tooltip.d.ts +66 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/tooltip.js +78 -0
- package/package.json +184 -0
- package/src/blocks/data-table.tsx +1166 -0
- package/src/blocks/sidebar.tsx +1830 -0
- package/src/components/.gitkeep +0 -0
- package/src/components/accordion.tsx +142 -0
- package/src/components/alert-dialog.tsx +157 -0
- package/src/components/alert.tsx +199 -0
- package/src/components/aspect-ratio.tsx +30 -0
- package/src/components/avatar.tsx +56 -0
- package/src/components/badge.tsx +72 -0
- package/src/components/breadcrumb.tsx +109 -0
- package/src/components/button.tsx +296 -0
- package/src/components/calendar.tsx +234 -0
- package/src/components/card.tsx +158 -0
- package/src/components/carousel.tsx +256 -0
- package/src/components/centred-layout.tsx +91 -0
- package/src/components/chart.tsx +456 -0
- package/src/components/checkbox.tsx +132 -0
- package/src/components/collapsible.tsx +68 -0
- package/src/components/combobox.tsx +321 -0
- package/src/components/command.tsx +220 -0
- package/src/components/context-menu.tsx +305 -0
- package/src/components/date-picker.tsx +155 -0
- package/src/components/dialog.tsx +152 -0
- package/src/components/drawer.tsx +168 -0
- package/src/components/dropdown-menu.tsx +575 -0
- package/src/components/field.tsx +155 -0
- package/src/components/global-layout.tsx +153 -0
- package/src/components/hover-card.tsx +121 -0
- package/src/components/input-base.tsx +86 -0
- package/src/components/input-group.tsx +158 -0
- package/src/components/input-otp.tsx +327 -0
- package/src/components/input-password.tsx +191 -0
- package/src/components/input.tsx +220 -0
- package/src/components/label.tsx +42 -0
- package/src/components/link.figma.tsx +71 -0
- package/src/components/link.tsx +105 -0
- package/src/components/logo.tsx +97 -0
- package/src/components/menubar.tsx +379 -0
- package/src/components/navigation-menu.tsx +324 -0
- package/src/components/pagination.tsx +368 -0
- package/src/components/popover.tsx +46 -0
- package/src/components/progress.tsx +100 -0
- package/src/components/radio-group.tsx +281 -0
- package/src/components/rating.tsx +87 -0
- package/src/components/resizable.tsx +66 -0
- package/src/components/scroll-area.tsx +72 -0
- package/src/components/select.tsx +442 -0
- package/src/components/separator.tsx +53 -0
- package/src/components/sheet.tsx +220 -0
- package/src/components/skeleton.tsx +17 -0
- package/src/components/slider.tsx +86 -0
- package/src/components/sonner.tsx +396 -0
- package/src/components/split-layout.tsx +155 -0
- package/src/components/switch.figma.tsx +115 -0
- package/src/components/switch.tsx +173 -0
- package/src/components/table.tsx +277 -0
- package/src/components/tabs.tsx +142 -0
- package/src/components/textarea.tsx +77 -0
- package/src/components/toggle-group.tsx +109 -0
- package/src/components/toggle.figma.tsx +81 -0
- package/src/components/toggle.tsx +103 -0
- package/src/components/tooltip.tsx +156 -0
- package/src/hooks/.gitkeep +0 -0
- package/src/hooks/use-mobile.ts +21 -0
- package/src/index.ts +67 -0
- package/src/lib/utils.ts +6 -0
- package/src/types/external-modules.d.ts +16 -0
|
@@ -0,0 +1,1166 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import {
|
|
5
|
+
ColumnDef,
|
|
6
|
+
ColumnOrderState,
|
|
7
|
+
ColumnPinningState,
|
|
8
|
+
ExpandedState,
|
|
9
|
+
GroupingState,
|
|
10
|
+
RowPinningState,
|
|
11
|
+
flexRender,
|
|
12
|
+
getCoreRowModel,
|
|
13
|
+
getExpandedRowModel,
|
|
14
|
+
getFacetedMinMaxValues,
|
|
15
|
+
getFacetedRowModel,
|
|
16
|
+
getFacetedUniqueValues,
|
|
17
|
+
getFilteredRowModel,
|
|
18
|
+
getGroupedRowModel,
|
|
19
|
+
getPaginationRowModel,
|
|
20
|
+
getSortedRowModel,
|
|
21
|
+
SortingState,
|
|
22
|
+
ColumnFiltersState,
|
|
23
|
+
RowSelectionState,
|
|
24
|
+
useReactTable,
|
|
25
|
+
Table as TanStackTable,
|
|
26
|
+
Column,
|
|
27
|
+
Row,
|
|
28
|
+
} from "@tanstack/react-table";
|
|
29
|
+
import {
|
|
30
|
+
ArrowDownIcon,
|
|
31
|
+
ArrowUpIcon,
|
|
32
|
+
ArrowUpDownIcon,
|
|
33
|
+
EllipsisIcon,
|
|
34
|
+
SearchIcon,
|
|
35
|
+
} from "lucide-react";
|
|
36
|
+
|
|
37
|
+
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
38
|
+
import { Button, ButtonVariant, ButtonSize } from "../components/button";
|
|
39
|
+
import { Checkbox } from "../components/checkbox";
|
|
40
|
+
import { Input } from "../components/input";
|
|
41
|
+
import { Skeleton } from "../components/skeleton";
|
|
42
|
+
import {
|
|
43
|
+
DropdownMenu,
|
|
44
|
+
DropdownMenuContent,
|
|
45
|
+
DropdownMenuTrigger,
|
|
46
|
+
} from "../components/dropdown-menu";
|
|
47
|
+
import {
|
|
48
|
+
Table,
|
|
49
|
+
TableBody,
|
|
50
|
+
TableCell,
|
|
51
|
+
TableHead,
|
|
52
|
+
TableHeader,
|
|
53
|
+
TableRow,
|
|
54
|
+
} from "../components/table";
|
|
55
|
+
import {
|
|
56
|
+
Pagination,
|
|
57
|
+
PaginationContent,
|
|
58
|
+
PaginationItem,
|
|
59
|
+
PaginationLink,
|
|
60
|
+
PaginationPrevious,
|
|
61
|
+
PaginationNext,
|
|
62
|
+
PaginationEllipsis,
|
|
63
|
+
usePagination,
|
|
64
|
+
} from "../components/pagination";
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Re-export TanStack Table utilities for convenience
|
|
68
|
+
*/
|
|
69
|
+
export {
|
|
70
|
+
type ColumnDef,
|
|
71
|
+
type ColumnOrderState,
|
|
72
|
+
type ColumnPinningState,
|
|
73
|
+
type ExpandedState,
|
|
74
|
+
type GroupingState,
|
|
75
|
+
type RowPinningState,
|
|
76
|
+
type SortingState,
|
|
77
|
+
type ColumnFiltersState,
|
|
78
|
+
type RowSelectionState,
|
|
79
|
+
type Column,
|
|
80
|
+
type Row,
|
|
81
|
+
flexRender,
|
|
82
|
+
} from "@tanstack/react-table";
|
|
83
|
+
|
|
84
|
+
export { createColumnHelper } from "@tanstack/react-table";
|
|
85
|
+
|
|
86
|
+
interface DataTableProps<TData, TValue> {
|
|
87
|
+
/** Column definitions for the table */
|
|
88
|
+
columns: ColumnDef<TData, TValue>[];
|
|
89
|
+
/** Data array to display in the table */
|
|
90
|
+
data: TData[];
|
|
91
|
+
/** Data hook for automated testing (REQUIRED) */
|
|
92
|
+
dataHook: string;
|
|
93
|
+
/** Tracking element identifier for analytics */
|
|
94
|
+
trackingEl?: string;
|
|
95
|
+
/** Tracking label for analytics context */
|
|
96
|
+
trackingLabel?: string;
|
|
97
|
+
|
|
98
|
+
// Feature toggles
|
|
99
|
+
/** Enable row selection */
|
|
100
|
+
enableRowSelection?: boolean;
|
|
101
|
+
/** Enable sorting */
|
|
102
|
+
enableSorting?: boolean;
|
|
103
|
+
/** Enable column filters */
|
|
104
|
+
enableFiltering?: boolean;
|
|
105
|
+
/** Enable global filtering */
|
|
106
|
+
enableGlobalFiltering?: boolean;
|
|
107
|
+
/** Enable pagination */
|
|
108
|
+
enablePagination?: boolean;
|
|
109
|
+
/** Enable column pinning */
|
|
110
|
+
enableColumnPinning?: boolean;
|
|
111
|
+
/** Enable row pinning */
|
|
112
|
+
enableRowPinning?: boolean;
|
|
113
|
+
/** Enable column ordering/reordering */
|
|
114
|
+
enableColumnOrdering?: boolean;
|
|
115
|
+
/** Enable grouping */
|
|
116
|
+
enableGrouping?: boolean;
|
|
117
|
+
/** Enable expanding rows */
|
|
118
|
+
enableExpanding?: boolean;
|
|
119
|
+
/** Enable faceted values (for filter dropdowns) */
|
|
120
|
+
enableFaceting?: boolean;
|
|
121
|
+
|
|
122
|
+
/** Initial page size for pagination */
|
|
123
|
+
pageSize?: number;
|
|
124
|
+
/** Message to display when there are no results */
|
|
125
|
+
noResultsMessage?: string;
|
|
126
|
+
/** Show loading skeleton state */
|
|
127
|
+
isLoading?: boolean;
|
|
128
|
+
/** Number of skeleton rows to show when loading (defaults to pageSize) */
|
|
129
|
+
skeletonRowCount?: number;
|
|
130
|
+
/** Function to get sub-rows for expanding */
|
|
131
|
+
getSubRows?: (originalRow: TData, index: number) => TData[] | undefined;
|
|
132
|
+
|
|
133
|
+
// Controlled states
|
|
134
|
+
/** Controlled sorting state */
|
|
135
|
+
sorting?: SortingState;
|
|
136
|
+
/** Callback when sorting changes */
|
|
137
|
+
onSortingChange?: (sorting: SortingState) => void;
|
|
138
|
+
/** Controlled column filters state */
|
|
139
|
+
columnFilters?: ColumnFiltersState;
|
|
140
|
+
/** Callback when column filters change */
|
|
141
|
+
onColumnFiltersChange?: (filters: ColumnFiltersState) => void;
|
|
142
|
+
/** Controlled global filter state */
|
|
143
|
+
globalFilter?: string;
|
|
144
|
+
/** Callback when global filter changes */
|
|
145
|
+
onGlobalFilterChange?: (filter: string) => void;
|
|
146
|
+
/** Controlled row selection state */
|
|
147
|
+
rowSelection?: RowSelectionState;
|
|
148
|
+
/** Callback when row selection changes */
|
|
149
|
+
onRowSelectionChange?: (selection: RowSelectionState) => void;
|
|
150
|
+
/** Controlled column order state */
|
|
151
|
+
columnOrder?: ColumnOrderState;
|
|
152
|
+
/** Callback when column order changes */
|
|
153
|
+
onColumnOrderChange?: (order: ColumnOrderState) => void;
|
|
154
|
+
/** Controlled column pinning state */
|
|
155
|
+
columnPinning?: ColumnPinningState;
|
|
156
|
+
/** Callback when column pinning changes */
|
|
157
|
+
onColumnPinningChange?: (pinning: ColumnPinningState) => void;
|
|
158
|
+
/** Controlled row pinning state */
|
|
159
|
+
rowPinning?: RowPinningState;
|
|
160
|
+
/** Callback when row pinning changes */
|
|
161
|
+
onRowPinningChange?: (pinning: RowPinningState) => void;
|
|
162
|
+
/** Controlled grouping state */
|
|
163
|
+
grouping?: GroupingState;
|
|
164
|
+
/** Callback when grouping changes */
|
|
165
|
+
onGroupingChange?: (grouping: GroupingState) => void;
|
|
166
|
+
/** Controlled expanded state */
|
|
167
|
+
expanded?: ExpandedState;
|
|
168
|
+
/** Callback when expanded changes */
|
|
169
|
+
onExpandedChange?: (expanded: ExpandedState) => void;
|
|
170
|
+
|
|
171
|
+
/** Additional class name for the table container */
|
|
172
|
+
className?: string;
|
|
173
|
+
/** Render function for custom table toolbar */
|
|
174
|
+
renderToolbar?: (table: TanStackTable<TData>) => React.ReactNode;
|
|
175
|
+
/** Render function for custom table footer (for summary rows, totals, etc.) */
|
|
176
|
+
renderFooter?: (table: TanStackTable<TData>) => React.ReactNode;
|
|
177
|
+
/** Render function for custom pagination controls */
|
|
178
|
+
renderPagination?: (table: TanStackTable<TData>) => React.ReactNode;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function DataTableInner<TData, TValue>(
|
|
182
|
+
{
|
|
183
|
+
columns,
|
|
184
|
+
data,
|
|
185
|
+
dataHook,
|
|
186
|
+
trackingEl,
|
|
187
|
+
trackingLabel,
|
|
188
|
+
enableRowSelection = false,
|
|
189
|
+
enableSorting = true,
|
|
190
|
+
enableFiltering = false,
|
|
191
|
+
enableGlobalFiltering = false,
|
|
192
|
+
enablePagination = false,
|
|
193
|
+
enableColumnPinning = false,
|
|
194
|
+
enableRowPinning = false,
|
|
195
|
+
enableColumnOrdering = false,
|
|
196
|
+
enableGrouping = false,
|
|
197
|
+
enableExpanding = false,
|
|
198
|
+
enableFaceting = false,
|
|
199
|
+
pageSize = 10,
|
|
200
|
+
noResultsMessage = "No results.",
|
|
201
|
+
isLoading = false,
|
|
202
|
+
skeletonRowCount,
|
|
203
|
+
getSubRows,
|
|
204
|
+
sorting: controlledSorting,
|
|
205
|
+
onSortingChange,
|
|
206
|
+
columnFilters: controlledColumnFilters,
|
|
207
|
+
onColumnFiltersChange,
|
|
208
|
+
globalFilter: controlledGlobalFilter,
|
|
209
|
+
onGlobalFilterChange,
|
|
210
|
+
rowSelection: controlledRowSelection,
|
|
211
|
+
onRowSelectionChange,
|
|
212
|
+
columnOrder: controlledColumnOrder,
|
|
213
|
+
onColumnOrderChange,
|
|
214
|
+
columnPinning: controlledColumnPinning,
|
|
215
|
+
onColumnPinningChange,
|
|
216
|
+
rowPinning: controlledRowPinning,
|
|
217
|
+
onRowPinningChange,
|
|
218
|
+
grouping: controlledGrouping,
|
|
219
|
+
onGroupingChange,
|
|
220
|
+
expanded: controlledExpanded,
|
|
221
|
+
onExpandedChange,
|
|
222
|
+
className,
|
|
223
|
+
renderToolbar,
|
|
224
|
+
renderFooter,
|
|
225
|
+
renderPagination,
|
|
226
|
+
}: DataTableProps<TData, TValue>,
|
|
227
|
+
ref: React.ForwardedRef<HTMLDivElement>
|
|
228
|
+
) {
|
|
229
|
+
// Internal state for uncontrolled mode
|
|
230
|
+
const [internalSorting, setInternalSorting] = React.useState<SortingState>(
|
|
231
|
+
[]
|
|
232
|
+
);
|
|
233
|
+
const [internalColumnFilters, setInternalColumnFilters] =
|
|
234
|
+
React.useState<ColumnFiltersState>([]);
|
|
235
|
+
const [internalGlobalFilter, setInternalGlobalFilter] =
|
|
236
|
+
React.useState<string>("");
|
|
237
|
+
const [internalRowSelection, setInternalRowSelection] =
|
|
238
|
+
React.useState<RowSelectionState>({});
|
|
239
|
+
const [internalColumnOrder, setInternalColumnOrder] =
|
|
240
|
+
React.useState<ColumnOrderState>([]);
|
|
241
|
+
const [internalColumnPinning, setInternalColumnPinning] =
|
|
242
|
+
React.useState<ColumnPinningState>({});
|
|
243
|
+
const [internalRowPinning, setInternalRowPinning] =
|
|
244
|
+
React.useState<RowPinningState>({});
|
|
245
|
+
const [internalGrouping, setInternalGrouping] = React.useState<GroupingState>(
|
|
246
|
+
[]
|
|
247
|
+
);
|
|
248
|
+
const [internalExpanded, setInternalExpanded] = React.useState<ExpandedState>(
|
|
249
|
+
{}
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
// Use controlled state if provided, otherwise use internal state
|
|
253
|
+
const sorting = controlledSorting ?? internalSorting;
|
|
254
|
+
const columnFilters = controlledColumnFilters ?? internalColumnFilters;
|
|
255
|
+
const globalFilter = controlledGlobalFilter ?? internalGlobalFilter;
|
|
256
|
+
const rowSelection = controlledRowSelection ?? internalRowSelection;
|
|
257
|
+
const columnOrder = controlledColumnOrder ?? internalColumnOrder;
|
|
258
|
+
const columnPinning = controlledColumnPinning ?? internalColumnPinning;
|
|
259
|
+
const rowPinning = controlledRowPinning ?? internalRowPinning;
|
|
260
|
+
const grouping = controlledGrouping ?? internalGrouping;
|
|
261
|
+
const expanded = controlledExpanded ?? internalExpanded;
|
|
262
|
+
|
|
263
|
+
// State change handlers
|
|
264
|
+
const handleSortingChange = React.useCallback(
|
|
265
|
+
(updater: SortingState | ((old: SortingState) => SortingState)) => {
|
|
266
|
+
const newValue =
|
|
267
|
+
typeof updater === "function" ? updater(sorting) : updater;
|
|
268
|
+
if (onSortingChange) {
|
|
269
|
+
onSortingChange(newValue);
|
|
270
|
+
} else {
|
|
271
|
+
setInternalSorting(newValue);
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
[sorting, onSortingChange]
|
|
275
|
+
);
|
|
276
|
+
|
|
277
|
+
const handleColumnFiltersChange = React.useCallback(
|
|
278
|
+
(
|
|
279
|
+
updater:
|
|
280
|
+
| ColumnFiltersState
|
|
281
|
+
| ((old: ColumnFiltersState) => ColumnFiltersState)
|
|
282
|
+
) => {
|
|
283
|
+
const newValue =
|
|
284
|
+
typeof updater === "function" ? updater(columnFilters) : updater;
|
|
285
|
+
if (onColumnFiltersChange) {
|
|
286
|
+
onColumnFiltersChange(newValue);
|
|
287
|
+
} else {
|
|
288
|
+
setInternalColumnFilters(newValue);
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
[columnFilters, onColumnFiltersChange]
|
|
292
|
+
);
|
|
293
|
+
|
|
294
|
+
const handleGlobalFilterChange = React.useCallback(
|
|
295
|
+
(updater: string | ((old: string) => string)) => {
|
|
296
|
+
const newValue =
|
|
297
|
+
typeof updater === "function" ? updater(globalFilter) : updater;
|
|
298
|
+
if (onGlobalFilterChange) {
|
|
299
|
+
onGlobalFilterChange(newValue);
|
|
300
|
+
} else {
|
|
301
|
+
setInternalGlobalFilter(newValue);
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
[globalFilter, onGlobalFilterChange]
|
|
305
|
+
);
|
|
306
|
+
|
|
307
|
+
const handleRowSelectionChange = React.useCallback(
|
|
308
|
+
(
|
|
309
|
+
updater:
|
|
310
|
+
| RowSelectionState
|
|
311
|
+
| ((old: RowSelectionState) => RowSelectionState)
|
|
312
|
+
) => {
|
|
313
|
+
const newValue =
|
|
314
|
+
typeof updater === "function" ? updater(rowSelection) : updater;
|
|
315
|
+
if (onRowSelectionChange) {
|
|
316
|
+
onRowSelectionChange(newValue);
|
|
317
|
+
} else {
|
|
318
|
+
setInternalRowSelection(newValue);
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
[rowSelection, onRowSelectionChange]
|
|
322
|
+
);
|
|
323
|
+
|
|
324
|
+
const handleColumnOrderChange = React.useCallback(
|
|
325
|
+
(
|
|
326
|
+
updater: ColumnOrderState | ((old: ColumnOrderState) => ColumnOrderState)
|
|
327
|
+
) => {
|
|
328
|
+
const newValue =
|
|
329
|
+
typeof updater === "function" ? updater(columnOrder) : updater;
|
|
330
|
+
if (onColumnOrderChange) {
|
|
331
|
+
onColumnOrderChange(newValue);
|
|
332
|
+
} else {
|
|
333
|
+
setInternalColumnOrder(newValue);
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
[columnOrder, onColumnOrderChange]
|
|
337
|
+
);
|
|
338
|
+
|
|
339
|
+
const handleColumnPinningChange = React.useCallback(
|
|
340
|
+
(
|
|
341
|
+
updater:
|
|
342
|
+
| ColumnPinningState
|
|
343
|
+
| ((old: ColumnPinningState) => ColumnPinningState)
|
|
344
|
+
) => {
|
|
345
|
+
const newValue =
|
|
346
|
+
typeof updater === "function" ? updater(columnPinning) : updater;
|
|
347
|
+
if (onColumnPinningChange) {
|
|
348
|
+
onColumnPinningChange(newValue);
|
|
349
|
+
} else {
|
|
350
|
+
setInternalColumnPinning(newValue);
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
[columnPinning, onColumnPinningChange]
|
|
354
|
+
);
|
|
355
|
+
|
|
356
|
+
const handleRowPinningChange = React.useCallback(
|
|
357
|
+
(
|
|
358
|
+
updater: RowPinningState | ((old: RowPinningState) => RowPinningState)
|
|
359
|
+
) => {
|
|
360
|
+
const newValue =
|
|
361
|
+
typeof updater === "function" ? updater(rowPinning) : updater;
|
|
362
|
+
if (onRowPinningChange) {
|
|
363
|
+
onRowPinningChange(newValue);
|
|
364
|
+
} else {
|
|
365
|
+
setInternalRowPinning(newValue);
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
[rowPinning, onRowPinningChange]
|
|
369
|
+
);
|
|
370
|
+
|
|
371
|
+
const handleGroupingChange = React.useCallback(
|
|
372
|
+
(updater: GroupingState | ((old: GroupingState) => GroupingState)) => {
|
|
373
|
+
const newValue =
|
|
374
|
+
typeof updater === "function" ? updater(grouping) : updater;
|
|
375
|
+
if (onGroupingChange) {
|
|
376
|
+
onGroupingChange(newValue);
|
|
377
|
+
} else {
|
|
378
|
+
setInternalGrouping(newValue);
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
[grouping, onGroupingChange]
|
|
382
|
+
);
|
|
383
|
+
|
|
384
|
+
const handleExpandedChange = React.useCallback(
|
|
385
|
+
(updater: ExpandedState | ((old: ExpandedState) => ExpandedState)) => {
|
|
386
|
+
const newValue =
|
|
387
|
+
typeof updater === "function" ? updater(expanded) : updater;
|
|
388
|
+
if (onExpandedChange) {
|
|
389
|
+
onExpandedChange(newValue);
|
|
390
|
+
} else {
|
|
391
|
+
setInternalExpanded(newValue);
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
[expanded, onExpandedChange]
|
|
395
|
+
);
|
|
396
|
+
|
|
397
|
+
// eslint-disable-next-line react-hooks/incompatible-library -- TanStack Table API is designed for React and works correctly with this pattern
|
|
398
|
+
const table = useReactTable<TData>({
|
|
399
|
+
data,
|
|
400
|
+
columns: columns as ColumnDef<TData, unknown>[],
|
|
401
|
+
getCoreRowModel: getCoreRowModel(),
|
|
402
|
+
|
|
403
|
+
// Pagination
|
|
404
|
+
...(enablePagination && {
|
|
405
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
406
|
+
initialState: {
|
|
407
|
+
pagination: {
|
|
408
|
+
pageSize,
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
}),
|
|
412
|
+
|
|
413
|
+
// Sorting
|
|
414
|
+
...(enableSorting && {
|
|
415
|
+
getSortedRowModel: getSortedRowModel(),
|
|
416
|
+
onSortingChange: handleSortingChange,
|
|
417
|
+
}),
|
|
418
|
+
|
|
419
|
+
// Column Filtering
|
|
420
|
+
...(enableFiltering && {
|
|
421
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
422
|
+
onColumnFiltersChange: handleColumnFiltersChange,
|
|
423
|
+
}),
|
|
424
|
+
|
|
425
|
+
// Global Filtering
|
|
426
|
+
...(enableGlobalFiltering && {
|
|
427
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
428
|
+
onGlobalFilterChange: handleGlobalFilterChange,
|
|
429
|
+
globalFilterFn: "includesString",
|
|
430
|
+
}),
|
|
431
|
+
|
|
432
|
+
// Row Selection
|
|
433
|
+
...(enableRowSelection && {
|
|
434
|
+
enableRowSelection: true,
|
|
435
|
+
onRowSelectionChange: handleRowSelectionChange,
|
|
436
|
+
}),
|
|
437
|
+
|
|
438
|
+
// Column Ordering
|
|
439
|
+
...(enableColumnOrdering && {
|
|
440
|
+
onColumnOrderChange: handleColumnOrderChange,
|
|
441
|
+
}),
|
|
442
|
+
|
|
443
|
+
// Column Pinning
|
|
444
|
+
...(enableColumnPinning && {
|
|
445
|
+
onColumnPinningChange: handleColumnPinningChange,
|
|
446
|
+
}),
|
|
447
|
+
|
|
448
|
+
// Row Pinning
|
|
449
|
+
...(enableRowPinning && {
|
|
450
|
+
enableRowPinning: true,
|
|
451
|
+
onRowPinningChange: handleRowPinningChange,
|
|
452
|
+
keepPinnedRows: true,
|
|
453
|
+
}),
|
|
454
|
+
|
|
455
|
+
// Grouping
|
|
456
|
+
...(enableGrouping && {
|
|
457
|
+
getGroupedRowModel: getGroupedRowModel(),
|
|
458
|
+
getExpandedRowModel: getExpandedRowModel(),
|
|
459
|
+
onGroupingChange: handleGroupingChange,
|
|
460
|
+
onExpandedChange: handleExpandedChange,
|
|
461
|
+
}),
|
|
462
|
+
|
|
463
|
+
// Expanding
|
|
464
|
+
...(enableExpanding && {
|
|
465
|
+
getExpandedRowModel: getExpandedRowModel(),
|
|
466
|
+
onExpandedChange: handleExpandedChange,
|
|
467
|
+
getSubRows,
|
|
468
|
+
}),
|
|
469
|
+
|
|
470
|
+
// Faceting (for filter dropdowns)
|
|
471
|
+
...(enableFaceting && {
|
|
472
|
+
getFacetedRowModel: getFacetedRowModel(),
|
|
473
|
+
getFacetedUniqueValues: getFacetedUniqueValues(),
|
|
474
|
+
getFacetedMinMaxValues: getFacetedMinMaxValues(),
|
|
475
|
+
}),
|
|
476
|
+
|
|
477
|
+
// State
|
|
478
|
+
state: {
|
|
479
|
+
sorting,
|
|
480
|
+
columnFilters,
|
|
481
|
+
globalFilter,
|
|
482
|
+
rowSelection,
|
|
483
|
+
columnOrder,
|
|
484
|
+
columnPinning,
|
|
485
|
+
rowPinning,
|
|
486
|
+
grouping,
|
|
487
|
+
expanded,
|
|
488
|
+
},
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
return (
|
|
492
|
+
<div
|
|
493
|
+
ref={ref}
|
|
494
|
+
className={className}
|
|
495
|
+
data-hook={dataHook}
|
|
496
|
+
data-slot="data-table"
|
|
497
|
+
data-tracking-el={trackingEl}
|
|
498
|
+
data-tracking-label={trackingLabel}
|
|
499
|
+
>
|
|
500
|
+
{renderToolbar && renderToolbar(table)}
|
|
501
|
+
|
|
502
|
+
<Table dataHook={`${dataHook}-table`}>
|
|
503
|
+
<TableHeader>
|
|
504
|
+
{table.getHeaderGroups().map((headerGroup) => (
|
|
505
|
+
<TableRow key={headerGroup.id}>
|
|
506
|
+
{headerGroup.headers.map((header) => (
|
|
507
|
+
<TableHead key={header.id} colSpan={header.colSpan}>
|
|
508
|
+
{header.isPlaceholder
|
|
509
|
+
? null
|
|
510
|
+
: flexRender(
|
|
511
|
+
header.column.columnDef.header,
|
|
512
|
+
header.getContext()
|
|
513
|
+
)}
|
|
514
|
+
</TableHead>
|
|
515
|
+
))}
|
|
516
|
+
</TableRow>
|
|
517
|
+
))}
|
|
518
|
+
</TableHeader>
|
|
519
|
+
<TableBody>
|
|
520
|
+
{/* Loading skeleton rows */}
|
|
521
|
+
{isLoading ? (
|
|
522
|
+
Array.from({ length: skeletonRowCount ?? pageSize }).map(
|
|
523
|
+
(_, rowIndex) => (
|
|
524
|
+
<TableRow key={`skeleton-${rowIndex}`}>
|
|
525
|
+
{table.getVisibleLeafColumns().map((_, colIndex) => (
|
|
526
|
+
<TableCell key={`skeleton-${rowIndex}-${colIndex}`}>
|
|
527
|
+
<Skeleton className="h-4 w-full" />
|
|
528
|
+
</TableCell>
|
|
529
|
+
))}
|
|
530
|
+
</TableRow>
|
|
531
|
+
)
|
|
532
|
+
)
|
|
533
|
+
) : (
|
|
534
|
+
<>
|
|
535
|
+
{/* Top pinned rows */}
|
|
536
|
+
{enableRowPinning &&
|
|
537
|
+
table.getTopRows().map((row) => (
|
|
538
|
+
<TableRow
|
|
539
|
+
key={row.id}
|
|
540
|
+
data-state={row.getIsSelected() && "selected"}
|
|
541
|
+
>
|
|
542
|
+
{row.getVisibleCells().map((cell) => (
|
|
543
|
+
<TableCell key={cell.id}>
|
|
544
|
+
{flexRender(
|
|
545
|
+
cell.column.columnDef.cell,
|
|
546
|
+
cell.getContext()
|
|
547
|
+
)}
|
|
548
|
+
</TableCell>
|
|
549
|
+
))}
|
|
550
|
+
</TableRow>
|
|
551
|
+
))}
|
|
552
|
+
|
|
553
|
+
{/* Regular rows */}
|
|
554
|
+
{table.getRowModel().rows?.length ? (
|
|
555
|
+
table.getRowModel().rows.map((row) => (
|
|
556
|
+
<TableRow
|
|
557
|
+
key={row.id}
|
|
558
|
+
data-state={row.getIsSelected() && "selected"}
|
|
559
|
+
>
|
|
560
|
+
{row.getVisibleCells().map((cell) => (
|
|
561
|
+
<TableCell key={cell.id}>
|
|
562
|
+
{flexRender(
|
|
563
|
+
cell.column.columnDef.cell,
|
|
564
|
+
cell.getContext()
|
|
565
|
+
)}
|
|
566
|
+
</TableCell>
|
|
567
|
+
))}
|
|
568
|
+
</TableRow>
|
|
569
|
+
))
|
|
570
|
+
) : (
|
|
571
|
+
<TableRow>
|
|
572
|
+
<TableCell colSpan={table.getVisibleLeafColumns().length}>
|
|
573
|
+
{noResultsMessage}
|
|
574
|
+
</TableCell>
|
|
575
|
+
</TableRow>
|
|
576
|
+
)}
|
|
577
|
+
|
|
578
|
+
{/* Bottom pinned rows */}
|
|
579
|
+
{enableRowPinning &&
|
|
580
|
+
table.getBottomRows().map((row) => (
|
|
581
|
+
<TableRow
|
|
582
|
+
key={row.id}
|
|
583
|
+
data-state={row.getIsSelected() && "selected"}
|
|
584
|
+
>
|
|
585
|
+
{row.getVisibleCells().map((cell) => (
|
|
586
|
+
<TableCell key={cell.id}>
|
|
587
|
+
{flexRender(
|
|
588
|
+
cell.column.columnDef.cell,
|
|
589
|
+
cell.getContext()
|
|
590
|
+
)}
|
|
591
|
+
</TableCell>
|
|
592
|
+
))}
|
|
593
|
+
</TableRow>
|
|
594
|
+
))}
|
|
595
|
+
</>
|
|
596
|
+
)}
|
|
597
|
+
</TableBody>
|
|
598
|
+
{renderFooter && renderFooter(table)}
|
|
599
|
+
</Table>
|
|
600
|
+
|
|
601
|
+
{renderPagination && renderPagination(table)}
|
|
602
|
+
</div>
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* DataTable component with forwardRef support for generic types
|
|
608
|
+
*/
|
|
609
|
+
const DataTable = React.forwardRef(DataTableInner) as <TData, TValue>(
|
|
610
|
+
props: DataTableProps<TData, TValue> & {
|
|
611
|
+
ref?: React.ForwardedRef<HTMLDivElement>;
|
|
612
|
+
}
|
|
613
|
+
) => React.ReactElement;
|
|
614
|
+
|
|
615
|
+
(DataTable as React.FC).displayName = "DataTable";
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* DataTableColumnHeader - Sortable column header with sort indicator icons
|
|
619
|
+
* Matches Figma TableHead/Button variant design
|
|
620
|
+
*/
|
|
621
|
+
interface DataTableColumnHeaderProps<
|
|
622
|
+
TData,
|
|
623
|
+
TValue,
|
|
624
|
+
> extends React.HTMLAttributes<HTMLDivElement> {
|
|
625
|
+
column: Column<TData, TValue>;
|
|
626
|
+
title: string;
|
|
627
|
+
dataHook?: string;
|
|
628
|
+
/** Tracking element identifier for analytics */
|
|
629
|
+
trackingEl?: string;
|
|
630
|
+
/** Tracking label for analytics context */
|
|
631
|
+
trackingLabel?: string;
|
|
632
|
+
/** Align header content - matches cell alignment */
|
|
633
|
+
align?: "left" | "center" | "right";
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
function DataTableColumnHeader<TData, TValue>({
|
|
637
|
+
column,
|
|
638
|
+
title,
|
|
639
|
+
className,
|
|
640
|
+
dataHook,
|
|
641
|
+
trackingEl,
|
|
642
|
+
trackingLabel,
|
|
643
|
+
align = "left",
|
|
644
|
+
}: DataTableColumnHeaderProps<TData, TValue>) {
|
|
645
|
+
if (!column.getCanSort()) {
|
|
646
|
+
return (
|
|
647
|
+
<div
|
|
648
|
+
className={cn(
|
|
649
|
+
"text-left",
|
|
650
|
+
align === "right" && "text-right",
|
|
651
|
+
align === "center" && "text-center",
|
|
652
|
+
className
|
|
653
|
+
)}
|
|
654
|
+
data-hook={dataHook}
|
|
655
|
+
data-slot="data-table-column-header"
|
|
656
|
+
data-tracking-el={trackingEl}
|
|
657
|
+
data-tracking-label={trackingLabel}
|
|
658
|
+
>
|
|
659
|
+
{title}
|
|
660
|
+
</div>
|
|
661
|
+
);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
const sortState = column.getIsSorted();
|
|
665
|
+
const sortLabel = sortState === "desc"
|
|
666
|
+
? `Sort by ${title}, currently descending`
|
|
667
|
+
: sortState === "asc"
|
|
668
|
+
? `Sort by ${title}, currently ascending`
|
|
669
|
+
: `Sort by ${title}`;
|
|
670
|
+
|
|
671
|
+
return (
|
|
672
|
+
<div
|
|
673
|
+
className={cn(
|
|
674
|
+
"flex items-center",
|
|
675
|
+
align === "right" && "justify-end",
|
|
676
|
+
align === "center" && "justify-center",
|
|
677
|
+
className
|
|
678
|
+
)}
|
|
679
|
+
data-slot="data-table-column-header"
|
|
680
|
+
data-tracking-el={trackingEl}
|
|
681
|
+
data-tracking-label={trackingLabel}
|
|
682
|
+
>
|
|
683
|
+
{/* Override padding for inline header appearance - consider adding ButtonSize.ICON variant */}
|
|
684
|
+
<Button
|
|
685
|
+
aria-label={sortLabel}
|
|
686
|
+
className={cn("p-0")}
|
|
687
|
+
dataHook={dataHook || `column-header-${column.id}`}
|
|
688
|
+
size={ButtonSize.SM}
|
|
689
|
+
variant={ButtonVariant.GHOST}
|
|
690
|
+
onClick={() => column.toggleSorting(sortState === "asc")}
|
|
691
|
+
>
|
|
692
|
+
<span aria-hidden="true">{title}</span>
|
|
693
|
+
<span aria-hidden="true" className="flex size-3 items-center justify-center">
|
|
694
|
+
{sortState === "desc" ? (
|
|
695
|
+
<ArrowDownIcon className="size-3" />
|
|
696
|
+
) : sortState === "asc" ? (
|
|
697
|
+
<ArrowUpIcon className="size-3" />
|
|
698
|
+
) : (
|
|
699
|
+
<ArrowUpDownIcon className="size-3" />
|
|
700
|
+
)}
|
|
701
|
+
</span>
|
|
702
|
+
</Button>
|
|
703
|
+
</div>
|
|
704
|
+
);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
DataTableColumnHeader.displayName = "DataTableColumnHeader";
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* DataTableRowActions - Action cell with ellipsis dropdown menu
|
|
711
|
+
* Matches Figma TableCell/Action variant design
|
|
712
|
+
*/
|
|
713
|
+
interface DataTableRowActionsProps<TData> {
|
|
714
|
+
row: Row<TData>;
|
|
715
|
+
dataHook?: string;
|
|
716
|
+
/** Tracking element identifier for analytics */
|
|
717
|
+
trackingEl?: string;
|
|
718
|
+
/** Tracking label for analytics context */
|
|
719
|
+
trackingLabel?: string;
|
|
720
|
+
/** Accessible label for the actions button */
|
|
721
|
+
ariaLabel?: string;
|
|
722
|
+
children?: React.ReactNode;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
function DataTableRowActions<TData>({
|
|
726
|
+
row,
|
|
727
|
+
dataHook,
|
|
728
|
+
trackingEl,
|
|
729
|
+
trackingLabel,
|
|
730
|
+
ariaLabel = "Open row actions menu",
|
|
731
|
+
children,
|
|
732
|
+
}: DataTableRowActionsProps<TData>) {
|
|
733
|
+
return (
|
|
734
|
+
<DropdownMenu>
|
|
735
|
+
<DropdownMenuTrigger asChild data-slot="data-table-row-actions">
|
|
736
|
+
<Button
|
|
737
|
+
aria-label={ariaLabel}
|
|
738
|
+
dataHook={dataHook || `row-actions-${row.id}`}
|
|
739
|
+
size={ButtonSize.SM}
|
|
740
|
+
trackingEl={trackingEl}
|
|
741
|
+
trackingLabel={trackingLabel}
|
|
742
|
+
variant={ButtonVariant.GHOST}
|
|
743
|
+
>
|
|
744
|
+
<EllipsisIcon className="size-4" />
|
|
745
|
+
</Button>
|
|
746
|
+
</DropdownMenuTrigger>
|
|
747
|
+
<DropdownMenuContent align="end" dataHook={`${dataHook}-menu`}>
|
|
748
|
+
{children}
|
|
749
|
+
</DropdownMenuContent>
|
|
750
|
+
</DropdownMenu>
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
DataTableRowActions.displayName = "DataTableRowActions";
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* DataTableToolbar - Flexible toolbar container for DataTable
|
|
758
|
+
* Provides a two-column layout with left and right content areas
|
|
759
|
+
*
|
|
760
|
+
* @example
|
|
761
|
+
* // Simple usage with just children on the right
|
|
762
|
+
* <DataTableToolbar dataHook="toolbar">
|
|
763
|
+
* <DataTablePagination table={table} />
|
|
764
|
+
* </DataTableToolbar>
|
|
765
|
+
*
|
|
766
|
+
* @example
|
|
767
|
+
* // With search and filters on left, pagination on right
|
|
768
|
+
* <DataTableToolbar dataHook="toolbar">
|
|
769
|
+
* <DataTableToolbar.Left>
|
|
770
|
+
* <DataTableSearch table={table} dataHook="search" column="name" />
|
|
771
|
+
* <Button>Filters</Button>
|
|
772
|
+
* </DataTableToolbar.Left>
|
|
773
|
+
* <DataTableToolbar.Right>
|
|
774
|
+
* <DataTablePagination table={table} />
|
|
775
|
+
* </DataTableToolbar.Right>
|
|
776
|
+
* </DataTableToolbar>
|
|
777
|
+
*/
|
|
778
|
+
interface DataTableToolbarProps {
|
|
779
|
+
/** Data hook for automated testing */
|
|
780
|
+
dataHook?: string;
|
|
781
|
+
/** Tracking element identifier for analytics */
|
|
782
|
+
trackingEl?: string;
|
|
783
|
+
/** Tracking label for analytics context */
|
|
784
|
+
trackingLabel?: string;
|
|
785
|
+
/** Additional class name for styling */
|
|
786
|
+
className?: string;
|
|
787
|
+
/** Content to render in the toolbar */
|
|
788
|
+
children?: React.ReactNode;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
function DataTableToolbar({
|
|
792
|
+
dataHook,
|
|
793
|
+
trackingEl,
|
|
794
|
+
trackingLabel,
|
|
795
|
+
className,
|
|
796
|
+
children,
|
|
797
|
+
}: DataTableToolbarProps) {
|
|
798
|
+
return (
|
|
799
|
+
<div
|
|
800
|
+
className={cn(
|
|
801
|
+
"flex flex-wrap items-center justify-between gap-2 py-4",
|
|
802
|
+
className
|
|
803
|
+
)}
|
|
804
|
+
data-hook={dataHook}
|
|
805
|
+
data-slot="data-table-toolbar"
|
|
806
|
+
data-tracking-el={trackingEl}
|
|
807
|
+
data-tracking-label={trackingLabel}
|
|
808
|
+
>
|
|
809
|
+
{children}
|
|
810
|
+
</div>
|
|
811
|
+
);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
* DataTableToolbar.Left - Left section of the toolbar
|
|
816
|
+
* Use for search, filters, and other primary actions
|
|
817
|
+
*/
|
|
818
|
+
interface DataTableToolbarLeftProps {
|
|
819
|
+
/** Data hook for automated testing */
|
|
820
|
+
dataHook?: string;
|
|
821
|
+
/** Tracking element identifier for analytics */
|
|
822
|
+
trackingEl?: string;
|
|
823
|
+
/** Tracking label for analytics context */
|
|
824
|
+
trackingLabel?: string;
|
|
825
|
+
/** Additional class name for styling */
|
|
826
|
+
className?: string;
|
|
827
|
+
/** Content to render on the left side */
|
|
828
|
+
children?: React.ReactNode;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
function DataTableToolbarLeft({
|
|
832
|
+
dataHook,
|
|
833
|
+
trackingEl,
|
|
834
|
+
trackingLabel,
|
|
835
|
+
className,
|
|
836
|
+
children,
|
|
837
|
+
}: DataTableToolbarLeftProps) {
|
|
838
|
+
return (
|
|
839
|
+
<div
|
|
840
|
+
className={cn("flex items-center gap-2", className)}
|
|
841
|
+
data-hook={dataHook}
|
|
842
|
+
data-slot="data-table-toolbar-left"
|
|
843
|
+
data-tracking-el={trackingEl}
|
|
844
|
+
data-tracking-label={trackingLabel}
|
|
845
|
+
>
|
|
846
|
+
{children}
|
|
847
|
+
</div>
|
|
848
|
+
);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
DataTableToolbarLeft.displayName = "DataTableToolbar.Left";
|
|
852
|
+
|
|
853
|
+
/**
|
|
854
|
+
* DataTableToolbar.Right - Right section of the toolbar
|
|
855
|
+
* Use for pagination, view options, and secondary actions
|
|
856
|
+
*/
|
|
857
|
+
interface DataTableToolbarRightProps {
|
|
858
|
+
/** Data hook for automated testing */
|
|
859
|
+
dataHook?: string;
|
|
860
|
+
/** Tracking element identifier for analytics */
|
|
861
|
+
trackingEl?: string;
|
|
862
|
+
/** Tracking label for analytics context */
|
|
863
|
+
trackingLabel?: string;
|
|
864
|
+
/** Additional class name for styling */
|
|
865
|
+
className?: string;
|
|
866
|
+
/** Content to render on the right side */
|
|
867
|
+
children?: React.ReactNode;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
function DataTableToolbarRight({
|
|
871
|
+
dataHook,
|
|
872
|
+
trackingEl,
|
|
873
|
+
trackingLabel,
|
|
874
|
+
className,
|
|
875
|
+
children,
|
|
876
|
+
}: DataTableToolbarRightProps) {
|
|
877
|
+
return (
|
|
878
|
+
<div
|
|
879
|
+
className={cn("flex items-center gap-2", className)}
|
|
880
|
+
data-hook={dataHook}
|
|
881
|
+
data-slot="data-table-toolbar-right"
|
|
882
|
+
data-tracking-el={trackingEl}
|
|
883
|
+
data-tracking-label={trackingLabel}
|
|
884
|
+
>
|
|
885
|
+
{children}
|
|
886
|
+
</div>
|
|
887
|
+
);
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
DataTableToolbarRight.displayName = "DataTableToolbar.Right";
|
|
891
|
+
|
|
892
|
+
// Attach sub-components to DataTableToolbar
|
|
893
|
+
DataTableToolbar.Left = DataTableToolbarLeft;
|
|
894
|
+
DataTableToolbar.Right = DataTableToolbarRight;
|
|
895
|
+
DataTableToolbar.displayName = "DataTableToolbar";
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* DataTableSearch - Search input for filtering table data
|
|
899
|
+
* Can filter a specific column or use global filtering
|
|
900
|
+
*/
|
|
901
|
+
interface DataTableSearchProps<TData> {
|
|
902
|
+
/** TanStack Table instance */
|
|
903
|
+
table: TanStackTable<TData>;
|
|
904
|
+
/** Data hook for automated testing (REQUIRED) */
|
|
905
|
+
dataHook: string;
|
|
906
|
+
/** Tracking element identifier for analytics */
|
|
907
|
+
trackingEl?: string;
|
|
908
|
+
/** Tracking label for analytics context */
|
|
909
|
+
trackingLabel?: string;
|
|
910
|
+
/** Accessible label for the search input (defaults to "Search table") */
|
|
911
|
+
ariaLabel?: string;
|
|
912
|
+
/** Placeholder text for the search input */
|
|
913
|
+
placeholder?: string;
|
|
914
|
+
/** Column ID to filter. If not provided, uses global filter. */
|
|
915
|
+
column?: string;
|
|
916
|
+
/** Width of the search input (e.g., "180px", "200px") */
|
|
917
|
+
width?: string;
|
|
918
|
+
/** Additional class name for styling */
|
|
919
|
+
className?: string;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
function DataTableSearch<TData>({
|
|
923
|
+
table,
|
|
924
|
+
dataHook,
|
|
925
|
+
trackingEl,
|
|
926
|
+
trackingLabel,
|
|
927
|
+
ariaLabel = "Search table",
|
|
928
|
+
placeholder = "Search...",
|
|
929
|
+
column,
|
|
930
|
+
width,
|
|
931
|
+
className,
|
|
932
|
+
}: DataTableSearchProps<TData>) {
|
|
933
|
+
const filterValue = column
|
|
934
|
+
? ((table.getColumn(column)?.getFilterValue() as string) ?? "")
|
|
935
|
+
: (table.getState().globalFilter ?? "");
|
|
936
|
+
|
|
937
|
+
const handleFilterChange = (value: string) => {
|
|
938
|
+
if (column) {
|
|
939
|
+
table.getColumn(column)?.setFilterValue(value);
|
|
940
|
+
} else {
|
|
941
|
+
table.setGlobalFilter(value);
|
|
942
|
+
}
|
|
943
|
+
};
|
|
944
|
+
|
|
945
|
+
return (
|
|
946
|
+
<div
|
|
947
|
+
className={cn(!width && "w-full max-w-sm", className)}
|
|
948
|
+
data-slot="data-table-search"
|
|
949
|
+
style={width ? { width, minWidth: width } : undefined}
|
|
950
|
+
>
|
|
951
|
+
<Input
|
|
952
|
+
aria-label={ariaLabel}
|
|
953
|
+
className="rounded-full"
|
|
954
|
+
dataHook={dataHook}
|
|
955
|
+
placeholder={placeholder}
|
|
956
|
+
secondaryIcon={<SearchIcon className="size-4" />}
|
|
957
|
+
trackingEl={trackingEl}
|
|
958
|
+
trackingLabel={trackingLabel}
|
|
959
|
+
type="text"
|
|
960
|
+
value={filterValue}
|
|
961
|
+
onChange={(event) => handleFilterChange(event.target.value)}
|
|
962
|
+
/>
|
|
963
|
+
</div>
|
|
964
|
+
);
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
DataTableSearch.displayName = "DataTableSearch";
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* DataTablePagination - Pagination controls with row count info
|
|
971
|
+
* Uses the Pagination component for consistent styling
|
|
972
|
+
*/
|
|
973
|
+
interface DataTablePaginationProps<TData> {
|
|
974
|
+
table: TanStackTable<TData>;
|
|
975
|
+
/** Data hook for automated testing (REQUIRED) */
|
|
976
|
+
dataHook: string;
|
|
977
|
+
/** Tracking element identifier for analytics */
|
|
978
|
+
trackingEl?: string;
|
|
979
|
+
/** Tracking label for analytics context */
|
|
980
|
+
trackingLabel?: string;
|
|
981
|
+
/** Additional class name for styling */
|
|
982
|
+
className?: string;
|
|
983
|
+
/** Accessible label for the pagination navigation (for unique landmark identification) */
|
|
984
|
+
ariaLabel?: string;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
function DataTablePagination<TData>({
|
|
988
|
+
table,
|
|
989
|
+
dataHook,
|
|
990
|
+
trackingEl,
|
|
991
|
+
trackingLabel,
|
|
992
|
+
className,
|
|
993
|
+
ariaLabel = "Table pagination",
|
|
994
|
+
}: DataTablePaginationProps<TData>) {
|
|
995
|
+
const currentPage = table.getState().pagination.pageIndex + 1;
|
|
996
|
+
const totalPages = table.getPageCount();
|
|
997
|
+
const pageSize = table.getState().pagination.pageSize;
|
|
998
|
+
const totalRows = table.getFilteredRowModel().rows.length;
|
|
999
|
+
|
|
1000
|
+
// Calculate the range of rows being displayed
|
|
1001
|
+
// When there are no rows, show "0 of 0" instead of "1-0 of 0"
|
|
1002
|
+
const startRow = totalRows === 0 ? 0 : (currentPage - 1) * pageSize + 1;
|
|
1003
|
+
const endRow = Math.min(currentPage * pageSize, totalRows);
|
|
1004
|
+
|
|
1005
|
+
const paginationItems = usePagination({
|
|
1006
|
+
page: currentPage,
|
|
1007
|
+
totalPages,
|
|
1008
|
+
siblingCount: 1,
|
|
1009
|
+
boundaryCount: 1,
|
|
1010
|
+
});
|
|
1011
|
+
|
|
1012
|
+
return (
|
|
1013
|
+
<div
|
|
1014
|
+
className={cn("flex items-center justify-end gap-4", className)}
|
|
1015
|
+
data-hook={dataHook}
|
|
1016
|
+
data-slot="data-table-pagination"
|
|
1017
|
+
data-tracking-el={trackingEl}
|
|
1018
|
+
data-tracking-label={trackingLabel}
|
|
1019
|
+
>
|
|
1020
|
+
<span className="text-muted-foreground text-sm">
|
|
1021
|
+
{totalRows === 0 ? "0 of 0" : `${startRow}-${endRow} of ${totalRows}`}
|
|
1022
|
+
</span>
|
|
1023
|
+
<Pagination
|
|
1024
|
+
ariaLabel={ariaLabel}
|
|
1025
|
+
className="mx-0 w-auto justify-end"
|
|
1026
|
+
dataHook={`${dataHook}-nav`}
|
|
1027
|
+
>
|
|
1028
|
+
<PaginationContent>
|
|
1029
|
+
{paginationItems.map((item, index) => {
|
|
1030
|
+
if (item === "previous") {
|
|
1031
|
+
return (
|
|
1032
|
+
<PaginationItem key="previous">
|
|
1033
|
+
<PaginationPrevious
|
|
1034
|
+
disabled={!table.getCanPreviousPage()}
|
|
1035
|
+
onClick={() => table.previousPage()}
|
|
1036
|
+
/>
|
|
1037
|
+
</PaginationItem>
|
|
1038
|
+
);
|
|
1039
|
+
}
|
|
1040
|
+
if (item === "next") {
|
|
1041
|
+
return (
|
|
1042
|
+
<PaginationItem key="next">
|
|
1043
|
+
<PaginationNext
|
|
1044
|
+
disabled={!table.getCanNextPage()}
|
|
1045
|
+
onClick={() => table.nextPage()}
|
|
1046
|
+
/>
|
|
1047
|
+
</PaginationItem>
|
|
1048
|
+
);
|
|
1049
|
+
}
|
|
1050
|
+
if (item === "ellipsis") {
|
|
1051
|
+
return (
|
|
1052
|
+
<PaginationItem key={`ellipsis-${index}`}>
|
|
1053
|
+
<PaginationEllipsis />
|
|
1054
|
+
</PaginationItem>
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
1057
|
+
return (
|
|
1058
|
+
<PaginationItem key={item}>
|
|
1059
|
+
<PaginationLink
|
|
1060
|
+
isActive={item === currentPage}
|
|
1061
|
+
page={item}
|
|
1062
|
+
onClick={() => table.setPageIndex(item - 1)}
|
|
1063
|
+
/>
|
|
1064
|
+
</PaginationItem>
|
|
1065
|
+
);
|
|
1066
|
+
})}
|
|
1067
|
+
</PaginationContent>
|
|
1068
|
+
</Pagination>
|
|
1069
|
+
</div>
|
|
1070
|
+
);
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
DataTablePagination.displayName = "DataTablePagination";
|
|
1074
|
+
|
|
1075
|
+
/**
|
|
1076
|
+
* DataTableSelectAllCheckbox - Header checkbox for selecting all rows
|
|
1077
|
+
* Matches Figma TableHead/Checkbox variant
|
|
1078
|
+
*/
|
|
1079
|
+
interface DataTableSelectAllCheckboxProps<TData> {
|
|
1080
|
+
table: TanStackTable<TData>;
|
|
1081
|
+
dataHook?: string;
|
|
1082
|
+
/** Tracking element identifier for analytics */
|
|
1083
|
+
trackingEl?: string;
|
|
1084
|
+
/** Tracking label for analytics context */
|
|
1085
|
+
trackingLabel?: string;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
function DataTableSelectAllCheckbox<TData>({
|
|
1089
|
+
table,
|
|
1090
|
+
dataHook,
|
|
1091
|
+
trackingEl,
|
|
1092
|
+
trackingLabel,
|
|
1093
|
+
}: DataTableSelectAllCheckboxProps<TData>) {
|
|
1094
|
+
return (
|
|
1095
|
+
<Checkbox
|
|
1096
|
+
ariaLabel="Select all"
|
|
1097
|
+
checked={
|
|
1098
|
+
table.getIsAllPageRowsSelected() ||
|
|
1099
|
+
(table.getIsSomePageRowsSelected() && "indeterminate")
|
|
1100
|
+
}
|
|
1101
|
+
dataHook={dataHook || "select-all-checkbox"}
|
|
1102
|
+
trackingEl={trackingEl}
|
|
1103
|
+
trackingLabel={trackingLabel}
|
|
1104
|
+
onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}
|
|
1105
|
+
/>
|
|
1106
|
+
);
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
DataTableSelectAllCheckbox.displayName = "DataTableSelectAllCheckbox";
|
|
1110
|
+
|
|
1111
|
+
/**
|
|
1112
|
+
* DataTableSelectRowCheckbox - Row checkbox for selecting individual rows
|
|
1113
|
+
* Matches Figma TableCell/Checkbox variant
|
|
1114
|
+
*/
|
|
1115
|
+
interface DataTableSelectRowCheckboxProps<TData> {
|
|
1116
|
+
row: Row<TData>;
|
|
1117
|
+
dataHook?: string;
|
|
1118
|
+
/** Tracking element identifier for analytics */
|
|
1119
|
+
trackingEl?: string;
|
|
1120
|
+
/** Tracking label for analytics context */
|
|
1121
|
+
trackingLabel?: string;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
function DataTableSelectRowCheckbox<TData>({
|
|
1125
|
+
row,
|
|
1126
|
+
dataHook,
|
|
1127
|
+
trackingEl,
|
|
1128
|
+
trackingLabel,
|
|
1129
|
+
}: DataTableSelectRowCheckboxProps<TData>) {
|
|
1130
|
+
return (
|
|
1131
|
+
<Checkbox
|
|
1132
|
+
ariaLabel="Select row"
|
|
1133
|
+
checked={row.getIsSelected()}
|
|
1134
|
+
dataHook={dataHook || `select-row-${row.id}`}
|
|
1135
|
+
disabled={!row.getCanSelect()}
|
|
1136
|
+
trackingEl={trackingEl}
|
|
1137
|
+
trackingLabel={trackingLabel}
|
|
1138
|
+
onCheckedChange={(value) => row.toggleSelected(!!value)}
|
|
1139
|
+
/>
|
|
1140
|
+
);
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
DataTableSelectRowCheckbox.displayName = "DataTableSelectRowCheckbox";
|
|
1144
|
+
|
|
1145
|
+
export {
|
|
1146
|
+
DataTable,
|
|
1147
|
+
DataTableColumnHeader,
|
|
1148
|
+
DataTableRowActions,
|
|
1149
|
+
DataTableToolbar,
|
|
1150
|
+
DataTableSearch,
|
|
1151
|
+
DataTablePagination,
|
|
1152
|
+
DataTableSelectAllCheckbox,
|
|
1153
|
+
DataTableSelectRowCheckbox,
|
|
1154
|
+
};
|
|
1155
|
+
export type {
|
|
1156
|
+
DataTableProps,
|
|
1157
|
+
DataTableColumnHeaderProps,
|
|
1158
|
+
DataTableRowActionsProps,
|
|
1159
|
+
DataTableToolbarProps,
|
|
1160
|
+
DataTableToolbarLeftProps,
|
|
1161
|
+
DataTableToolbarRightProps,
|
|
1162
|
+
DataTableSearchProps,
|
|
1163
|
+
DataTablePaginationProps,
|
|
1164
|
+
DataTableSelectAllCheckboxProps,
|
|
1165
|
+
DataTableSelectRowCheckboxProps,
|
|
1166
|
+
};
|