react-admin-crud-manager 1.2.9 → 1.2.11
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 +159 -40
- package/dist/index.cjs.js +1000 -22
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +10700 -3254
- package/dist/index.es.js.map +1 -1
- package/dist/types/OptionalSnackbarProvider.d.ts +1 -1
- package/dist/types/components/Form/components/FilePicker.d.ts +19 -0
- package/dist/types/components/Form/components/FreeEditor.d.ts +14 -0
- package/dist/types/components/Form/components/RenderFields.d.ts +1 -0
- package/dist/types/types/crudtypes.d.ts +45 -0
- package/package.json +2 -1
|
@@ -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;
|
|
3
|
+
preview?: string;
|
|
4
|
+
} | string | 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;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface FreeEditorProps {
|
|
2
|
+
value: string;
|
|
3
|
+
name: string;
|
|
4
|
+
onChange: (content: string) => void;
|
|
5
|
+
label?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
parentClass?: string;
|
|
9
|
+
height?: number;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
errorMessage?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const FreeEditor: ({ value, name, onChange, label, required, placeholder, parentClass, height, disabled, errorMessage, }: FreeEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default FreeEditor;
|
|
@@ -21,11 +21,13 @@ 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;
|
|
27
28
|
title?: string;
|
|
28
29
|
type?: string;
|
|
30
|
+
render?: (row: Record<string, any>, index: number) => ReactNode;
|
|
29
31
|
imageKey?: string;
|
|
30
32
|
titleKey?: string;
|
|
31
33
|
subtitleKey?: string;
|
|
@@ -77,6 +79,7 @@ export interface ViewField {
|
|
|
77
79
|
key?: string;
|
|
78
80
|
label?: string;
|
|
79
81
|
type?: string;
|
|
82
|
+
render?: (data: Record<string, any>) => ReactNode;
|
|
80
83
|
imageKey?: string;
|
|
81
84
|
titleKey?: string;
|
|
82
85
|
subtitleKey?: string;
|
|
@@ -149,6 +152,46 @@ export interface SortConfig {
|
|
|
149
152
|
clearLabel?: string;
|
|
150
153
|
onChange?: (payload: SortChangePayload) => void;
|
|
151
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
|
+
}
|
|
152
195
|
export interface exportCSVConfig {
|
|
153
196
|
enabled?: boolean;
|
|
154
197
|
fileName?: string;
|
|
@@ -180,6 +223,8 @@ export interface TableConfig {
|
|
|
180
223
|
filter?: FilterConfig;
|
|
181
224
|
sort?: SortConfig;
|
|
182
225
|
exportCSV?: exportCSVConfig;
|
|
226
|
+
customButtons?: ToolbarButton[];
|
|
227
|
+
customMenuItems?: ToolbarMenuItem[];
|
|
183
228
|
}
|
|
184
229
|
export interface ModalConfig {
|
|
185
230
|
addModal?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-admin-crud-manager",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.11",
|
|
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",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"prop-types": "^15.8.1",
|
|
54
54
|
"react-easy-crop": "^5.5.6",
|
|
55
55
|
"react-router-dom": "^7.9.1",
|
|
56
|
+
"react-text-editor-kit": "3.0.0",
|
|
56
57
|
"tinymce": "^8.3.2"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|