@ackplus/react-tanstack-data-table 1.1.11 → 1.1.12
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/lib/components/toolbar/data-table-toolbar.d.ts.map +1 -1
- package/dist/lib/components/toolbar/data-table-toolbar.js +5 -2
- package/dist/lib/components/toolbar/table-refresh-control.d.ts +15 -0
- package/dist/lib/components/toolbar/table-refresh-control.d.ts.map +1 -0
- package/dist/lib/components/toolbar/table-refresh-control.js +61 -0
- package/dist/lib/data-table.d.ts.map +1 -1
- package/dist/lib/data-table.js +749 -916
- package/dist/lib/types/data-table-api.d.ts +1 -0
- package/dist/lib/types/data-table-api.d.ts.map +1 -1
- package/dist/lib/types/data-table.types.d.ts +1 -0
- package/dist/lib/types/data-table.types.d.ts.map +1 -1
- package/dist/lib/types/slots.types.d.ts +9 -0
- package/dist/lib/types/slots.types.d.ts.map +1 -1
- package/dist/lib/utils/slot-helpers.d.ts +1 -1
- package/dist/lib/utils/slot-helpers.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/lib/components/toolbar/data-table-toolbar.tsx +15 -1
- package/src/lib/components/toolbar/table-refresh-control.tsx +58 -0
- package/src/lib/data-table.tsx +773 -904
- package/src/lib/types/data-table-api.ts +4 -0
- package/src/lib/types/data-table.types.ts +1 -0
- package/src/lib/types/slots.types.ts +8 -0
- package/src/lib/utils/slot-helpers.tsx +1 -1
|
@@ -94,8 +94,12 @@ export interface DataTableApi<T = any> {
|
|
|
94
94
|
|
|
95
95
|
// Data Management
|
|
96
96
|
data: {
|
|
97
|
+
// Refresh data with pagination reset
|
|
97
98
|
refresh: (resetPagination?: boolean) => void;
|
|
99
|
+
// Reload data without all current states
|
|
98
100
|
reload: () => void;
|
|
101
|
+
// Reset all data to initial state
|
|
102
|
+
resetAll: () => void;
|
|
99
103
|
|
|
100
104
|
// Data CRUD operations
|
|
101
105
|
getAllData: () => T[];
|
|
@@ -70,6 +70,7 @@ export interface DataTableSlots<T = any> {
|
|
|
70
70
|
enableReset?: boolean;
|
|
71
71
|
enableTableSizeControl?: boolean;
|
|
72
72
|
enableColumnPinning?: boolean;
|
|
73
|
+
enableRefresh?: boolean;
|
|
73
74
|
extraFilter?: ReactNode;
|
|
74
75
|
serverExport?: {
|
|
75
76
|
fetchData: (page: number, pageSize: number, filters: TableFilters) => Promise<{ data: T[]; total: number }>;
|
|
@@ -210,8 +211,15 @@ export interface DataTableSlots<T = any> {
|
|
|
210
211
|
onExportCancel?: () => void;
|
|
211
212
|
}>>;
|
|
212
213
|
|
|
214
|
+
refreshButton?: SlotComponent<EnhancedSlotProps<BaseSlotProps<T>, ComponentProps<'button'> & {
|
|
215
|
+
loading?: boolean;
|
|
216
|
+
showSpinnerWhileLoading?: boolean;
|
|
217
|
+
onRefresh?: () => void;
|
|
218
|
+
}>>;
|
|
219
|
+
|
|
213
220
|
// Icon slots with full SVG component props
|
|
214
221
|
searchIcon?: SlotComponent<ComponentProps<'svg'> & { [key: string]: any }>;
|
|
222
|
+
refreshIcon?: SlotComponent<ComponentProps<'svg'> & { [key: string]: any }>;
|
|
215
223
|
clearIcon?: SlotComponent<ComponentProps<'svg'> & { [key: string]: any }>;
|
|
216
224
|
exportIcon?: SlotComponent<ComponentProps<'svg'> & { [key: string]: any }>;
|
|
217
225
|
columnIcon?: SlotComponent<ComponentProps<'svg'> & { [key: string]: any }>;
|
|
@@ -162,7 +162,7 @@ export function validateSlotProps<T, K extends keyof DataTableSlots<T>>(
|
|
|
162
162
|
/**
|
|
163
163
|
* Helper to create slot props with proper typing
|
|
164
164
|
*/
|
|
165
|
-
export function createSlotProps
|
|
165
|
+
export function createSlotProps(
|
|
166
166
|
table: any,
|
|
167
167
|
additionalProps: Record<string, any> = {}
|
|
168
168
|
): Record<string, any> {
|