muffin-admin 4.0.0 → 5.0.0
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/MuffinResourceList.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/MuffinResourceList.tsx +2 -2
- package/src/types.ts +9 -9
package/dist/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export type TID = string | number;
|
|
|
2
2
|
export type TProps = {
|
|
3
3
|
[key: string]: any;
|
|
4
4
|
};
|
|
5
|
-
export type TAdminType = "action-form" | "admin" | "appbar" | "auth-provider" | "auth-storage-get" | "auth-storage-set" | "create" | "create-
|
|
5
|
+
export type TAdminType = "action-form" | "admin" | "appbar" | "auth-provider" | "auth-storage-get" | "auth-storage-set" | "create" | "create-toolbar" | "create-inputs" | "dashboard" | "dashboard-actions" | "dashboard-content" | "data-provider" | "edit" | "edit-actions" | "edit-toolbar" | "edit-inputs" | "layout" | "list" | "list-actions" | "list-toolbar" | "list-grid" | "list-grid-buttons" | "list-filters" | "list-fields" | "locale" | "loginpage" | "resource" | "show" | "show-actions" | "show-toolbar" | "show-fields" | "show-links";
|
|
6
6
|
export type TAdminPath = [type: TAdminType, ...ids: string[]];
|
|
7
7
|
export type AdminAction = {
|
|
8
8
|
view?: ("show" | "edit" | "list" | "bulk")[];
|
package/package.json
CHANGED
|
@@ -50,7 +50,7 @@ setupAdmin(["list-filters"], buildRA)
|
|
|
50
50
|
function MuffinListDatagrid() {
|
|
51
51
|
const { name, list } = useMuffinResourceOpts()
|
|
52
52
|
const { fields, edit, show } = list
|
|
53
|
-
const BulkActions = findBuilder(["list-
|
|
53
|
+
const BulkActions = findBuilder(["list-actions", name])
|
|
54
54
|
return (
|
|
55
55
|
<DatagridConfigurable
|
|
56
56
|
rowClick={show ? "show" : edit ? "edit" : false}
|
|
@@ -113,4 +113,4 @@ function MuffinListBulkActions() {
|
|
|
113
113
|
)
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
setupAdmin(["list-
|
|
116
|
+
setupAdmin(["list-actions"], MuffinListBulkActions)
|
package/src/types.ts
CHANGED
|
@@ -12,24 +12,24 @@ export type TAdminType =
|
|
|
12
12
|
| "auth-storage-get"
|
|
13
13
|
| "auth-storage-set"
|
|
14
14
|
| "create"
|
|
15
|
-
| "create-inputs"
|
|
16
15
|
| "create-toolbar"
|
|
16
|
+
| "create-inputs"
|
|
17
17
|
| "dashboard"
|
|
18
18
|
| "dashboard-actions"
|
|
19
19
|
| "dashboard-content"
|
|
20
20
|
| "data-provider"
|
|
21
21
|
| "edit"
|
|
22
22
|
| "edit-actions"
|
|
23
|
-
| "edit-inputs"
|
|
24
23
|
| "edit-toolbar"
|
|
24
|
+
| "edit-inputs"
|
|
25
25
|
| "layout"
|
|
26
26
|
| "list"
|
|
27
|
+
| "list-actions"
|
|
27
28
|
| "list-toolbar"
|
|
28
29
|
| "list-grid"
|
|
29
30
|
| "list-grid-buttons"
|
|
30
31
|
| "list-filters"
|
|
31
32
|
| "list-fields"
|
|
32
|
-
| "list-bulk-actions"
|
|
33
33
|
| "locale"
|
|
34
34
|
| "loginpage"
|
|
35
35
|
| "resource"
|
|
@@ -54,7 +54,7 @@ export type AdminAction = {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export type AdminField = [string, { source: string }]
|
|
57
|
-
export type AdminInput = [string, { required: boolean; source: string;
|
|
57
|
+
export type AdminInput = [string, { required: boolean; source: string;[key: string]: any }]
|
|
58
58
|
|
|
59
59
|
export type AdminShowLink = {
|
|
60
60
|
label: string
|
|
@@ -85,11 +85,11 @@ export type AdminResourceProps = {
|
|
|
85
85
|
actions: AdminAction[]
|
|
86
86
|
create: AdminInput[] | false
|
|
87
87
|
edit:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
| {
|
|
89
|
+
inputs: AdminInput[]
|
|
90
|
+
remove?: boolean
|
|
91
|
+
}
|
|
92
|
+
| false
|
|
93
93
|
list: {
|
|
94
94
|
limit: number
|
|
95
95
|
limitMax: number
|