@snowpact/react-tanstack-query-table 1.5.3 → 1.5.4
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 +34 -52
- package/dist/index.cjs +20 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +26 -73
- package/dist/index.js +2950 -5826
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -6
package/dist/index.d.ts
CHANGED
|
@@ -54,22 +54,6 @@ export declare interface BaseSnowTableProps<T extends Record<string, unknown>, K
|
|
|
54
54
|
persistState?: boolean;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
/**
|
|
58
|
-
* Styles Registry
|
|
59
|
-
*
|
|
60
|
-
* ONLY visual styles are customizable (colors, borders, shadows, rounded).
|
|
61
|
-
* Structural styles (layout, sizing, positioning) are fixed in the components.
|
|
62
|
-
*/
|
|
63
|
-
declare interface ButtonStyles {
|
|
64
|
-
visual: string;
|
|
65
|
-
hover: string;
|
|
66
|
-
disabled: string;
|
|
67
|
-
danger: string;
|
|
68
|
-
warning: string;
|
|
69
|
-
info: string;
|
|
70
|
-
success: string;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
57
|
export declare type ClickAction<T> = BaseAction & {
|
|
74
58
|
type: 'click';
|
|
75
59
|
onClick: (item: T) => void;
|
|
@@ -121,20 +105,6 @@ export declare type DataTableProps<T extends object> = {
|
|
|
121
105
|
onResetFilters?: () => void;
|
|
122
106
|
};
|
|
123
107
|
|
|
124
|
-
declare interface DataTableStyles {
|
|
125
|
-
root: string;
|
|
126
|
-
container: string;
|
|
127
|
-
header: string;
|
|
128
|
-
headerCell: string;
|
|
129
|
-
row: string;
|
|
130
|
-
rowHover: string;
|
|
131
|
-
rowAlternate: string;
|
|
132
|
-
rowActive: string;
|
|
133
|
-
divider: string;
|
|
134
|
-
empty: string;
|
|
135
|
-
loadingOverlay: string;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
108
|
/**
|
|
139
109
|
* UI options that can be passed through to the underlying DataTable
|
|
140
110
|
*/
|
|
@@ -154,19 +124,8 @@ export declare interface DataTableUIOptions<T extends object> {
|
|
|
154
124
|
};
|
|
155
125
|
}
|
|
156
126
|
|
|
157
|
-
declare type DeepPartial<T> = {
|
|
158
|
-
[P in keyof T]?: T[P] extends object ? Partial<T[P]> : T[P];
|
|
159
|
-
};
|
|
160
|
-
|
|
161
127
|
export declare const DEFAULT_PAGE_SIZES: number[];
|
|
162
128
|
|
|
163
|
-
declare interface DropdownStyles {
|
|
164
|
-
content: string;
|
|
165
|
-
item: string;
|
|
166
|
-
checkboxItem: string;
|
|
167
|
-
separator: string;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
129
|
export declare type EndpointAction<T, K> = BaseAction & {
|
|
171
130
|
type: 'endpoint';
|
|
172
131
|
endpoint: (item: T) => Promise<K>;
|
|
@@ -289,13 +248,6 @@ export declare interface SearchBarProps {
|
|
|
289
248
|
placeholder?: string;
|
|
290
249
|
}
|
|
291
250
|
|
|
292
|
-
declare interface SelectStyles {
|
|
293
|
-
trigger: string;
|
|
294
|
-
content: string;
|
|
295
|
-
item: string;
|
|
296
|
-
itemSelected: string;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
251
|
/**
|
|
300
252
|
* Parameters sent to the server for pagination, search, and filtering
|
|
301
253
|
*/
|
|
@@ -320,9 +272,33 @@ export declare interface ServerPaginatedResponse<T> {
|
|
|
320
272
|
export declare const setupSnowTable: (options: SetupSnowTableOptions) => void;
|
|
321
273
|
|
|
322
274
|
export declare interface SetupSnowTableOptions {
|
|
323
|
-
|
|
275
|
+
/**
|
|
276
|
+
* Translation function (required)
|
|
277
|
+
* Used for all text in the table (column labels, UI elements, etc.)
|
|
278
|
+
* For static UI keys (dataTable.*), if your function returns the key unchanged,
|
|
279
|
+
* built-in English defaults are used as fallback.
|
|
280
|
+
*/
|
|
281
|
+
translate: (key: string) => string;
|
|
282
|
+
/**
|
|
283
|
+
* Custom translations to merge with defaults (optional)
|
|
284
|
+
* Useful for simple overrides without a full i18n setup
|
|
285
|
+
*/
|
|
286
|
+
translations?: Partial<{
|
|
287
|
+
'dataTable.search': string;
|
|
288
|
+
'dataTable.elements': string;
|
|
289
|
+
'dataTable.paginationSize': string;
|
|
290
|
+
'dataTable.columnsConfiguration': string;
|
|
291
|
+
'dataTable.resetFilters': string;
|
|
292
|
+
'dataTable.resetColumns': string;
|
|
293
|
+
'dataTable.searchFilters': string;
|
|
294
|
+
'dataTable.searchEmpty': string;
|
|
295
|
+
'dataTable.selectFilter': string;
|
|
296
|
+
}>;
|
|
297
|
+
/**
|
|
298
|
+
* Link component for navigation (required for actions with href)
|
|
299
|
+
* Use your router's Link component (react-router, next/link, etc.)
|
|
300
|
+
*/
|
|
324
301
|
LinkComponent: ComponentType<LinkProps>;
|
|
325
|
-
styles?: DeepPartial<SnowTableStyles>;
|
|
326
302
|
}
|
|
327
303
|
|
|
328
304
|
export declare function SingleFilterDropdown<T extends object>({ filter, selectedValues, onFilterChange, }: SingleFilterDropdownProps<T>): JSX.Element | null;
|
|
@@ -364,37 +340,14 @@ export declare interface SnowServerDataTableProps<T extends Record<string, unkno
|
|
|
364
340
|
filters?: FilterConfig<Record<string, unknown>>[];
|
|
365
341
|
}
|
|
366
342
|
|
|
367
|
-
declare interface SnowTableStyles {
|
|
368
|
-
state: StateStyles;
|
|
369
|
-
button: ButtonStyles;
|
|
370
|
-
input: string;
|
|
371
|
-
skeleton: string;
|
|
372
|
-
dropdown: DropdownStyles;
|
|
373
|
-
select: SelectStyles;
|
|
374
|
-
tabs: TabsStyles;
|
|
375
|
-
table: DataTableStyles;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
343
|
export declare function SortButton({ column }: SortButtonProps): JSX.Element | null;
|
|
379
344
|
|
|
380
345
|
export declare interface SortButtonProps {
|
|
381
346
|
column: Column<any, any>;
|
|
382
347
|
}
|
|
383
348
|
|
|
384
|
-
declare interface StateStyles {
|
|
385
|
-
active: string;
|
|
386
|
-
activeText: string;
|
|
387
|
-
focus: string;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
349
|
export declare type TableAction<T, K = unknown> = ClickAction<T> | LinkAction<T> | EndpointAction<T, K> | ((item: T) => ClickAction<T>) | ((item: T) => LinkAction<T>) | ((item: T) => EndpointAction<T, K>);
|
|
391
350
|
|
|
392
|
-
declare interface TabsStyles {
|
|
393
|
-
list: string;
|
|
394
|
-
trigger: string;
|
|
395
|
-
triggerActive: string;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
351
|
/**
|
|
399
352
|
* Shared hook for building columns and handling actions in SnowClientDataTable and SnowServerDataTable.
|
|
400
353
|
*
|