muffin-admin 3.8.1 → 3.8.3
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/types.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export type AdminField = [string, {
|
|
|
17
17
|
export type AdminInput = [string, {
|
|
18
18
|
required: boolean;
|
|
19
19
|
source: string;
|
|
20
|
+
[key: string]: any;
|
|
20
21
|
}];
|
|
21
22
|
export type AdminShowLink = {
|
|
22
23
|
label: string;
|
|
@@ -29,6 +30,13 @@ export type AdminShowProps = {
|
|
|
29
30
|
links: [string, AdminShowLink][];
|
|
30
31
|
edit?: boolean;
|
|
31
32
|
};
|
|
33
|
+
export type AdminPayloadProps = {
|
|
34
|
+
active: boolean;
|
|
35
|
+
onClose: () => void;
|
|
36
|
+
onHandle: (payload?: any) => void;
|
|
37
|
+
title?: string;
|
|
38
|
+
schema?: AdminInput[];
|
|
39
|
+
};
|
|
32
40
|
export type AdminResourceProps = {
|
|
33
41
|
name: string;
|
|
34
42
|
icon?: string;
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ import { useState } from "react"
|
|
|
13
13
|
import { buildRA } from "../buildRA"
|
|
14
14
|
import { AdminModal, PayloadButtons, useConfirmation } from "../common"
|
|
15
15
|
import { useAction } from "../hooks/useAction"
|
|
16
|
-
import { AdminAction } from "../types"
|
|
16
|
+
import { AdminAction, AdminPayloadProps } from "../types"
|
|
17
17
|
import { buildIcon, findBuilder } from "../utils"
|
|
18
18
|
|
|
19
19
|
export type ActionPayloadProps = {
|
|
@@ -102,7 +102,7 @@ function ActionButtonBase({
|
|
|
102
102
|
)
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
export function CommonPayload({ active, onClose, onHandle, schema, title }) {
|
|
105
|
+
export function CommonPayload({ active, onClose, onHandle, schema, title }: AdminPayloadProps) {
|
|
106
106
|
schema[0][1] = { ...schema[0][1], autoFocus: true }
|
|
107
107
|
const inputs = buildRA(schema)
|
|
108
108
|
const translate = useTranslate()
|
package/src/types.ts
CHANGED
|
@@ -14,7 +14,7 @@ export type AdminAction = {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export type AdminField = [string, { source: string }]
|
|
17
|
-
export type AdminInput = [string, { required: boolean; source: string }]
|
|
17
|
+
export type AdminInput = [string, { required: boolean; source: string; [key: string]: any }]
|
|
18
18
|
|
|
19
19
|
export type AdminShowLink = {
|
|
20
20
|
label: string
|
|
@@ -28,6 +28,14 @@ export type AdminShowProps = {
|
|
|
28
28
|
edit?: boolean
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
export type AdminPayloadProps = {
|
|
32
|
+
active: boolean
|
|
33
|
+
onClose: () => void
|
|
34
|
+
onHandle: (payload?: any) => void
|
|
35
|
+
title?: string
|
|
36
|
+
schema?: AdminInput[]
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
export type AdminResourceProps = {
|
|
32
40
|
name: string
|
|
33
41
|
icon?: string
|
|
@@ -35,11 +43,11 @@ export type AdminResourceProps = {
|
|
|
35
43
|
actions: AdminAction[]
|
|
36
44
|
create: AdminInput[] | false
|
|
37
45
|
edit:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
| {
|
|
47
|
+
inputs: AdminInput[]
|
|
48
|
+
remove?: boolean
|
|
49
|
+
}
|
|
50
|
+
| false
|
|
43
51
|
list: {
|
|
44
52
|
limit: number
|
|
45
53
|
limitMax: number
|