@ackplus/react-tanstack-data-table 1.1.10 → 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.
@@ -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[];
@@ -116,6 +116,7 @@ export interface DataTableProps<T> {
116
116
  enableTableSizeControl?: boolean;
117
117
  enableExport?: boolean;
118
118
  enableReset?: boolean;
119
+ enableRefresh?: boolean;
119
120
 
120
121
  // Loading and empty states
121
122
  loading?: boolean;
@@ -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<T>(
165
+ export function createSlotProps(
166
166
  table: any,
167
167
  additionalProps: Record<string, any> = {}
168
168
  ): Record<string, any> {