muffin-admin 3.4.1 → 3.5.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/MuffinResourceEdit.js +2 -2
- package/dist/MuffinResourceList.js +2 -1
- package/dist/MuffinResourceShow.js +2 -2
- package/dist/common/AdminModal.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +2 -4
- package/package.json +1 -1
- package/src/MuffinResourceEdit.tsx +2 -2
- package/src/MuffinResourceList.tsx +3 -1
- package/src/MuffinResourceShow.tsx +2 -2
- package/src/common/AdminModal.tsx +1 -1
- package/src/types.ts +7 -9
|
@@ -24,10 +24,10 @@ export function MuffinEditToolbar() {
|
|
|
24
24
|
}
|
|
25
25
|
setupAdmin(["edit-toolbar"], MuffinEditToolbar);
|
|
26
26
|
export function MuffinEditActions() {
|
|
27
|
-
const { edit } = useMuffinResourceOpts();
|
|
27
|
+
const { edit, actions: baseActions = [] } = useMuffinResourceOpts();
|
|
28
28
|
if (!edit)
|
|
29
29
|
return null;
|
|
30
|
-
const
|
|
30
|
+
const actions = baseActions.filter((a => a.view.includes("edit")));
|
|
31
31
|
return (_jsx(_Fragment, { children: actions.map((props, idx) => (_jsx(ActionButton, Object.assign({}, props), idx))) }));
|
|
32
32
|
}
|
|
33
33
|
setupAdmin(["edit-actions"], MuffinEditActions);
|
|
@@ -37,7 +37,8 @@ function MuffinListToolbar() {
|
|
|
37
37
|
}
|
|
38
38
|
setupAdmin(["list-toolbar"], MuffinListToolbar);
|
|
39
39
|
function MuffinListBulkActions() {
|
|
40
|
-
const { list: {
|
|
40
|
+
const { actions: baseActions = [], list: { remove }, } = useMuffinResourceOpts();
|
|
41
|
+
const actions = baseActions.filter((a) => a.view.includes("list"));
|
|
41
42
|
return (_jsxs(_Fragment, { children: [actions.map((props) => (_jsx(BulkActionButton, Object.assign({}, props), props.id))), _jsx(BulkExportButton, {}), remove && _jsx(BulkDeleteButton, {})] }));
|
|
42
43
|
}
|
|
43
44
|
setupAdmin(["list-bulk-actions"], MuffinListBulkActions);
|
|
@@ -21,8 +21,8 @@ export function MuffinShowToolbar() {
|
|
|
21
21
|
}
|
|
22
22
|
setupAdmin(["show-toolbar"], MuffinShowToolbar);
|
|
23
23
|
export function MuffinShowActions() {
|
|
24
|
-
const {
|
|
25
|
-
const
|
|
24
|
+
const { actions: baseActions = [] } = useMuffinResourceOpts();
|
|
25
|
+
const actions = baseActions.filter((a) => a.view.includes("show"));
|
|
26
26
|
return actions.map((props) => _jsx(ActionButton, Object.assign({}, props), props.id));
|
|
27
27
|
}
|
|
28
28
|
setupAdmin(["show-actions"], MuffinShowActions);
|
|
@@ -3,7 +3,7 @@ import { PropsWithChildren } from "react";
|
|
|
3
3
|
interface IProps {
|
|
4
4
|
open: boolean;
|
|
5
5
|
onClose: () => void;
|
|
6
|
-
title?:
|
|
6
|
+
title?: React.ReactNode;
|
|
7
7
|
actions?: React.ReactNode;
|
|
8
8
|
}
|
|
9
9
|
export declare function AdminModal({ open, onClose, children, title, actions, ...props }: PropsWithChildren<IProps & DialogProps>): import("react/jsx-runtime").JSX.Element;
|