@codella-software/react 2.2.26 → 2.3.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.
@@ -1,93 +0,0 @@
1
- import { TableBuilderConfig } from '@codella-software/utils';
2
- /**
3
- * Hook options for useTableService
4
- */
5
- export interface UseTableServiceOptions<T extends Record<string, any>> {
6
- /** TableBuilder configuration */
7
- config: TableBuilderConfig<T>;
8
- /** Table data */
9
- data: T[];
10
- }
11
- /**
12
- * Hook return value for useTableService
13
- */
14
- export interface UseTableServiceReturn<T extends Record<string, any>> {
15
- /** Filtered and paginated data rows */
16
- rows: T[];
17
- /** Selected row IDs */
18
- selectedRows: string[];
19
- /** All rows selected flag */
20
- allSelected: boolean;
21
- /** Current page */
22
- currentPage: number;
23
- /** Page size */
24
- pageSize: number;
25
- /** Total pages */
26
- totalPages: number;
27
- /** Total item count */
28
- totalItems: number;
29
- /** Has next page */
30
- hasNextPage: boolean;
31
- /** Has previous page */
32
- hasPrevPage: boolean;
33
- /** Sort field */
34
- sortBy: string | null;
35
- /** Sort direction */
36
- sortDirection: 'asc' | 'desc' | null;
37
- /** Active filters */
38
- filters: Record<string, any>;
39
- /** Toggle row selection */
40
- toggleRowSelection: (rowId: string) => void;
41
- /** Toggle all rows selection */
42
- toggleAllSelection: () => void;
43
- /** Clear selection */
44
- clearSelection: () => void;
45
- /** Set sort */
46
- setSort: (field: string, direction: 'asc' | 'desc') => void;
47
- /** Toggle sort */
48
- toggleSort: (field: string) => void;
49
- /** Set filter */
50
- setFilter: (field: string, value: any) => void;
51
- /** Clear filter */
52
- clearFilter: (field: string) => void;
53
- /** Clear all filters */
54
- clearAllFilters: () => void;
55
- /** Set page */
56
- setPage: (page: number) => void;
57
- /** Set page size */
58
- setPageSize: (size: number) => void;
59
- /** Next page */
60
- nextPage: () => void;
61
- /** Previous page */
62
- prevPage: () => void;
63
- }
64
- /**
65
- * React hook that wraps TableBuilder for table state management
66
- *
67
- * @param options - Hook options including config and data
68
- * @returns Table state and control methods
69
- *
70
- * @example
71
- * ```tsx
72
- * const config: TableBuilderConfig<User> = {
73
- * columns: [
74
- * { field: 'name', header: 'Name', sortable: true }
75
- * ]
76
- * };
77
- *
78
- * function MyTable({ data }: { data: User[] }) {
79
- * const table = useTableService({ config, data });
80
- * return (
81
- * <table>
82
- * <tbody>
83
- * {table.rows.map(row => (
84
- * <tr key={row.id}><td>{row.name}</td></tr>
85
- * ))}
86
- * </tbody>
87
- * </table>
88
- * );
89
- * }
90
- * ```
91
- */
92
- export declare function useTableService<T extends Record<string, any>>(options: UseTableServiceOptions<T>): UseTableServiceReturn<T>;
93
- //# sourceMappingURL=useTableService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useTableService.d.ts","sourceRoot":"","sources":["../src/useTableService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAG/E;;GAEG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACnE,iCAAiC;IACjC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAA;IAE7B,iBAAiB;IACjB,IAAI,EAAE,CAAC,EAAE,CAAA;CACV;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAClE,uCAAuC;IACvC,IAAI,EAAE,CAAC,EAAE,CAAA;IACT,uBAAuB;IACvB,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,6BAA6B;IAC7B,WAAW,EAAE,OAAO,CAAA;IACpB,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,oBAAoB;IACpB,WA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