react-admin-crud-manager 1.2.10 → 1.2.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.
@@ -2,5 +2,5 @@ import React from "react";
2
2
  interface OptionalSnackbarProviderProps {
3
3
  children: React.ReactNode;
4
4
  }
5
- export default function OptionalSnackbarProvider({ children }: OptionalSnackbarProviderProps): import("react/jsx-runtime").JSX.Element;
5
+ export default function OptionalSnackbarProvider({ children, }: OptionalSnackbarProviderProps): import("react/jsx-runtime").JSX.Element;
6
6
  export {};
@@ -0,0 +1,19 @@
1
+ type FileValue = File | {
2
+ file?: File | string | Record<string, any>;
3
+ preview?: string;
4
+ } | Record<string, any> | string | FileValue[] | null;
5
+ interface FilePickerProps {
6
+ label?: string;
7
+ value: FileValue;
8
+ onChange: (file: File | null) => void;
9
+ required?: boolean;
10
+ accept?: string;
11
+ id: string;
12
+ dragDrop?: boolean;
13
+ name: string;
14
+ parentClass?: string;
15
+ maxSize?: number;
16
+ errorMessage?: string;
17
+ }
18
+ declare const FilePicker: ({ label, value, onChange, required, accept, id, dragDrop, name, parentClass, maxSize, errorMessage, }: FilePickerProps) => import("react/jsx-runtime").JSX.Element;
19
+ export default FilePicker;
@@ -21,6 +21,7 @@ export interface MenuAction {
21
21
  type: string;
22
22
  variant?: string;
23
23
  icon?: ReactNode;
24
+ onClick?: (event: React.MouseEvent, item: any) => void | Promise<any>;
24
25
  }
25
26
  export interface TableHead {
26
27
  key: string;
@@ -151,6 +152,46 @@ export interface SortConfig {
151
152
  clearLabel?: string;
152
153
  onChange?: (payload: SortChangePayload) => void;
153
154
  }
155
+ export interface ToolbarButton {
156
+ key?: string;
157
+ label: string;
158
+ icon?: ReactNode;
159
+ variant?: string;
160
+ color?: string;
161
+ className?: string;
162
+ disabled?: boolean;
163
+ show?: boolean;
164
+ onClick?: (event: React.MouseEvent, context: {
165
+ data: any[];
166
+ filteredData: any[];
167
+ sortedData: any[];
168
+ paginatedData: any[];
169
+ searchTerm: string;
170
+ appliedFilters: Record<string, any>;
171
+ currentPage: number;
172
+ pageSize: number;
173
+ totalRecords: number;
174
+ }) => void | Promise<void>;
175
+ }
176
+ export interface ToolbarMenuItem {
177
+ key?: string;
178
+ label: string;
179
+ icon?: ReactNode;
180
+ className?: string;
181
+ disabled?: boolean;
182
+ show?: boolean;
183
+ onClick?: (event: React.MouseEvent, context: {
184
+ data: any[];
185
+ filteredData: any[];
186
+ sortedData: any[];
187
+ paginatedData: any[];
188
+ searchTerm: string;
189
+ appliedFilters: Record<string, any>;
190
+ currentPage: number;
191
+ pageSize: number;
192
+ totalRecords: number;
193
+ }) => void | Promise<void>;
194
+ }
154
195
  export interface exportCSVConfig {
155
196
  enabled?: boolean;
156
197
  fileName?: string;
@@ -182,6 +223,8 @@ export interface TableConfig {
182
223
  filter?: FilterConfig;
183
224
  sort?: SortConfig;
184
225
  exportCSV?: exportCSVConfig;
226
+ customButtons?: ToolbarButton[];
227
+ customMenuItems?: ToolbarMenuItem[];
185
228
  }
186
229
  export interface ModalConfig {
187
230
  addModal?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-admin-crud-manager",
3
- "version": "1.2.10",
3
+ "version": "1.2.12",
4
4
  "description": "A reusable React CRUD admin template with modular components.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",