analytica-frontend-lib 1.2.19 → 1.2.22
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/dist/AlertManager/index.css +10 -3
- package/dist/AlertManager/index.css.map +1 -1
- package/dist/AlertManager/index.d.mts +2 -1
- package/dist/AlertManager/index.d.ts +2 -1
- package/dist/AlertManagerView/index.d.mts +2 -1
- package/dist/AlertManagerView/index.d.ts +2 -1
- package/dist/AlertManagerView/index.js +347 -159
- package/dist/AlertManagerView/index.js.map +1 -1
- package/dist/AlertManagerView/index.mjs +346 -159
- package/dist/AlertManagerView/index.mjs.map +1 -1
- package/dist/CheckBoxGroup-9n5C0OH4.d.mts +24 -0
- package/dist/CheckBoxGroup-9n5C0OH4.d.ts +24 -0
- package/dist/Table/index.d.mts +23 -24
- package/dist/Table/index.d.ts +23 -24
- package/dist/Table/index.js +328 -140
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/index.mjs +323 -136
- package/dist/Table/index.mjs.map +1 -1
- package/dist/TableProvider/index.css +19140 -0
- package/dist/TableProvider/index.css.map +1 -0
- package/dist/TableProvider/index.d.mts +4 -0
- package/dist/TableProvider/index.d.ts +4 -0
- package/dist/TableProvider/index.js +5562 -0
- package/dist/TableProvider/index.js.map +1 -0
- package/dist/TableProvider/index.mjs +5583 -0
- package/dist/TableProvider/index.mjs.map +1 -0
- package/dist/TableProvider-48a6wb7j.d.ts +231 -0
- package/dist/TableProvider-DyhwEkPT.d.mts +231 -0
- package/dist/index.css +10 -3
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +5 -42
- package/dist/index.d.ts +5 -42
- package/dist/index.js +1711 -1377
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1604 -1272
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +10 -3
- package/dist/styles.css.map +1 -1
- package/dist/{types-BXzeefgf.d.mts → types-DqZRjqxh.d.ts} +2 -23
- package/dist/{types-BXzeefgf.d.ts → types-pd3QVhSu.d.mts} +2 -23
- package/package.json +2 -1
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { C as CategoryConfig } from './CheckBoxGroup-9n5C0OH4.js';
|
|
4
|
+
|
|
5
|
+
type FilterConfig = {
|
|
6
|
+
key: string;
|
|
7
|
+
label: string;
|
|
8
|
+
categories: CategoryConfig[];
|
|
9
|
+
};
|
|
10
|
+
type UseTableFilterOptions = {
|
|
11
|
+
syncWithUrl?: boolean;
|
|
12
|
+
};
|
|
13
|
+
type UseTableFilterReturn = {
|
|
14
|
+
filterConfigs: FilterConfig[];
|
|
15
|
+
activeFilters: Record<string, string[]>;
|
|
16
|
+
hasActiveFilters: boolean;
|
|
17
|
+
updateFilters: (configs: FilterConfig[]) => void;
|
|
18
|
+
applyFilters: () => void;
|
|
19
|
+
clearFilters: () => void;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Hook for managing table filters with URL synchronization
|
|
23
|
+
*
|
|
24
|
+
* @param initialConfigs - Initial filter configurations
|
|
25
|
+
* @param options - Hook options including URL sync
|
|
26
|
+
* @returns Filter state and management functions
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* const { filterConfigs, activeFilters, updateFilters, applyFilters } = useTableFilter(
|
|
31
|
+
* [
|
|
32
|
+
* {
|
|
33
|
+
* key: 'academic',
|
|
34
|
+
* label: 'Dados Acadêmicos',
|
|
35
|
+
* categories: [...]
|
|
36
|
+
* }
|
|
37
|
+
* ],
|
|
38
|
+
* { syncWithUrl: true }
|
|
39
|
+
* );
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare const useTableFilter: (initialConfigs: FilterConfig[], options?: UseTableFilterOptions) => UseTableFilterReturn;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Column configuration with flexible rendering options
|
|
46
|
+
*/
|
|
47
|
+
interface ColumnConfig<T = Record<string, unknown>> {
|
|
48
|
+
/** Column key (must match data object key) */
|
|
49
|
+
key: string;
|
|
50
|
+
/** Column label - can be string or JSX */
|
|
51
|
+
label: string | ReactNode;
|
|
52
|
+
/** Enable sorting for this column */
|
|
53
|
+
sortable?: boolean;
|
|
54
|
+
/** Custom render function for cell content */
|
|
55
|
+
render?: (value: unknown, row: T, index: number) => ReactNode;
|
|
56
|
+
/** Column width */
|
|
57
|
+
width?: string;
|
|
58
|
+
/** Additional CSS classes */
|
|
59
|
+
className?: string;
|
|
60
|
+
/** Text alignment */
|
|
61
|
+
align?: 'left' | 'center' | 'right';
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Combined parameters sent via onParamsChange
|
|
65
|
+
*/
|
|
66
|
+
interface TableParams {
|
|
67
|
+
/** Current page number */
|
|
68
|
+
page: number;
|
|
69
|
+
/** Items per page */
|
|
70
|
+
limit: number;
|
|
71
|
+
/** Search query */
|
|
72
|
+
search?: string;
|
|
73
|
+
/** Active filters (dynamic keys based on filter configs) */
|
|
74
|
+
[key: string]: unknown;
|
|
75
|
+
/** Sort column */
|
|
76
|
+
sortBy?: string;
|
|
77
|
+
/** Sort direction */
|
|
78
|
+
sortOrder?: 'asc' | 'desc';
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Pagination configuration
|
|
82
|
+
*/
|
|
83
|
+
interface PaginationConfig {
|
|
84
|
+
/** Label for items (e.g., "atividades") */
|
|
85
|
+
itemLabel?: string;
|
|
86
|
+
/** Items per page options */
|
|
87
|
+
itemsPerPageOptions?: number[];
|
|
88
|
+
/** Default items per page */
|
|
89
|
+
defaultItemsPerPage?: number;
|
|
90
|
+
/** Total items (for displaying pagination info) */
|
|
91
|
+
totalItems?: number;
|
|
92
|
+
/** Total pages (if known from backend) */
|
|
93
|
+
totalPages?: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Empty state configuration
|
|
97
|
+
*/
|
|
98
|
+
interface EmptyStateConfig {
|
|
99
|
+
/** Custom component to render when table is empty (no data and no search active) */
|
|
100
|
+
component?: ReactNode;
|
|
101
|
+
/** Text message to show in empty state (used if component not provided) */
|
|
102
|
+
message?: string;
|
|
103
|
+
/** Image to display in empty state */
|
|
104
|
+
image?: string;
|
|
105
|
+
/** Button text for empty state action */
|
|
106
|
+
buttonText?: string;
|
|
107
|
+
/** Callback when empty state button is clicked */
|
|
108
|
+
onButtonClick?: () => void;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Loading state configuration
|
|
112
|
+
*/
|
|
113
|
+
interface LoadingStateConfig {
|
|
114
|
+
/** Custom component to render when table is loading */
|
|
115
|
+
component?: ReactNode;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* No search result state configuration
|
|
119
|
+
*/
|
|
120
|
+
interface NoSearchResultConfig {
|
|
121
|
+
/** Custom component to render when search returns no results */
|
|
122
|
+
component?: ReactNode;
|
|
123
|
+
/** Title for no search result state */
|
|
124
|
+
title?: string;
|
|
125
|
+
/** Description for no search result state */
|
|
126
|
+
description?: string;
|
|
127
|
+
/** Image to display in no search result state */
|
|
128
|
+
image?: string;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Table components exposed via render prop
|
|
132
|
+
*/
|
|
133
|
+
interface TableComponents {
|
|
134
|
+
/** Search and filter controls */
|
|
135
|
+
controls: ReactNode;
|
|
136
|
+
/** Table with data */
|
|
137
|
+
table: ReactNode;
|
|
138
|
+
/** Pagination controls */
|
|
139
|
+
pagination: ReactNode;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* TableProvider Props
|
|
143
|
+
*/
|
|
144
|
+
interface TableProviderProps<T = Record<string, unknown>> {
|
|
145
|
+
/** Data to display in the table */
|
|
146
|
+
readonly data: T[];
|
|
147
|
+
/** Column configurations */
|
|
148
|
+
readonly headers: ColumnConfig<T>[];
|
|
149
|
+
/** Loading state */
|
|
150
|
+
readonly loading?: boolean;
|
|
151
|
+
/** Table variant */
|
|
152
|
+
readonly variant?: 'default' | 'borderless';
|
|
153
|
+
/** Enable search functionality */
|
|
154
|
+
readonly enableSearch?: boolean;
|
|
155
|
+
/** Enable filters functionality */
|
|
156
|
+
readonly enableFilters?: boolean;
|
|
157
|
+
/** Enable table sorting */
|
|
158
|
+
readonly enableTableSort?: boolean;
|
|
159
|
+
/** Enable pagination */
|
|
160
|
+
readonly enablePagination?: boolean;
|
|
161
|
+
/** Enable row click functionality */
|
|
162
|
+
readonly enableRowClick?: boolean;
|
|
163
|
+
/** Initial filter configurations */
|
|
164
|
+
readonly initialFilters?: FilterConfig[];
|
|
165
|
+
/** Pagination configuration */
|
|
166
|
+
readonly paginationConfig?: PaginationConfig;
|
|
167
|
+
/** Search placeholder text */
|
|
168
|
+
readonly searchPlaceholder?: string;
|
|
169
|
+
/** Empty state configuration (when table is empty with no search) */
|
|
170
|
+
readonly emptyState?: EmptyStateConfig;
|
|
171
|
+
/** Loading state configuration (when table is loading) */
|
|
172
|
+
readonly loadingState?: LoadingStateConfig;
|
|
173
|
+
/** No search result state configuration (when search returns no results) */
|
|
174
|
+
readonly noSearchResultState?: NoSearchResultConfig;
|
|
175
|
+
/** Key field name to use for unique row identification (recommended for better performance) */
|
|
176
|
+
readonly rowKey?: keyof T;
|
|
177
|
+
/** Callback when any parameter changes */
|
|
178
|
+
readonly onParamsChange?: (params: TableParams) => void;
|
|
179
|
+
/** Callback when row is clicked */
|
|
180
|
+
readonly onRowClick?: (row: T, index: number) => void;
|
|
181
|
+
/**
|
|
182
|
+
* Render prop for custom layout control
|
|
183
|
+
* When provided, gives full control over component positioning
|
|
184
|
+
* @param components - Table components (controls, table, pagination)
|
|
185
|
+
* @returns Custom layout JSX
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```tsx
|
|
189
|
+
* <TableProvider {...props}>
|
|
190
|
+
* {({ controls, table, pagination }) => (
|
|
191
|
+
* <>
|
|
192
|
+
* <div className="mb-4">{controls}</div>
|
|
193
|
+
* <div className="bg-white p-6">
|
|
194
|
+
* {table}
|
|
195
|
+
* {pagination}
|
|
196
|
+
* </div>
|
|
197
|
+
* </>
|
|
198
|
+
* )}
|
|
199
|
+
* </TableProvider>
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
readonly children?: (components: TableComponents) => ReactNode;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* TableProvider - Self-contained table component with search, filters, sorting, and pagination
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```tsx
|
|
209
|
+
* <TableProvider
|
|
210
|
+
* data={activities}
|
|
211
|
+
* headers={[
|
|
212
|
+
* { key: 'title', label: 'Título', sortable: true },
|
|
213
|
+
* { key: 'status', label: 'Status', render: (value) => <Badge>{value}</Badge> }
|
|
214
|
+
* ]}
|
|
215
|
+
* loading={loading}
|
|
216
|
+
* variant="borderless"
|
|
217
|
+
* enableSearch
|
|
218
|
+
* enableFilters
|
|
219
|
+
* enableTableSort
|
|
220
|
+
* enablePagination
|
|
221
|
+
* enableRowClick
|
|
222
|
+
* initialFilters={filterConfigs}
|
|
223
|
+
* paginationConfig={{ itemLabel: 'atividades' }}
|
|
224
|
+
* onParamsChange={handleParamsChange}
|
|
225
|
+
* onRowClick={handleRowClick}
|
|
226
|
+
* />
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
declare function TableProvider<T extends Record<string, unknown>>({ data, headers, loading, variant, enableSearch, enableFilters, enableTableSort, enablePagination, enableRowClick, initialFilters, paginationConfig, searchPlaceholder, emptyState, loadingState, noSearchResultState, rowKey, onParamsChange, onRowClick, children, }: TableProviderProps<T>): react_jsx_runtime.JSX.Element;
|
|
230
|
+
|
|
231
|
+
export { type ColumnConfig as C, type EmptyStateConfig as E, type FilterConfig as F, type LoadingStateConfig as L, type NoSearchResultConfig as N, type PaginationConfig as P, TableProvider as T, type UseTableFilterOptions as U, type UseTableFilterReturn as a, type TableParams as b, type TableProviderProps as c, type TableComponents as d, useTableFilter as u };
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { C as CategoryConfig } from './CheckBoxGroup-9n5C0OH4.mjs';
|
|
4
|
+
|
|
5
|
+
type FilterConfig = {
|
|
6
|
+
key: string;
|
|
7
|
+
label: string;
|
|
8
|
+
categories: CategoryConfig[];
|
|
9
|
+
};
|
|
10
|
+
type UseTableFilterOptions = {
|
|
11
|
+
syncWithUrl?: boolean;
|
|
12
|
+
};
|
|
13
|
+
type UseTableFilterReturn = {
|
|
14
|
+
filterConfigs: FilterConfig[];
|
|
15
|
+
activeFilters: Record<string, string[]>;
|
|
16
|
+
hasActiveFilters: boolean;
|
|
17
|
+
updateFilters: (configs: FilterConfig[]) => void;
|
|
18
|
+
applyFilters: () => void;
|
|
19
|
+
clearFilters: () => void;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Hook for managing table filters with URL synchronization
|
|
23
|
+
*
|
|
24
|
+
* @param initialConfigs - Initial filter configurations
|
|
25
|
+
* @param options - Hook options including URL sync
|
|
26
|
+
* @returns Filter state and management functions
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* const { filterConfigs, activeFilters, updateFilters, applyFilters } = useTableFilter(
|
|
31
|
+
* [
|
|
32
|
+
* {
|
|
33
|
+
* key: 'academic',
|
|
34
|
+
* label: 'Dados Acadêmicos',
|
|
35
|
+
* categories: [...]
|
|
36
|
+
* }
|
|
37
|
+
* ],
|
|
38
|
+
* { syncWithUrl: true }
|
|
39
|
+
* );
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare const useTableFilter: (initialConfigs: FilterConfig[], options?: UseTableFilterOptions) => UseTableFilterReturn;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Column configuration with flexible rendering options
|
|
46
|
+
*/
|
|
47
|
+
interface ColumnConfig<T = Record<string, unknown>> {
|
|
48
|
+
/** Column key (must match data object key) */
|
|
49
|
+
key: string;
|
|
50
|
+
/** Column label - can be string or JSX */
|
|
51
|
+
label: string | ReactNode;
|
|
52
|
+
/** Enable sorting for this column */
|
|
53
|
+
sortable?: boolean;
|
|
54
|
+
/** Custom render function for cell content */
|
|
55
|
+
render?: (value: unknown, row: T, index: number) => ReactNode;
|
|
56
|
+
/** Column width */
|
|
57
|
+
width?: string;
|
|
58
|
+
/** Additional CSS classes */
|
|
59
|
+
className?: string;
|
|
60
|
+
/** Text alignment */
|
|
61
|
+
align?: 'left' | 'center' | 'right';
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Combined parameters sent via onParamsChange
|
|
65
|
+
*/
|
|
66
|
+
interface TableParams {
|
|
67
|
+
/** Current page number */
|
|
68
|
+
page: number;
|
|
69
|
+
/** Items per page */
|
|
70
|
+
limit: number;
|
|
71
|
+
/** Search query */
|
|
72
|
+
search?: string;
|
|
73
|
+
/** Active filters (dynamic keys based on filter configs) */
|
|
74
|
+
[key: string]: unknown;
|
|
75
|
+
/** Sort column */
|
|
76
|
+
sortBy?: string;
|
|
77
|
+
/** Sort direction */
|
|
78
|
+
sortOrder?: 'asc' | 'desc';
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Pagination configuration
|
|
82
|
+
*/
|
|
83
|
+
interface PaginationConfig {
|
|
84
|
+
/** Label for items (e.g., "atividades") */
|
|
85
|
+
itemLabel?: string;
|
|
86
|
+
/** Items per page options */
|
|
87
|
+
itemsPerPageOptions?: number[];
|
|
88
|
+
/** Default items per page */
|
|
89
|
+
defaultItemsPerPage?: number;
|
|
90
|
+
/** Total items (for displaying pagination info) */
|
|
91
|
+
totalItems?: number;
|
|
92
|
+
/** Total pages (if known from backend) */
|
|
93
|
+
totalPages?: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Empty state configuration
|
|
97
|
+
*/
|
|
98
|
+
interface EmptyStateConfig {
|
|
99
|
+
/** Custom component to render when table is empty (no data and no search active) */
|
|
100
|
+
component?: ReactNode;
|
|
101
|
+
/** Text message to show in empty state (used if component not provided) */
|
|
102
|
+
message?: string;
|
|
103
|
+
/** Image to display in empty state */
|
|
104
|
+
image?: string;
|
|
105
|
+
/** Button text for empty state action */
|
|
106
|
+
buttonText?: string;
|
|
107
|
+
/** Callback when empty state button is clicked */
|
|
108
|
+
onButtonClick?: () => void;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Loading state configuration
|
|
112
|
+
*/
|
|
113
|
+
interface LoadingStateConfig {
|
|
114
|
+
/** Custom component to render when table is loading */
|
|
115
|
+
component?: ReactNode;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* No search result state configuration
|
|
119
|
+
*/
|
|
120
|
+
interface NoSearchResultConfig {
|
|
121
|
+
/** Custom component to render when search returns no results */
|
|
122
|
+
component?: ReactNode;
|
|
123
|
+
/** Title for no search result state */
|
|
124
|
+
title?: string;
|
|
125
|
+
/** Description for no search result state */
|
|
126
|
+
description?: string;
|
|
127
|
+
/** Image to display in no search result state */
|
|
128
|
+
image?: string;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Table components exposed via render prop
|
|
132
|
+
*/
|
|
133
|
+
interface TableComponents {
|
|
134
|
+
/** Search and filter controls */
|
|
135
|
+
controls: ReactNode;
|
|
136
|
+
/** Table with data */
|
|
137
|
+
table: ReactNode;
|
|
138
|
+
/** Pagination controls */
|
|
139
|
+
pagination: ReactNode;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* TableProvider Props
|
|
143
|
+
*/
|
|
144
|
+
interface TableProviderProps<T = Record<string, unknown>> {
|
|
145
|
+
/** Data to display in the table */
|
|
146
|
+
readonly data: T[];
|
|
147
|
+
/** Column configurations */
|
|
148
|
+
readonly headers: ColumnConfig<T>[];
|
|
149
|
+
/** Loading state */
|
|
150
|
+
readonly loading?: boolean;
|
|
151
|
+
/** Table variant */
|
|
152
|
+
readonly variant?: 'default' | 'borderless';
|
|
153
|
+
/** Enable search functionality */
|
|
154
|
+
readonly enableSearch?: boolean;
|
|
155
|
+
/** Enable filters functionality */
|
|
156
|
+
readonly enableFilters?: boolean;
|
|
157
|
+
/** Enable table sorting */
|
|
158
|
+
readonly enableTableSort?: boolean;
|
|
159
|
+
/** Enable pagination */
|
|
160
|
+
readonly enablePagination?: boolean;
|
|
161
|
+
/** Enable row click functionality */
|
|
162
|
+
readonly enableRowClick?: boolean;
|
|
163
|
+
/** Initial filter configurations */
|
|
164
|
+
readonly initialFilters?: FilterConfig[];
|
|
165
|
+
/** Pagination configuration */
|
|
166
|
+
readonly paginationConfig?: PaginationConfig;
|
|
167
|
+
/** Search placeholder text */
|
|
168
|
+
readonly searchPlaceholder?: string;
|
|
169
|
+
/** Empty state configuration (when table is empty with no search) */
|
|
170
|
+
readonly emptyState?: EmptyStateConfig;
|
|
171
|
+
/** Loading state configuration (when table is loading) */
|
|
172
|
+
readonly loadingState?: LoadingStateConfig;
|
|
173
|
+
/** No search result state configuration (when search returns no results) */
|
|
174
|
+
readonly noSearchResultState?: NoSearchResultConfig;
|
|
175
|
+
/** Key field name to use for unique row identification (recommended for better performance) */
|
|
176
|
+
readonly rowKey?: keyof T;
|
|
177
|
+
/** Callback when any parameter changes */
|
|
178
|
+
readonly onParamsChange?: (params: TableParams) => void;
|
|
179
|
+
/** Callback when row is clicked */
|
|
180
|
+
readonly onRowClick?: (row: T, index: number) => void;
|
|
181
|
+
/**
|
|
182
|
+
* Render prop for custom layout control
|
|
183
|
+
* When provided, gives full control over component positioning
|
|
184
|
+
* @param components - Table components (controls, table, pagination)
|
|
185
|
+
* @returns Custom layout JSX
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```tsx
|
|
189
|
+
* <TableProvider {...props}>
|
|
190
|
+
* {({ controls, table, pagination }) => (
|
|
191
|
+
* <>
|
|
192
|
+
* <div className="mb-4">{controls}</div>
|
|
193
|
+
* <div className="bg-white p-6">
|
|
194
|
+
* {table}
|
|
195
|
+
* {pagination}
|
|
196
|
+
* </div>
|
|
197
|
+
* </>
|
|
198
|
+
* )}
|
|
199
|
+
* </TableProvider>
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
readonly children?: (components: TableComponents) => ReactNode;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* TableProvider - Self-contained table component with search, filters, sorting, and pagination
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```tsx
|
|
209
|
+
* <TableProvider
|
|
210
|
+
* data={activities}
|
|
211
|
+
* headers={[
|
|
212
|
+
* { key: 'title', label: 'Título', sortable: true },
|
|
213
|
+
* { key: 'status', label: 'Status', render: (value) => <Badge>{value}</Badge> }
|
|
214
|
+
* ]}
|
|
215
|
+
* loading={loading}
|
|
216
|
+
* variant="borderless"
|
|
217
|
+
* enableSearch
|
|
218
|
+
* enableFilters
|
|
219
|
+
* enableTableSort
|
|
220
|
+
* enablePagination
|
|
221
|
+
* enableRowClick
|
|
222
|
+
* initialFilters={filterConfigs}
|
|
223
|
+
* paginationConfig={{ itemLabel: 'atividades' }}
|
|
224
|
+
* onParamsChange={handleParamsChange}
|
|
225
|
+
* onRowClick={handleRowClick}
|
|
226
|
+
* />
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
declare function TableProvider<T extends Record<string, unknown>>({ data, headers, loading, variant, enableSearch, enableFilters, enableTableSort, enablePagination, enableRowClick, initialFilters, paginationConfig, searchPlaceholder, emptyState, loadingState, noSearchResultState, rowKey, onParamsChange, onRowClick, children, }: TableProviderProps<T>): react_jsx_runtime.JSX.Element;
|
|
230
|
+
|
|
231
|
+
export { type ColumnConfig as C, type EmptyStateConfig as E, type FilterConfig as F, type LoadingStateConfig as L, type NoSearchResultConfig as N, type PaginationConfig as P, TableProvider as T, type UseTableFilterOptions as U, type UseTableFilterReturn as a, type TableParams as b, type TableProviderProps as c, type TableComponents as d, useTableFilter as u };
|
package/dist/index.css
CHANGED
|
@@ -2289,6 +2289,9 @@
|
|
|
2289
2289
|
.bg-blue-500 {
|
|
2290
2290
|
background-color: var(--color-blue-500);
|
|
2291
2291
|
}
|
|
2292
|
+
.bg-blue-600 {
|
|
2293
|
+
background-color: var(--color-blue-600);
|
|
2294
|
+
}
|
|
2292
2295
|
.bg-blue-700 {
|
|
2293
2296
|
background-color: var(--color-blue-700);
|
|
2294
2297
|
}
|
|
@@ -2981,9 +2984,6 @@
|
|
|
2981
2984
|
.py-8 {
|
|
2982
2985
|
padding-block: calc(var(--spacing) * 8);
|
|
2983
2986
|
}
|
|
2984
|
-
.py-12 {
|
|
2985
|
-
padding-block: calc(var(--spacing) * 12);
|
|
2986
|
-
}
|
|
2987
2987
|
.py-\[17px\] {
|
|
2988
2988
|
padding-block: 17px;
|
|
2989
2989
|
}
|
|
@@ -5021,6 +5021,13 @@
|
|
|
5021
5021
|
}
|
|
5022
5022
|
}
|
|
5023
5023
|
}
|
|
5024
|
+
.hover\:bg-blue-700 {
|
|
5025
|
+
&:hover {
|
|
5026
|
+
@media (hover: hover) {
|
|
5027
|
+
background-color: var(--color-blue-700);
|
|
5028
|
+
}
|
|
5029
|
+
}
|
|
5030
|
+
}
|
|
5024
5031
|
.hover\:bg-border-50 {
|
|
5025
5032
|
&:hover {
|
|
5026
5033
|
@media (hover: hover) {
|