@superdangerous/app-framework 4.16.35 → 4.16.37
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/package.json +4 -4
- package/ui/dist/data-table.d.mts +457 -0
- package/ui/dist/data-table.d.ts +457 -0
- package/ui/dist/data-table.js +2 -0
- package/ui/dist/data-table.js.map +1 -0
- package/ui/dist/data-table.mjs +2 -0
- package/ui/dist/data-table.mjs.map +1 -0
- package/ui/dist/index.d.mts +17 -454
- package/ui/dist/index.d.ts +17 -454
- package/ui/dist/index.js +34 -34
- package/ui/dist/index.js.map +1 -1
- package/ui/dist/index.mjs +34 -34
- package/ui/dist/index.mjs.map +1 -1
- package/ui/data-table/components/BatchActionsBar.tsx +0 -53
- package/ui/data-table/components/ColumnVisibility.tsx +0 -111
- package/ui/data-table/components/DataTable.tsx +0 -498
- package/ui/data-table/components/DataTablePage.tsx +0 -244
- package/ui/data-table/components/MultiSelectFilter.tsx +0 -153
- package/ui/data-table/components/Pagination.tsx +0 -203
- package/ui/data-table/components/PaginationControls.tsx +0 -122
- package/ui/data-table/components/TableFilters.tsx +0 -145
- package/ui/data-table/components/index.ts +0 -44
- package/ui/data-table/components/types.ts +0 -181
- package/ui/data-table/hooks/index.ts +0 -17
- package/ui/data-table/hooks/useColumnOrder.ts +0 -237
- package/ui/data-table/hooks/useColumnVisibility.ts +0 -128
- package/ui/data-table/hooks/usePagination.ts +0 -160
- package/ui/data-table/hooks/useResizableColumns.ts +0 -282
- package/ui/data-table/index.ts +0 -87
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdangerous/app-framework",
|
|
3
|
-
"version": "4.16.
|
|
3
|
+
"version": "4.16.37",
|
|
4
4
|
"description": "Opinionated TypeScript framework for structured vibecoding - building internal web and desktop apps with batteries included",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -41,8 +41,9 @@
|
|
|
41
41
|
"require": "./ui/dist/index.js"
|
|
42
42
|
},
|
|
43
43
|
"./data-table": {
|
|
44
|
-
"types": "./ui/data-table
|
|
45
|
-
"import": "./ui/data-table
|
|
44
|
+
"types": "./ui/dist/data-table.d.ts",
|
|
45
|
+
"import": "./ui/dist/data-table.mjs",
|
|
46
|
+
"require": "./ui/dist/data-table.js"
|
|
46
47
|
},
|
|
47
48
|
"./ui/utils": {
|
|
48
49
|
"types": "./dist/ui/utils/index.d.ts",
|
|
@@ -153,7 +154,6 @@
|
|
|
153
154
|
"dist/",
|
|
154
155
|
"src/",
|
|
155
156
|
"ui/dist/",
|
|
156
|
-
"ui/data-table/",
|
|
157
157
|
"ui/styles/",
|
|
158
158
|
"README.md",
|
|
159
159
|
"LICENSE"
|
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface UsePaginationOptions<T> {
|
|
5
|
+
data: T[];
|
|
6
|
+
pageSize?: number;
|
|
7
|
+
storageKey?: string;
|
|
8
|
+
}
|
|
9
|
+
interface UsePaginationResult<T> {
|
|
10
|
+
paginatedData: T[];
|
|
11
|
+
page: number;
|
|
12
|
+
pageSize: number;
|
|
13
|
+
totalPages: number;
|
|
14
|
+
totalItems: number;
|
|
15
|
+
setPage: (page: number) => void;
|
|
16
|
+
setPageSize: (size: number) => void;
|
|
17
|
+
nextPage: () => void;
|
|
18
|
+
prevPage: () => void;
|
|
19
|
+
firstPage: () => void;
|
|
20
|
+
lastPage: () => void;
|
|
21
|
+
startIndex: number;
|
|
22
|
+
endIndex: number;
|
|
23
|
+
canGoNext: boolean;
|
|
24
|
+
canGoPrev: boolean;
|
|
25
|
+
pageSizeOptions: number[];
|
|
26
|
+
}
|
|
27
|
+
declare function usePagination<T>({ data, pageSize: initialPageSize, storageKey, }: UsePaginationOptions<T>): UsePaginationResult<T>;
|
|
28
|
+
|
|
29
|
+
interface ColumnConfig$1 {
|
|
30
|
+
id: string;
|
|
31
|
+
label: string;
|
|
32
|
+
defaultVisible?: boolean;
|
|
33
|
+
locked?: boolean;
|
|
34
|
+
}
|
|
35
|
+
interface ColumnVisibilityState {
|
|
36
|
+
[key: string]: boolean;
|
|
37
|
+
}
|
|
38
|
+
interface UseColumnVisibilityOptions {
|
|
39
|
+
columns: ColumnConfig$1[];
|
|
40
|
+
storageKey: string;
|
|
41
|
+
}
|
|
42
|
+
interface UseColumnVisibilityReturn {
|
|
43
|
+
visibleColumns: ColumnVisibilityState;
|
|
44
|
+
isColumnVisible: (columnId: string) => boolean;
|
|
45
|
+
toggleColumn: (columnId: string) => void;
|
|
46
|
+
showAllColumns: () => void;
|
|
47
|
+
hideAllColumns: () => void;
|
|
48
|
+
columns: ColumnConfig$1[];
|
|
49
|
+
}
|
|
50
|
+
declare function useColumnVisibility({ columns, storageKey, }: UseColumnVisibilityOptions): UseColumnVisibilityReturn;
|
|
51
|
+
|
|
52
|
+
interface ColumnConfig {
|
|
53
|
+
key: string;
|
|
54
|
+
minWidth?: number;
|
|
55
|
+
maxWidth?: number;
|
|
56
|
+
defaultWidth?: number;
|
|
57
|
+
}
|
|
58
|
+
interface UseResizableColumnsOptions {
|
|
59
|
+
tableId: string;
|
|
60
|
+
columns: ColumnConfig[];
|
|
61
|
+
storageKey?: string;
|
|
62
|
+
}
|
|
63
|
+
interface ResizableColumnResult {
|
|
64
|
+
widths: Record<string, number>;
|
|
65
|
+
isResizing: boolean;
|
|
66
|
+
totalWidth: number;
|
|
67
|
+
getResizeHandleProps: (columnKey: string) => {
|
|
68
|
+
onPointerDown: (e: React.PointerEvent) => void;
|
|
69
|
+
onMouseDown: (e: React.MouseEvent) => void;
|
|
70
|
+
draggable: boolean;
|
|
71
|
+
onDragStart: (e: React.DragEvent) => void;
|
|
72
|
+
className: string;
|
|
73
|
+
'data-resizing': boolean;
|
|
74
|
+
};
|
|
75
|
+
getColumnStyle: (columnKey: string) => React.CSSProperties;
|
|
76
|
+
getTableStyle: () => React.CSSProperties;
|
|
77
|
+
resetToDefaults: () => void;
|
|
78
|
+
}
|
|
79
|
+
declare function useResizableColumns({ tableId, columns, storageKey, }: UseResizableColumnsOptions): ResizableColumnResult;
|
|
80
|
+
|
|
81
|
+
interface ColumnOrderConfig {
|
|
82
|
+
id: string;
|
|
83
|
+
label: string;
|
|
84
|
+
locked?: boolean;
|
|
85
|
+
}
|
|
86
|
+
interface UseColumnOrderOptions {
|
|
87
|
+
storageKey: string;
|
|
88
|
+
defaultOrder: string[];
|
|
89
|
+
}
|
|
90
|
+
interface UseColumnOrderReturn {
|
|
91
|
+
columnOrder: string[];
|
|
92
|
+
moveColumn: (fromIndex: number, toIndex: number) => void;
|
|
93
|
+
moveColumnById: (columnId: string, direction: 'left' | 'right') => void;
|
|
94
|
+
resetOrder: () => void;
|
|
95
|
+
getOrderedColumns: <T extends {
|
|
96
|
+
id: string;
|
|
97
|
+
}>(columns: T[]) => T[];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Hook for managing column order with localStorage persistence
|
|
101
|
+
*/
|
|
102
|
+
declare function useColumnOrder({ storageKey, defaultOrder, }: UseColumnOrderOptions): UseColumnOrderReturn;
|
|
103
|
+
/**
|
|
104
|
+
* Drag and drop helpers for column reordering
|
|
105
|
+
*/
|
|
106
|
+
interface DragState {
|
|
107
|
+
isDragging: boolean;
|
|
108
|
+
draggedId: string | null;
|
|
109
|
+
dropIndex: number | null;
|
|
110
|
+
}
|
|
111
|
+
declare function useColumnDragDrop(columnOrder: string[], moveColumn: (from: number, to: number) => void, lockedColumns?: string[]): {
|
|
112
|
+
dragState: DragState;
|
|
113
|
+
getDragHandleProps: (columnId: string) => {
|
|
114
|
+
draggable: boolean;
|
|
115
|
+
onDragStart: (e: React.DragEvent) => void;
|
|
116
|
+
onDragOver: (e: React.DragEvent) => void;
|
|
117
|
+
onDrop: (e: React.DragEvent) => void;
|
|
118
|
+
onDragEnd: () => void;
|
|
119
|
+
};
|
|
120
|
+
showDropIndicator: (columnId: string) => boolean;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Column width configuration
|
|
125
|
+
*/
|
|
126
|
+
interface ColumnWidth {
|
|
127
|
+
default: number;
|
|
128
|
+
min: number;
|
|
129
|
+
max?: number;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Column visibility configuration
|
|
133
|
+
*/
|
|
134
|
+
interface ColumnVisibility$1 {
|
|
135
|
+
default: boolean;
|
|
136
|
+
locked?: boolean;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Props passed to header cell render function
|
|
140
|
+
*/
|
|
141
|
+
interface HeaderCellProps {
|
|
142
|
+
columnId: string;
|
|
143
|
+
isSorted: boolean;
|
|
144
|
+
sortDirection?: 'asc' | 'desc';
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Props passed to cell render function
|
|
148
|
+
*/
|
|
149
|
+
interface CellProps {
|
|
150
|
+
columnId: string;
|
|
151
|
+
isDragging: boolean;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Column definition for DataTable
|
|
155
|
+
*/
|
|
156
|
+
interface ColumnDef<T> {
|
|
157
|
+
/** Unique column identifier */
|
|
158
|
+
id: string;
|
|
159
|
+
/** Header content - string or render function */
|
|
160
|
+
header: string | ((props: HeaderCellProps) => ReactNode);
|
|
161
|
+
/** Cell content render function */
|
|
162
|
+
cell: (item: T, props: CellProps) => ReactNode;
|
|
163
|
+
/** Key to use for sorting (if sortable) */
|
|
164
|
+
sortKey?: string;
|
|
165
|
+
/** Width configuration */
|
|
166
|
+
width?: ColumnWidth;
|
|
167
|
+
/** Visibility configuration */
|
|
168
|
+
visibility?: ColumnVisibility$1;
|
|
169
|
+
/** Additional CSS class for cells */
|
|
170
|
+
className?: string;
|
|
171
|
+
/** Whether this column should use column style from resize hook */
|
|
172
|
+
resizable?: boolean;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* External pagination state (from usePagination hook)
|
|
176
|
+
*/
|
|
177
|
+
interface ExternalPaginationState<T> {
|
|
178
|
+
paginatedData: T[];
|
|
179
|
+
page: number;
|
|
180
|
+
pageSize: number;
|
|
181
|
+
totalPages: number;
|
|
182
|
+
totalItems: number;
|
|
183
|
+
startIndex: number;
|
|
184
|
+
endIndex: number;
|
|
185
|
+
canGoNext: boolean;
|
|
186
|
+
canGoPrev: boolean;
|
|
187
|
+
pageSizeOptions: number[];
|
|
188
|
+
setPage: (page: number) => void;
|
|
189
|
+
setPageSize: (size: number) => void;
|
|
190
|
+
nextPage: () => void;
|
|
191
|
+
prevPage: () => void;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* DataTable props
|
|
195
|
+
*/
|
|
196
|
+
interface DataTableProps<T> {
|
|
197
|
+
/** Data array to display */
|
|
198
|
+
data: T[];
|
|
199
|
+
/** Column definitions */
|
|
200
|
+
columns: ColumnDef<T>[];
|
|
201
|
+
/** Storage key for persisting table state (column widths, order, visibility) */
|
|
202
|
+
storageKey: string;
|
|
203
|
+
/** Function to get unique ID from item */
|
|
204
|
+
getRowId: (item: T) => string;
|
|
205
|
+
/** Enable row selection with checkboxes */
|
|
206
|
+
selectable?: boolean;
|
|
207
|
+
/** Set of selected row IDs */
|
|
208
|
+
selectedIds?: Set<string>;
|
|
209
|
+
/** Callback when selection changes */
|
|
210
|
+
onSelectionChange?: (ids: Set<string>) => void;
|
|
211
|
+
/** Callback when row is clicked */
|
|
212
|
+
onRowClick?: (item: T) => void;
|
|
213
|
+
/** Callback when row is right-clicked (for context menu) */
|
|
214
|
+
onRowContextMenu?: (item: T, position: {
|
|
215
|
+
x: number;
|
|
216
|
+
y: number;
|
|
217
|
+
}) => void;
|
|
218
|
+
/** Current sort field */
|
|
219
|
+
sortField?: string;
|
|
220
|
+
/** Current sort order */
|
|
221
|
+
sortOrder?: 'asc' | 'desc';
|
|
222
|
+
/** Callback when sort changes */
|
|
223
|
+
onSort?: (field: string) => void;
|
|
224
|
+
/** Render function for actions column (always last, sticky) */
|
|
225
|
+
actionsColumn?: (item: T) => ReactNode;
|
|
226
|
+
/** Width for actions column */
|
|
227
|
+
actionsColumnWidth?: number;
|
|
228
|
+
/** Page size for pagination (used when no external pagination provided) */
|
|
229
|
+
pageSize?: number;
|
|
230
|
+
/** External pagination state from usePagination hook (overrides internal pagination) */
|
|
231
|
+
pagination?: ExternalPaginationState<T>;
|
|
232
|
+
/** Hide the built-in pagination controls (use when pagination is shown elsewhere) */
|
|
233
|
+
hidePagination?: boolean;
|
|
234
|
+
/** Additional CSS class for table container */
|
|
235
|
+
className?: string;
|
|
236
|
+
/** Function to compute row CSS class */
|
|
237
|
+
rowClassName?: (item: T) => string;
|
|
238
|
+
/** Enable header right-click for column visibility menu */
|
|
239
|
+
enableHeaderContextMenu?: boolean;
|
|
240
|
+
/** Columns that cannot be reordered */
|
|
241
|
+
lockedColumns?: string[];
|
|
242
|
+
/** Default column order (if not persisted) */
|
|
243
|
+
defaultColumnOrder?: string[];
|
|
244
|
+
/** Show loading indicator */
|
|
245
|
+
loading?: boolean;
|
|
246
|
+
/** Content to show when no data */
|
|
247
|
+
emptyState?: ReactNode;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Column config for visibility hook (for compatibility)
|
|
251
|
+
*/
|
|
252
|
+
interface ColumnConfigCompat {
|
|
253
|
+
id: string;
|
|
254
|
+
label: string;
|
|
255
|
+
defaultVisible?: boolean;
|
|
256
|
+
locked?: boolean;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Column config for resize hook (for compatibility)
|
|
260
|
+
*/
|
|
261
|
+
interface ColumnSizeConfig {
|
|
262
|
+
key: string;
|
|
263
|
+
defaultWidth: number;
|
|
264
|
+
minWidth: number;
|
|
265
|
+
maxWidth?: number;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* DataTable - Generic data table with full feature set
|
|
270
|
+
*
|
|
271
|
+
* Features:
|
|
272
|
+
* - Column resizing (drag handles)
|
|
273
|
+
* - Column reordering (drag-drop)
|
|
274
|
+
* - Column visibility toggle
|
|
275
|
+
* - Row selection with checkboxes
|
|
276
|
+
* - Sorting
|
|
277
|
+
* - Pagination
|
|
278
|
+
* - Sticky actions column
|
|
279
|
+
* - Context menu support
|
|
280
|
+
* - Header context menu for column visibility
|
|
281
|
+
*/
|
|
282
|
+
declare function DataTable<T>({ data, columns, storageKey, getRowId, selectable, selectedIds, onSelectionChange, onRowClick, onRowContextMenu, sortField, sortOrder, onSort, actionsColumn, actionsColumnWidth, pageSize, pagination: externalPagination, hidePagination, className, rowClassName, enableHeaderContextMenu, lockedColumns, defaultColumnOrder, loading, emptyState, }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* PaginationControls - Compact inline pagination for table headers
|
|
286
|
+
*
|
|
287
|
+
* A condensed version of pagination controls designed to sit alongside
|
|
288
|
+
* search/filter controls in a table header bar.
|
|
289
|
+
*/
|
|
290
|
+
interface PaginationControlsProps {
|
|
291
|
+
page: number;
|
|
292
|
+
pageSize: number;
|
|
293
|
+
totalPages: number;
|
|
294
|
+
totalItems: number;
|
|
295
|
+
startIndex: number;
|
|
296
|
+
endIndex: number;
|
|
297
|
+
canGoNext: boolean;
|
|
298
|
+
canGoPrev: boolean;
|
|
299
|
+
pageSizeOptions: number[];
|
|
300
|
+
setPage: (page: number) => void;
|
|
301
|
+
setPageSize: (size: number) => void;
|
|
302
|
+
nextPage: () => void;
|
|
303
|
+
prevPage: () => void;
|
|
304
|
+
className?: string;
|
|
305
|
+
}
|
|
306
|
+
declare function PaginationControls({ page, pageSize, totalPages, totalItems, startIndex, endIndex, canGoNext, canGoPrev, pageSizeOptions, setPage: _setPage, setPageSize, nextPage, prevPage, className, }: PaginationControlsProps): react_jsx_runtime.JSX.Element | null;
|
|
307
|
+
|
|
308
|
+
interface FilterOption$1 {
|
|
309
|
+
id: string;
|
|
310
|
+
label: string;
|
|
311
|
+
render: () => React__default.ReactNode;
|
|
312
|
+
}
|
|
313
|
+
interface DataTablePageProps {
|
|
314
|
+
/** Page title */
|
|
315
|
+
title: string;
|
|
316
|
+
/** Page description */
|
|
317
|
+
description?: string;
|
|
318
|
+
/** Search term */
|
|
319
|
+
search?: string;
|
|
320
|
+
/** Search change handler */
|
|
321
|
+
onSearchChange?: (value: string) => void;
|
|
322
|
+
/** Search placeholder text */
|
|
323
|
+
searchPlaceholder?: string;
|
|
324
|
+
/** Filter options for popover */
|
|
325
|
+
filters?: FilterOption$1[];
|
|
326
|
+
/** Number of active filters */
|
|
327
|
+
activeFilterCount?: number;
|
|
328
|
+
/** Clear all filters handler */
|
|
329
|
+
onClearFilters?: () => void;
|
|
330
|
+
/** Pagination props from usePagination hook */
|
|
331
|
+
pagination?: PaginationControlsProps;
|
|
332
|
+
/** Extra content to render next to the title (e.g. HelpTooltip) */
|
|
333
|
+
titleExtra?: React__default.ReactNode;
|
|
334
|
+
/** Action buttons to show in the header */
|
|
335
|
+
actions?: React__default.ReactNode;
|
|
336
|
+
/** Content before the table (e.g., BatchActionsBar) */
|
|
337
|
+
beforeTable?: React__default.ReactNode;
|
|
338
|
+
/** The DataTable component */
|
|
339
|
+
children: React__default.ReactNode;
|
|
340
|
+
/** Additional class for the container */
|
|
341
|
+
className?: string;
|
|
342
|
+
/** Whether to show a loading state */
|
|
343
|
+
loading?: boolean;
|
|
344
|
+
/** Loading component to show */
|
|
345
|
+
loadingComponent?: React__default.ReactNode;
|
|
346
|
+
}
|
|
347
|
+
declare function DataTablePage({ title, description, titleExtra, search, onSearchChange, searchPlaceholder, filters, activeFilterCount, onClearFilters, pagination, actions, beforeTable, children, className, loading, loadingComponent, }: DataTablePageProps): react_jsx_runtime.JSX.Element;
|
|
348
|
+
|
|
349
|
+
interface PaginationProps {
|
|
350
|
+
page: number;
|
|
351
|
+
pageSize: number;
|
|
352
|
+
totalPages: number;
|
|
353
|
+
totalItems: number;
|
|
354
|
+
startIndex: number;
|
|
355
|
+
endIndex: number;
|
|
356
|
+
canGoNext: boolean;
|
|
357
|
+
canGoPrev: boolean;
|
|
358
|
+
pageSizeOptions: number[];
|
|
359
|
+
onPageChange: (page: number) => void;
|
|
360
|
+
onPageSizeChange: (size: number) => void;
|
|
361
|
+
onNextPage: () => void;
|
|
362
|
+
onPrevPage: () => void;
|
|
363
|
+
onFirstPage: () => void;
|
|
364
|
+
onLastPage: () => void;
|
|
365
|
+
className?: string;
|
|
366
|
+
}
|
|
367
|
+
declare function Pagination({ page, pageSize, totalPages, totalItems, startIndex, endIndex, canGoNext, canGoPrev, pageSizeOptions, onPageChange, onPageSizeChange, onNextPage, onPrevPage, onFirstPage, onLastPage, className, }: PaginationProps): react_jsx_runtime.JSX.Element | null;
|
|
368
|
+
|
|
369
|
+
interface BatchActionsBarProps {
|
|
370
|
+
/** Number of selected items */
|
|
371
|
+
selectedCount: number;
|
|
372
|
+
/** Callback to clear selection */
|
|
373
|
+
onClear: () => void;
|
|
374
|
+
/** Action buttons to display on the right side */
|
|
375
|
+
children: ReactNode;
|
|
376
|
+
/** Label for the selected items (default: "item"/"items") */
|
|
377
|
+
itemLabel?: string;
|
|
378
|
+
/** Additional CSS classes */
|
|
379
|
+
className?: string;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* A horizontal bar that appears when items are selected,
|
|
383
|
+
* showing the count and providing batch action buttons.
|
|
384
|
+
*/
|
|
385
|
+
declare function BatchActionsBar({ selectedCount, onClear, children, itemLabel, className, }: BatchActionsBarProps): react_jsx_runtime.JSX.Element | null;
|
|
386
|
+
|
|
387
|
+
interface ColumnVisibilityProps {
|
|
388
|
+
columns: ColumnConfig$1[];
|
|
389
|
+
isColumnVisible: (columnId: string) => boolean;
|
|
390
|
+
toggleColumn: (columnId: string) => void;
|
|
391
|
+
showAllColumns: () => void;
|
|
392
|
+
hideAllColumns: () => void;
|
|
393
|
+
}
|
|
394
|
+
declare function ColumnVisibility({ columns, isColumnVisible, toggleColumn, showAllColumns, hideAllColumns, }: ColumnVisibilityProps): react_jsx_runtime.JSX.Element;
|
|
395
|
+
|
|
396
|
+
interface FilterOption {
|
|
397
|
+
id: string;
|
|
398
|
+
label: string;
|
|
399
|
+
render: () => React__default.ReactNode;
|
|
400
|
+
/** Filter type - 'multi' filters get more horizontal space */
|
|
401
|
+
type?: 'single' | 'multi';
|
|
402
|
+
}
|
|
403
|
+
interface TableFiltersProps {
|
|
404
|
+
search?: string;
|
|
405
|
+
onSearchChange?: (value: string) => void;
|
|
406
|
+
searchPlaceholder?: string;
|
|
407
|
+
filters?: FilterOption[];
|
|
408
|
+
activeFilterCount?: number;
|
|
409
|
+
onClearFilters?: () => void;
|
|
410
|
+
className?: string;
|
|
411
|
+
children?: React__default.ReactNode;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* TableFilters - Compact filter controls for data tables
|
|
415
|
+
*
|
|
416
|
+
* Features:
|
|
417
|
+
* - Search input
|
|
418
|
+
* - Popover filter menu with badge showing active count
|
|
419
|
+
* - Clear all filters button
|
|
420
|
+
* - Custom filter components via render prop
|
|
421
|
+
* - Children slot for additional action buttons
|
|
422
|
+
*/
|
|
423
|
+
declare function TableFilters({ search, onSearchChange, searchPlaceholder, filters, activeFilterCount, onClearFilters, className, children, }: TableFiltersProps): react_jsx_runtime.JSX.Element;
|
|
424
|
+
|
|
425
|
+
interface MultiSelectOption<T extends string = string> {
|
|
426
|
+
/** Unique value for this option */
|
|
427
|
+
value: T;
|
|
428
|
+
/** Display label */
|
|
429
|
+
label: string;
|
|
430
|
+
/** Optional custom render for the label (e.g., with icon/flag) */
|
|
431
|
+
render?: () => React__default.ReactNode;
|
|
432
|
+
}
|
|
433
|
+
interface MultiSelectFilterProps<T extends string = string> {
|
|
434
|
+
/** Available options to select from */
|
|
435
|
+
options: MultiSelectOption<T>[];
|
|
436
|
+
/** Currently selected values */
|
|
437
|
+
selected: Set<T>;
|
|
438
|
+
/** Called when selection changes */
|
|
439
|
+
onChange: (selected: Set<T>) => void;
|
|
440
|
+
/** Maximum height before scrolling (default: 200px) */
|
|
441
|
+
maxHeight?: number;
|
|
442
|
+
/** Number of columns for grid layout (default: 2) */
|
|
443
|
+
columns?: 1 | 2 | 3;
|
|
444
|
+
/** Show select all / clear buttons */
|
|
445
|
+
showBulkActions?: boolean;
|
|
446
|
+
/** Optional className for the container */
|
|
447
|
+
className?: string;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* MultiSelectFilter - A checkbox-based multi-select filter component
|
|
451
|
+
*
|
|
452
|
+
* Designed to work with the TableFilters popover for filtering data tables.
|
|
453
|
+
* Supports custom rendering per option (for flags, badges, icons, etc.)
|
|
454
|
+
*/
|
|
455
|
+
declare function MultiSelectFilter<T extends string = string>({ options, selected, onChange, maxHeight, columns, showBulkActions, className, }: MultiSelectFilterProps<T>): react_jsx_runtime.JSX.Element;
|
|
456
|
+
|
|
457
|
+
export { BatchActionsBar, type BatchActionsBarProps, type CellProps, type ColumnConfig$1 as ColumnConfig, type ColumnConfigCompat, type ColumnDef, type ColumnOrderConfig, type ColumnSizeConfig, ColumnVisibility, type ColumnVisibility$1 as ColumnVisibilityConfig, type ColumnVisibilityState, type ColumnWidth, DataTable, DataTablePage, type DataTablePageProps, type DataTableProps, type DragState, type ExternalPaginationState, type FilterOption$1 as FilterOption, type HeaderCellProps, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectOption, Pagination, PaginationControls, type PaginationControlsProps, type ResizableColumnResult, type FilterOption as TableFilterOption, TableFilters, type TableFiltersProps, useColumnDragDrop, useColumnOrder, useColumnVisibility, usePagination, useResizableColumns };
|