@applica-software-guru/react-admin 1.5.234 → 1.5.236
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/.husky/pre-commit +1 -2
- package/dist/components/ra-buttons/CreateInDialogButton.d.ts +28 -28
- package/dist/components/ra-buttons/CreateInDialogButton.d.ts.map +1 -1
- package/dist/components/ra-buttons/EditInDialogButton.d.ts +11 -8
- package/dist/components/ra-buttons/EditInDialogButton.d.ts.map +1 -1
- package/dist/components/ra-inputs/LocalizedTextInput.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +66 -66
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +11129 -10332
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +59 -59
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ra-buttons/CreateInDialogButton.tsx +99 -216
- package/src/components/ra-buttons/EditInDialogButton.tsx +66 -101
- package/src/components/ra-inputs/LocalizedTextInput.tsx +34 -32
- package/src/playground/App.jsx +1 -0
- package/src/playground/components/ra-forms/CategoryForm.jsx +12 -0
- package/src/playground/components/ra-forms/index.jsx +1 -0
- package/src/playground/components/ra-lists/CategoryList.jsx +62 -0
- package/src/playground/components/ra-lists/index.jsx +1 -0
- package/src/playground/entities/category.jsx +26 -0
- package/src/playground/entities/index.jsx +1 -0
- package/src/playground/menu.jsx +10 -3
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { CategoryForm } from '@/playground/components';
|
|
2
|
+
import {
|
|
3
|
+
ActionsMenu,
|
|
4
|
+
CreateInDialogButton,
|
|
5
|
+
Datagrid,
|
|
6
|
+
EditInDialogButton,
|
|
7
|
+
Empty,
|
|
8
|
+
FilterButton,
|
|
9
|
+
List,
|
|
10
|
+
SearchInput,
|
|
11
|
+
SimpleForm,
|
|
12
|
+
TextField,
|
|
13
|
+
TextInput,
|
|
14
|
+
required
|
|
15
|
+
} from '@applica-software-guru/react-admin';
|
|
16
|
+
|
|
17
|
+
function CategoryAddButton() {
|
|
18
|
+
return (
|
|
19
|
+
<CreateInDialogButton maxWidth="sm" redirect="list" size="small" variant="text">
|
|
20
|
+
<CategoryForm />
|
|
21
|
+
</CreateInDialogButton>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function CategorySubmitButton() {
|
|
26
|
+
function handleSubmit(values) {
|
|
27
|
+
console.log(values);
|
|
28
|
+
}
|
|
29
|
+
return (
|
|
30
|
+
<CreateInDialogButton onSubmit={handleSubmit} redirect="list" label="Submit">
|
|
31
|
+
<SimpleForm>
|
|
32
|
+
<TextInput source="description" validate={required()} fullWidth />
|
|
33
|
+
</SimpleForm>
|
|
34
|
+
</CreateInDialogButton>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function CategoryList() {
|
|
39
|
+
return (
|
|
40
|
+
<List
|
|
41
|
+
filters={[<SearchInput key="keyword" source="keyword" alwaysOn />]}
|
|
42
|
+
actions={
|
|
43
|
+
<>
|
|
44
|
+
<FilterButton />
|
|
45
|
+
<ActionsMenu>
|
|
46
|
+
<CategoryAddButton />
|
|
47
|
+
<CategorySubmitButton />
|
|
48
|
+
</ActionsMenu>
|
|
49
|
+
</>
|
|
50
|
+
}
|
|
51
|
+
empty={<Empty actions={<CategoryAddButton />} />}
|
|
52
|
+
>
|
|
53
|
+
<Datagrid>
|
|
54
|
+
<TextField source="description" />
|
|
55
|
+
<EditInDialogButton>
|
|
56
|
+
<CategoryForm />
|
|
57
|
+
</EditInDialogButton>
|
|
58
|
+
</Datagrid>
|
|
59
|
+
</List>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
export { CategoryList };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Create, Edit } from '@/';
|
|
2
|
+
import { CategoryForm, CategoryList } from '@/playground/components';
|
|
3
|
+
|
|
4
|
+
function CategoryCreate() {
|
|
5
|
+
return (
|
|
6
|
+
<Create>
|
|
7
|
+
<CategoryForm />
|
|
8
|
+
</Create>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function CategoryEdit() {
|
|
13
|
+
return (
|
|
14
|
+
<Edit>
|
|
15
|
+
<CategoryForm />
|
|
16
|
+
</Edit>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export const category = {
|
|
20
|
+
list: CategoryList,
|
|
21
|
+
edit: CategoryEdit,
|
|
22
|
+
create: CategoryCreate,
|
|
23
|
+
options: {
|
|
24
|
+
group: 'control-panel'
|
|
25
|
+
}
|
|
26
|
+
};
|
package/src/playground/menu.jsx
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
DashboardOutlined,
|
|
3
|
+
FlagOutlined,
|
|
4
|
+
NotificationOutlined,
|
|
5
|
+
TableOutlined,
|
|
6
|
+
TagOutlined,
|
|
7
|
+
UserOutlined
|
|
8
|
+
} from '@ant-design/icons';
|
|
2
9
|
|
|
3
10
|
export const menu = [
|
|
4
11
|
{
|
|
5
12
|
id: 'dashboard',
|
|
6
|
-
title: 'Dashboard
|
|
13
|
+
title: 'Dashboard',
|
|
7
14
|
type: 'group',
|
|
8
15
|
icon: DashboardOutlined,
|
|
9
16
|
children: [
|
|
@@ -57,7 +64,7 @@ export const menu = [
|
|
|
57
64
|
title: 'ra.menu.item.entities/category',
|
|
58
65
|
type: 'item',
|
|
59
66
|
url: '/entities/category',
|
|
60
|
-
icon:
|
|
67
|
+
icon: TagOutlined
|
|
61
68
|
},
|
|
62
69
|
{
|
|
63
70
|
id: 'entities/user',
|