muffin-admin 1.28.2 → 1.31.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/.eslintrc.json +44 -0
- package/Makefile +7 -0
- package/dist/admin.js +82 -0
- package/dist/authprovider.js +250 -0
- package/dist/buttons/ActionButton.js +110 -0
- package/dist/buttons/LinkButton.js +44 -0
- package/dist/dashboard.js +70 -0
- package/dist/dataprovider.js +379 -0
- package/dist/fields/AvatarField.js +46 -0
- package/dist/fields/FKField.js +43 -0
- package/dist/fields/JsonField.js +51 -0
- package/dist/hooks/useAction.js +17 -0
- package/dist/index.js +21 -0
- package/dist/inputs/FKInput.js +53 -0
- package/dist/inputs/JsonInput.js +82 -0
- package/dist/resources.js +57 -0
- package/dist/ui.js +95 -0
- package/dist/utils.js +67 -0
- package/dist/views/create.js +25 -0
- package/dist/views/edit.js +53 -0
- package/dist/views/list.js +83 -0
- package/dist/views/show.js +36 -0
- package/dist/web.js +33 -0
- package/jsconfig.json +9 -0
- package/package.json +25 -13
- package/webpack.config.js +20 -22
- package/admin.jsx +0 -56
- package/authprovider.js +0 -79
- package/buttons/ActionButton.jsx +0 -68
- package/buttons/LinkButton.jsx +0 -21
- package/dashboard.jsx +0 -57
- package/dataprovider.js +0 -81
- package/fields/AvatarField.jsx +0 -25
- package/fields/FKField.jsx +0 -24
- package/index.js +0 -12
- package/inputs/FKInput.jsx +0 -30
- package/resources.jsx +0 -27
- package/ui.jsx +0 -51
- package/utils.js +0 -35
- package/views/create.jsx +0 -26
- package/views/edit.jsx +0 -34
- package/views/list.jsx +0 -56
- package/views/show.jsx +0 -34
package/views/list.jsx
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
BulkDeleteButton,
|
|
5
|
-
Datagrid,
|
|
6
|
-
EditButton,
|
|
7
|
-
Filter,
|
|
8
|
-
List,
|
|
9
|
-
Pagination,
|
|
10
|
-
Show,
|
|
11
|
-
} from "react-admin";
|
|
12
|
-
import uniq from "lodash/uniq";
|
|
13
|
-
import sortBy from "lodash/sortBy";
|
|
14
|
-
|
|
15
|
-
import initRAItems from '../ui.jsx'
|
|
16
|
-
import { checkParams, processAdmin, setupAdmin } from '../utils'
|
|
17
|
-
import { BulkActionButton } from '../buttons/ActionButton.jsx'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const defaultPagination = <Pagination rowsPerPageOptions={[10, 25, 50, 100]} />;
|
|
21
|
-
|
|
22
|
-
// Initiliaze a list component
|
|
23
|
-
setupAdmin('list', checkParams((props, res) => {
|
|
24
|
-
let {children, filters, edit, pagination, show, limit, limitMax, actions, ...listProps } = props;
|
|
25
|
-
|
|
26
|
-
children = processAdmin('list-fields', children, res);
|
|
27
|
-
if (edit) children.push(<EditButton key="edit-button" />);
|
|
28
|
-
|
|
29
|
-
pagination = pagination || <Pagination rowsPerPageOptions={sortBy(uniq([10, 25, 50, 100, limit, limitMax]))} />
|
|
30
|
-
|
|
31
|
-
return props => {
|
|
32
|
-
let Filters = (props) => <Filter { ...props } children={ processAdmin('list-filters', filters, res) } />
|
|
33
|
-
let Actions = processAdmin('list-bulkActions', actions);
|
|
34
|
-
|
|
35
|
-
props = { ...props, ...listProps };
|
|
36
|
-
return (
|
|
37
|
-
<List filters={ <Filters /> } bulkActionButtons={ <Actions /> } perPage={ limit } pagination={ pagination || defaultPagination } { ...props }>
|
|
38
|
-
<Datagrid rowClick={ show && "show" } children={ children } />
|
|
39
|
-
</List>
|
|
40
|
-
)
|
|
41
|
-
};
|
|
42
|
-
}));
|
|
43
|
-
|
|
44
|
-
setupAdmin('list-bulkActions', actions => props => {
|
|
45
|
-
let buttons = actions.map((action, idx) => {
|
|
46
|
-
let aProps = { ...action, ...props };
|
|
47
|
-
return <BulkActionButton key={idx} {...aProps} />
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
return <>
|
|
51
|
-
{ buttons }
|
|
52
|
-
<BulkDeleteButton {...props} />
|
|
53
|
-
</>
|
|
54
|
-
});
|
|
55
|
-
setupAdmin('list-filters', initRAItems);
|
|
56
|
-
setupAdmin('list-fields', initRAItems);
|
package/views/show.jsx
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { ListButton, EditButton, Show, SimpleShowLayout, TopToolbar } from "react-admin";
|
|
4
|
-
|
|
5
|
-
import initRAItems from '../ui.jsx'
|
|
6
|
-
import { checkParams, processAdmin, setupAdmin } from '../utils'
|
|
7
|
-
|
|
8
|
-
import { ActionButton } from '../buttons/ActionButton.jsx'
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
// Initiliaze a show component
|
|
12
|
-
setupAdmin('show', checkParams(({actions, fields}, res) => props => {
|
|
13
|
-
|
|
14
|
-
const Actions = ({basePath, data, resource, ...baseProps}) => (
|
|
15
|
-
<TopToolbar>
|
|
16
|
-
{
|
|
17
|
-
actions.map((props, idx) => {
|
|
18
|
-
let aProps = {resource, basePath, record: data, ...baseProps, ...props};
|
|
19
|
-
return <ActionButton key={ idx } {...aProps} />
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
<ListButton basePath={ basePath } />
|
|
23
|
-
<EditButton basePath={basePath} record={data} />
|
|
24
|
-
</TopToolbar>
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<Show actions={ <Actions /> } {...props}>
|
|
29
|
-
<SimpleShowLayout children={ processAdmin('show-fields', fields, res) } />
|
|
30
|
-
</Show>
|
|
31
|
-
)
|
|
32
|
-
}));
|
|
33
|
-
|
|
34
|
-
setupAdmin('show-fields', initRAItems);
|