@superdangerous/app-framework 4.9.2 → 4.15.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/README.md +8 -2
- package/dist/api/logsRouter.d.ts +4 -1
- package/dist/api/logsRouter.d.ts.map +1 -1
- package/dist/api/logsRouter.js +100 -118
- package/dist/api/logsRouter.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/middleware/validation.d.ts +48 -43
- package/dist/middleware/validation.d.ts.map +1 -1
- package/dist/middleware/validation.js +48 -43
- package/dist/middleware/validation.js.map +1 -1
- package/dist/services/emailService.d.ts +146 -0
- package/dist/services/emailService.d.ts.map +1 -0
- package/dist/services/emailService.js +649 -0
- package/dist/services/emailService.js.map +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +2 -0
- package/dist/services/index.js.map +1 -1
- package/dist/services/websocketServer.d.ts +7 -4
- package/dist/services/websocketServer.d.ts.map +1 -1
- package/dist/services/websocketServer.js +22 -16
- package/dist/services/websocketServer.js.map +1 -1
- package/dist/types/index.d.ts +7 -8
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +11 -2
- package/src/api/logsRouter.ts +119 -138
- package/src/index.ts +14 -0
- package/src/middleware/validation.ts +82 -90
- package/src/services/emailService.ts +812 -0
- package/src/services/index.ts +14 -0
- package/src/services/websocketServer.ts +37 -23
- package/src/types/index.ts +7 -8
- package/ui/data-table/components/BatchActionsBar.tsx +53 -0
- package/ui/data-table/components/ColumnVisibility.tsx +111 -0
- package/ui/data-table/components/DataTablePage.tsx +238 -0
- package/ui/data-table/components/Pagination.tsx +203 -0
- package/ui/data-table/components/PaginationControls.tsx +122 -0
- package/ui/data-table/components/TableFilters.tsx +139 -0
- package/ui/data-table/components/index.ts +27 -0
- package/ui/data-table/hooks/index.ts +17 -0
- package/ui/data-table/hooks/useColumnOrder.ts +233 -0
- package/ui/data-table/hooks/useColumnVisibility.ts +128 -0
- package/ui/data-table/hooks/usePagination.ts +160 -0
- package/ui/data-table/hooks/useResizableColumns.ts +280 -0
- package/ui/data-table/index.ts +74 -0
- package/ui/dist/index.d.mts +207 -5
- package/ui/dist/index.d.ts +207 -5
- package/ui/dist/index.js +36 -43
- package/ui/dist/index.js.map +1 -1
- package/ui/dist/index.mjs +36 -43
- package/ui/dist/index.mjs.map +1 -1
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChevronLeft,
|
|
3
|
+
ChevronRight,
|
|
4
|
+
ChevronsLeft,
|
|
5
|
+
ChevronsRight,
|
|
6
|
+
} from 'lucide-react';
|
|
7
|
+
import { Button } from '../../components/base/button';
|
|
8
|
+
import {
|
|
9
|
+
Select,
|
|
10
|
+
SelectContent,
|
|
11
|
+
SelectItem,
|
|
12
|
+
SelectTrigger,
|
|
13
|
+
SelectValue,
|
|
14
|
+
} from '../../components/base/select';
|
|
15
|
+
import { cn } from '../../src/utils/cn';
|
|
16
|
+
|
|
17
|
+
interface PaginationProps {
|
|
18
|
+
page: number;
|
|
19
|
+
pageSize: number;
|
|
20
|
+
totalPages: number;
|
|
21
|
+
totalItems: number;
|
|
22
|
+
startIndex: number;
|
|
23
|
+
endIndex: number;
|
|
24
|
+
canGoNext: boolean;
|
|
25
|
+
canGoPrev: boolean;
|
|
26
|
+
pageSizeOptions: number[];
|
|
27
|
+
onPageChange: (page: number) => void;
|
|
28
|
+
onPageSizeChange: (size: number) => void;
|
|
29
|
+
onNextPage: () => void;
|
|
30
|
+
onPrevPage: () => void;
|
|
31
|
+
onFirstPage: () => void;
|
|
32
|
+
onLastPage: () => void;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function Pagination({
|
|
37
|
+
page,
|
|
38
|
+
pageSize,
|
|
39
|
+
totalPages,
|
|
40
|
+
totalItems,
|
|
41
|
+
startIndex,
|
|
42
|
+
endIndex,
|
|
43
|
+
canGoNext,
|
|
44
|
+
canGoPrev,
|
|
45
|
+
pageSizeOptions,
|
|
46
|
+
onPageChange,
|
|
47
|
+
onPageSizeChange,
|
|
48
|
+
onNextPage,
|
|
49
|
+
onPrevPage,
|
|
50
|
+
onFirstPage,
|
|
51
|
+
onLastPage,
|
|
52
|
+
className,
|
|
53
|
+
}: PaginationProps) {
|
|
54
|
+
// Generate page numbers to show
|
|
55
|
+
const getPageNumbers = () => {
|
|
56
|
+
const pages: (number | 'ellipsis')[] = [];
|
|
57
|
+
const showPages = 5; // Max pages to show
|
|
58
|
+
const halfShow = Math.floor(showPages / 2);
|
|
59
|
+
|
|
60
|
+
let startPage = Math.max(1, page - halfShow);
|
|
61
|
+
let endPage = Math.min(totalPages, page + halfShow);
|
|
62
|
+
|
|
63
|
+
// Adjust range if near edges
|
|
64
|
+
if (page <= halfShow) {
|
|
65
|
+
endPage = Math.min(totalPages, showPages);
|
|
66
|
+
}
|
|
67
|
+
if (page > totalPages - halfShow) {
|
|
68
|
+
startPage = Math.max(1, totalPages - showPages + 1);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Add first page and ellipsis if needed
|
|
72
|
+
if (startPage > 1) {
|
|
73
|
+
pages.push(1);
|
|
74
|
+
if (startPage > 2) {
|
|
75
|
+
pages.push('ellipsis');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Add middle pages
|
|
80
|
+
for (let i = startPage; i <= endPage; i++) {
|
|
81
|
+
if (i !== 1 && i !== totalPages) {
|
|
82
|
+
pages.push(i);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Add ellipsis and last page if needed
|
|
87
|
+
if (endPage < totalPages) {
|
|
88
|
+
if (endPage < totalPages - 1) {
|
|
89
|
+
pages.push('ellipsis');
|
|
90
|
+
}
|
|
91
|
+
pages.push(totalPages);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return pages;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
if (totalItems === 0) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<div
|
|
103
|
+
className={cn(
|
|
104
|
+
'flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-3',
|
|
105
|
+
className
|
|
106
|
+
)}
|
|
107
|
+
>
|
|
108
|
+
{/* Items info */}
|
|
109
|
+
<div className="text-sm text-muted-foreground">
|
|
110
|
+
Showing {startIndex} to {endIndex} of {totalItems} items
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
{/* Controls */}
|
|
114
|
+
<div className="flex items-center gap-4">
|
|
115
|
+
{/* Page size selector */}
|
|
116
|
+
<div className="flex items-center gap-2">
|
|
117
|
+
<span className="text-sm text-muted-foreground">Per page:</span>
|
|
118
|
+
<Select
|
|
119
|
+
value={String(pageSize)}
|
|
120
|
+
onValueChange={(v) => onPageSizeChange(Number(v))}
|
|
121
|
+
>
|
|
122
|
+
<SelectTrigger className="w-20 h-8">
|
|
123
|
+
<SelectValue />
|
|
124
|
+
</SelectTrigger>
|
|
125
|
+
<SelectContent>
|
|
126
|
+
{pageSizeOptions.map((size) => (
|
|
127
|
+
<SelectItem key={size} value={String(size)}>
|
|
128
|
+
{size}
|
|
129
|
+
</SelectItem>
|
|
130
|
+
))}
|
|
131
|
+
</SelectContent>
|
|
132
|
+
</Select>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
{/* Page navigation */}
|
|
136
|
+
<div className="flex items-center gap-1">
|
|
137
|
+
<Button
|
|
138
|
+
variant="outline"
|
|
139
|
+
size="icon"
|
|
140
|
+
className="h-8 w-8"
|
|
141
|
+
onClick={onFirstPage}
|
|
142
|
+
disabled={!canGoPrev}
|
|
143
|
+
title="First page"
|
|
144
|
+
>
|
|
145
|
+
<ChevronsLeft className="h-4 w-4" />
|
|
146
|
+
</Button>
|
|
147
|
+
<Button
|
|
148
|
+
variant="outline"
|
|
149
|
+
size="icon"
|
|
150
|
+
className="h-8 w-8"
|
|
151
|
+
onClick={onPrevPage}
|
|
152
|
+
disabled={!canGoPrev}
|
|
153
|
+
title="Previous page"
|
|
154
|
+
>
|
|
155
|
+
<ChevronLeft className="h-4 w-4" />
|
|
156
|
+
</Button>
|
|
157
|
+
|
|
158
|
+
{/* Page numbers */}
|
|
159
|
+
<div className="flex items-center gap-1">
|
|
160
|
+
{getPageNumbers().map((pageNum, idx) =>
|
|
161
|
+
pageNum === 'ellipsis' ? (
|
|
162
|
+
<span key={`ellipsis-${idx}`} className="px-2 text-muted-foreground">
|
|
163
|
+
...
|
|
164
|
+
</span>
|
|
165
|
+
) : (
|
|
166
|
+
<Button
|
|
167
|
+
key={pageNum}
|
|
168
|
+
variant={page === pageNum ? 'default' : 'outline'}
|
|
169
|
+
size="icon"
|
|
170
|
+
className="h-8 w-8"
|
|
171
|
+
onClick={() => onPageChange(pageNum)}
|
|
172
|
+
>
|
|
173
|
+
{pageNum}
|
|
174
|
+
</Button>
|
|
175
|
+
)
|
|
176
|
+
)}
|
|
177
|
+
</div>
|
|
178
|
+
|
|
179
|
+
<Button
|
|
180
|
+
variant="outline"
|
|
181
|
+
size="icon"
|
|
182
|
+
className="h-8 w-8"
|
|
183
|
+
onClick={onNextPage}
|
|
184
|
+
disabled={!canGoNext}
|
|
185
|
+
title="Next page"
|
|
186
|
+
>
|
|
187
|
+
<ChevronRight className="h-4 w-4" />
|
|
188
|
+
</Button>
|
|
189
|
+
<Button
|
|
190
|
+
variant="outline"
|
|
191
|
+
size="icon"
|
|
192
|
+
className="h-8 w-8"
|
|
193
|
+
onClick={onLastPage}
|
|
194
|
+
disabled={!canGoNext}
|
|
195
|
+
title="Last page"
|
|
196
|
+
>
|
|
197
|
+
<ChevronsRight className="h-4 w-4" />
|
|
198
|
+
</Button>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PaginationControls - Compact inline pagination for table headers
|
|
3
|
+
*
|
|
4
|
+
* A condensed version of pagination controls designed to sit alongside
|
|
5
|
+
* search/filter controls in a table header bar.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
ChevronLeft,
|
|
10
|
+
ChevronRight,
|
|
11
|
+
} from 'lucide-react';
|
|
12
|
+
import { Button } from '../../components/base/button';
|
|
13
|
+
import {
|
|
14
|
+
Select,
|
|
15
|
+
SelectContent,
|
|
16
|
+
SelectItem,
|
|
17
|
+
SelectTrigger,
|
|
18
|
+
SelectValue,
|
|
19
|
+
} from '../../components/base/select';
|
|
20
|
+
import { cn } from '../../src/utils/cn';
|
|
21
|
+
|
|
22
|
+
export interface PaginationControlsProps {
|
|
23
|
+
page: number;
|
|
24
|
+
pageSize: number;
|
|
25
|
+
totalPages: number;
|
|
26
|
+
totalItems: number;
|
|
27
|
+
startIndex: number;
|
|
28
|
+
endIndex: number;
|
|
29
|
+
canGoNext: boolean;
|
|
30
|
+
canGoPrev: boolean;
|
|
31
|
+
pageSizeOptions: number[];
|
|
32
|
+
setPage: (page: number) => void;
|
|
33
|
+
setPageSize: (size: number) => void;
|
|
34
|
+
nextPage: () => void;
|
|
35
|
+
prevPage: () => void;
|
|
36
|
+
className?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function PaginationControls({
|
|
40
|
+
page,
|
|
41
|
+
pageSize,
|
|
42
|
+
totalPages,
|
|
43
|
+
totalItems,
|
|
44
|
+
startIndex,
|
|
45
|
+
endIndex,
|
|
46
|
+
canGoNext,
|
|
47
|
+
canGoPrev,
|
|
48
|
+
pageSizeOptions,
|
|
49
|
+
setPage: _setPage,
|
|
50
|
+
setPageSize,
|
|
51
|
+
nextPage,
|
|
52
|
+
prevPage,
|
|
53
|
+
className,
|
|
54
|
+
}: PaginationControlsProps) {
|
|
55
|
+
// Note: setPage is included for API compatibility with usePagination but not used
|
|
56
|
+
// as this component only provides prev/next navigation
|
|
57
|
+
void _setPage;
|
|
58
|
+
if (totalItems === 0) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<div className={cn('flex items-center gap-3 text-sm', className)}>
|
|
64
|
+
{/* Page size selector - hidden on small screens */}
|
|
65
|
+
<div className="hidden md:flex items-center gap-1.5">
|
|
66
|
+
<span className="text-muted-foreground hidden lg:inline">Rows:</span>
|
|
67
|
+
<Select
|
|
68
|
+
value={String(pageSize)}
|
|
69
|
+
onValueChange={(v) => setPageSize(Number(v))}
|
|
70
|
+
>
|
|
71
|
+
<SelectTrigger className="w-16 h-8 text-xs">
|
|
72
|
+
<SelectValue />
|
|
73
|
+
</SelectTrigger>
|
|
74
|
+
<SelectContent>
|
|
75
|
+
{pageSizeOptions.map((size) => (
|
|
76
|
+
<SelectItem key={size} value={String(size)}>
|
|
77
|
+
{size}
|
|
78
|
+
</SelectItem>
|
|
79
|
+
))}
|
|
80
|
+
</SelectContent>
|
|
81
|
+
</Select>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
{/* Page navigation - always visible when there are multiple pages */}
|
|
85
|
+
{totalPages > 1 && (
|
|
86
|
+
<div className="flex items-center gap-1">
|
|
87
|
+
<Button
|
|
88
|
+
variant="outline"
|
|
89
|
+
size="icon"
|
|
90
|
+
className="h-8 w-8"
|
|
91
|
+
onClick={prevPage}
|
|
92
|
+
disabled={!canGoPrev}
|
|
93
|
+
title="Previous page"
|
|
94
|
+
>
|
|
95
|
+
<ChevronLeft className="h-4 w-4" />
|
|
96
|
+
</Button>
|
|
97
|
+
|
|
98
|
+
{/* Page indicator - hidden on very small screens */}
|
|
99
|
+
<span className="hidden sm:inline px-2 text-muted-foreground tabular-nums min-w-[60px] text-center">
|
|
100
|
+
{page} / {totalPages}
|
|
101
|
+
</span>
|
|
102
|
+
|
|
103
|
+
<Button
|
|
104
|
+
variant="outline"
|
|
105
|
+
size="icon"
|
|
106
|
+
className="h-8 w-8"
|
|
107
|
+
onClick={nextPage}
|
|
108
|
+
disabled={!canGoNext}
|
|
109
|
+
title="Next page"
|
|
110
|
+
>
|
|
111
|
+
<ChevronRight className="h-4 w-4" />
|
|
112
|
+
</Button>
|
|
113
|
+
</div>
|
|
114
|
+
)}
|
|
115
|
+
|
|
116
|
+
{/* Items info - hidden on smaller screens */}
|
|
117
|
+
<span className="text-muted-foreground whitespace-nowrap hidden lg:inline">
|
|
118
|
+
Showing {startIndex}–{endIndex} of {totalItems}
|
|
119
|
+
</span>
|
|
120
|
+
</div>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Search, Filter, X } from 'lucide-react';
|
|
3
|
+
import { Input } from '../../components/base/input';
|
|
4
|
+
import { Button } from '../../components/base/button';
|
|
5
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../../components/base/popover';
|
|
6
|
+
import { cn } from '../../src/utils/cn';
|
|
7
|
+
|
|
8
|
+
export interface FilterOption {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
render: () => React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface TableFiltersProps {
|
|
15
|
+
search?: string;
|
|
16
|
+
onSearchChange?: (value: string) => void;
|
|
17
|
+
searchPlaceholder?: string;
|
|
18
|
+
filters?: FilterOption[];
|
|
19
|
+
activeFilterCount?: number;
|
|
20
|
+
onClearFilters?: () => void;
|
|
21
|
+
className?: string;
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* TableFilters - Compact filter controls for data tables
|
|
27
|
+
*
|
|
28
|
+
* Features:
|
|
29
|
+
* - Search input
|
|
30
|
+
* - Popover filter menu with badge showing active count
|
|
31
|
+
* - Clear all filters button
|
|
32
|
+
* - Custom filter components via render prop
|
|
33
|
+
* - Children slot for additional action buttons
|
|
34
|
+
*/
|
|
35
|
+
export function TableFilters({
|
|
36
|
+
search,
|
|
37
|
+
onSearchChange,
|
|
38
|
+
searchPlaceholder = 'Search...',
|
|
39
|
+
filters,
|
|
40
|
+
activeFilterCount = 0,
|
|
41
|
+
onClearFilters,
|
|
42
|
+
className,
|
|
43
|
+
children,
|
|
44
|
+
}: TableFiltersProps) {
|
|
45
|
+
return (
|
|
46
|
+
<div className={cn('flex items-center gap-3 flex-wrap', className)}>
|
|
47
|
+
{/* Search Input */}
|
|
48
|
+
{onSearchChange !== undefined && (
|
|
49
|
+
<div className="relative flex-1 min-w-[200px] max-w-xs">
|
|
50
|
+
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none z-10" />
|
|
51
|
+
<Input
|
|
52
|
+
placeholder={searchPlaceholder}
|
|
53
|
+
value={search || ''}
|
|
54
|
+
onChange={(e) => onSearchChange(e.target.value)}
|
|
55
|
+
className="pl-9 h-9"
|
|
56
|
+
/>
|
|
57
|
+
{search && (
|
|
58
|
+
<button
|
|
59
|
+
type="button"
|
|
60
|
+
onClick={() => onSearchChange('')}
|
|
61
|
+
className="absolute right-2 top-1/2 transform -translate-y-1/2 p-1 rounded-sm hover:bg-muted"
|
|
62
|
+
>
|
|
63
|
+
<X className="h-3 w-3 text-muted-foreground" />
|
|
64
|
+
</button>
|
|
65
|
+
)}
|
|
66
|
+
</div>
|
|
67
|
+
)}
|
|
68
|
+
|
|
69
|
+
{/* Filters Popover */}
|
|
70
|
+
{filters && filters.length > 0 && (
|
|
71
|
+
<Popover>
|
|
72
|
+
<PopoverTrigger asChild>
|
|
73
|
+
<Button variant="outline" size="sm" className="gap-2 h-9">
|
|
74
|
+
<Filter className="h-4 w-4" />
|
|
75
|
+
Filters
|
|
76
|
+
{activeFilterCount > 0 && (
|
|
77
|
+
<span className="ml-1 rounded-full bg-primary text-primary-foreground px-2 py-0.5 text-xs font-medium">
|
|
78
|
+
{activeFilterCount}
|
|
79
|
+
</span>
|
|
80
|
+
)}
|
|
81
|
+
</Button>
|
|
82
|
+
</PopoverTrigger>
|
|
83
|
+
<PopoverContent
|
|
84
|
+
className="w-80 overflow-y-auto"
|
|
85
|
+
align="start"
|
|
86
|
+
collisionPadding={16}
|
|
87
|
+
style={{ maxHeight: 'var(--radix-popover-content-available-height)' }}
|
|
88
|
+
>
|
|
89
|
+
<div className="space-y-4">
|
|
90
|
+
<div className="flex items-center justify-between">
|
|
91
|
+
<h4 className="font-medium text-sm">Filters</h4>
|
|
92
|
+
{activeFilterCount > 0 && onClearFilters && (
|
|
93
|
+
<Button
|
|
94
|
+
variant="ghost"
|
|
95
|
+
size="sm"
|
|
96
|
+
onClick={onClearFilters}
|
|
97
|
+
className="h-auto p-0 text-xs text-destructive hover:text-destructive"
|
|
98
|
+
>
|
|
99
|
+
Clear all
|
|
100
|
+
</Button>
|
|
101
|
+
)}
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<div className="space-y-3">
|
|
105
|
+
{filters.map((filter) => (
|
|
106
|
+
<div key={filter.id} className="space-y-1.5">
|
|
107
|
+
<label className="text-xs font-medium text-muted-foreground">
|
|
108
|
+
{filter.label}
|
|
109
|
+
</label>
|
|
110
|
+
{filter.render()}
|
|
111
|
+
</div>
|
|
112
|
+
))}
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</PopoverContent>
|
|
116
|
+
</Popover>
|
|
117
|
+
)}
|
|
118
|
+
|
|
119
|
+
{/* Clear filters button (visible when filters are active, outside popover) */}
|
|
120
|
+
{activeFilterCount > 0 && onClearFilters && (
|
|
121
|
+
<Button
|
|
122
|
+
variant="ghost"
|
|
123
|
+
size="sm"
|
|
124
|
+
onClick={onClearFilters}
|
|
125
|
+
className="h-9 gap-1.5 text-muted-foreground hover:text-foreground"
|
|
126
|
+
>
|
|
127
|
+
<X className="h-4 w-4" />
|
|
128
|
+
Clear
|
|
129
|
+
</Button>
|
|
130
|
+
)}
|
|
131
|
+
|
|
132
|
+
{/* Spacer to push children to the right */}
|
|
133
|
+
<div className="flex-1" />
|
|
134
|
+
|
|
135
|
+
{/* Custom children (e.g., export button, create button, etc.) */}
|
|
136
|
+
{children}
|
|
137
|
+
</div>
|
|
138
|
+
);
|
|
139
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data Table Components
|
|
3
|
+
*
|
|
4
|
+
* Reusable components for building data tables:
|
|
5
|
+
* - DataTablePage: Full-page layout with header controls
|
|
6
|
+
* - PaginationControls: Compact inline pagination
|
|
7
|
+
* - Pagination: Full pagination with page numbers
|
|
8
|
+
* - BatchActionsBar: Multi-select action bar
|
|
9
|
+
* - ColumnVisibility: Column toggle dropdown
|
|
10
|
+
* - TableFilters: Search and filter controls
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export { DataTablePage } from './DataTablePage';
|
|
14
|
+
export type { DataTablePageProps, FilterOption } from './DataTablePage';
|
|
15
|
+
|
|
16
|
+
export { PaginationControls } from './PaginationControls';
|
|
17
|
+
export type { PaginationControlsProps } from './PaginationControls';
|
|
18
|
+
|
|
19
|
+
export { Pagination } from './Pagination';
|
|
20
|
+
|
|
21
|
+
export { BatchActionsBar } from './BatchActionsBar';
|
|
22
|
+
export type { BatchActionsBarProps } from './BatchActionsBar';
|
|
23
|
+
|
|
24
|
+
export { ColumnVisibility } from './ColumnVisibility';
|
|
25
|
+
|
|
26
|
+
export { TableFilters } from './TableFilters';
|
|
27
|
+
export type { TableFiltersProps, FilterOption as TableFilterOption } from './TableFilters';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data Table Hooks
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive hooks for building data tables with:
|
|
5
|
+
* - Pagination with localStorage persistence
|
|
6
|
+
* - Column visibility toggling
|
|
7
|
+
* - Column resizing with drag handles
|
|
8
|
+
* - Column reordering with drag-and-drop
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export { usePagination } from './usePagination';
|
|
12
|
+
export { useColumnVisibility } from './useColumnVisibility';
|
|
13
|
+
export type { ColumnConfig, ColumnVisibilityState } from './useColumnVisibility';
|
|
14
|
+
export { useResizableColumns } from './useResizableColumns';
|
|
15
|
+
export type { ResizableColumnResult } from './useResizableColumns';
|
|
16
|
+
export { useColumnOrder, useColumnDragDrop } from './useColumnOrder';
|
|
17
|
+
export type { ColumnOrderConfig, DragState } from './useColumnOrder';
|