@applica-software-guru/react-admin 1.5.350 → 1.5.352
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/components/ra-inputs/ImageAttachmentInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/ReferenceLookupInput/ReferenceLookupInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/ReferenceLookupInput/ReferenceManyLookupInput.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +10 -10
- package/dist/react-admin.cjs.js.gz +0 -0
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +4 -4
- package/dist/react-admin.es.js.gz +0 -0
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +17 -17
- package/dist/react-admin.umd.js.gz +0 -0
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ra-inputs/ImageAttachmentInput.tsx +3 -1
- package/src/components/ra-inputs/ReferenceLookupInput/ReferenceLookupInput.tsx +6 -4
- package/src/components/ra-inputs/ReferenceLookupInput/ReferenceManyLookupInput.tsx +6 -4
- package/src/playground/App.jsx +4 -5
- package/src/playground/components/ra-forms/index.jsx +0 -1
- package/src/playground/components/ra-lists/index.jsx +0 -1
- package/src/playground/entities/index.jsx +0 -1
- package/src/playground/entities/user.jsx +2 -2
- package/src/playground/menu.jsx +0 -7
- package/src/playground/components/ra-forms/TempForm.jsx +0 -26
- package/src/playground/components/ra-lists/TempList.jsx +0 -13
- package/src/playground/entities/temp.jsx +0 -25
package/package.json
CHANGED
|
@@ -9,7 +9,9 @@ type ImageAttachmentInputProps = Omit<AttachmentInputProps, 'children'>;
|
|
|
9
9
|
|
|
10
10
|
function ImageAttachmentInput(props: ImageAttachmentInputProps) {
|
|
11
11
|
const { source } = props;
|
|
12
|
-
const
|
|
12
|
+
const record = useRecordContext(props);
|
|
13
|
+
const { id: entityId } = record ?? {};
|
|
14
|
+
|
|
13
15
|
return (
|
|
14
16
|
<AttachmentInput {...props}>
|
|
15
17
|
<Field entityId={String(entityId)} source={source} />
|
|
@@ -33,10 +33,12 @@ function ReferenceLookupInput(props: ReferenceLookupInputProps): JSX.Element {
|
|
|
33
33
|
const { open, handleOpen, handleClose } = useDialogState(false);
|
|
34
34
|
const filter = useMemo(
|
|
35
35
|
() =>
|
|
36
|
-
_.
|
|
37
|
-
.
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
!_.isEmpty(value)
|
|
37
|
+
? _.chain(propFilter ?? {})
|
|
38
|
+
.clone()
|
|
39
|
+
.extend({ id__ne: value })
|
|
40
|
+
.value()
|
|
41
|
+
: propFilter,
|
|
40
42
|
[propFilter, value]
|
|
41
43
|
);
|
|
42
44
|
const filters = useMemo(
|
|
@@ -33,10 +33,12 @@ function ReferenceManyLookupInput(props: ReferenceManyLookupInputProps): JSX.Ele
|
|
|
33
33
|
const { open, handleOpen, handleClose } = useDialogState(false);
|
|
34
34
|
const filter = useMemo(
|
|
35
35
|
() =>
|
|
36
|
-
_.
|
|
37
|
-
.
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
!_.isEmpty(value)
|
|
37
|
+
? _.chain(propFilter ?? {})
|
|
38
|
+
.clone()
|
|
39
|
+
.extend({ id__nin: value })
|
|
40
|
+
.value()
|
|
41
|
+
: propFilter,
|
|
40
42
|
[propFilter, value]
|
|
41
43
|
);
|
|
42
44
|
const filters = useMemo(
|
package/src/playground/App.jsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import * as entities from './entities';
|
|
2
|
+
import { menu } from './menu';
|
|
3
|
+
import { theme } from './theme';
|
|
1
4
|
import { ActivatePage, ApplicaAdmin, HttpError, RecoverPage, RegisterPage, Resource } from '@/';
|
|
2
|
-
import { createI18nProvider, createJsonI18nProvider } from '@/i18n';
|
|
3
5
|
import build from '@/playground/build.json';
|
|
4
6
|
import { CustomPage, TestWizardForm } from '@/playground/components';
|
|
5
7
|
import { API_URL, APP_NAME } from '@/playground/config';
|
|
@@ -7,9 +9,7 @@ import { ApplicaDataProvider, createAttachmentsParser } from '@applica-software-
|
|
|
7
9
|
import { ApplicaAuthProvider, LocalStorage } from '@applica-software-guru/iam-client';
|
|
8
10
|
import { CustomRoutes } from 'ra-core';
|
|
9
11
|
import { Route } from 'react-router-dom';
|
|
10
|
-
import
|
|
11
|
-
import { menu } from './menu';
|
|
12
|
-
import { theme } from './theme';
|
|
12
|
+
import { createI18nProvider, createJsonI18nProvider } from '@/i18n';
|
|
13
13
|
|
|
14
14
|
const authProvider = new ApplicaAuthProvider(API_URL, new LocalStorage());
|
|
15
15
|
const dataProvider = new ApplicaDataProvider({
|
|
@@ -65,7 +65,6 @@ function App() {
|
|
|
65
65
|
<Resource name="entities/i18n-message" {...entities.i18nMessage} />
|
|
66
66
|
<Resource name="entities/device" {...entities.device} />
|
|
67
67
|
<Resource name="entities/category" {...entities.category} />
|
|
68
|
-
<Resource name="entities/temp" {...entities.temp} />
|
|
69
68
|
<CustomRoutes noLayout>
|
|
70
69
|
<Route path="/register" element={<RegisterPage name={APP_NAME} copy="Test" version={build.version} />} />
|
|
71
70
|
<Route path="/recover" element={<RecoverPage name={APP_NAME} copy="Test" version={build.version} />} />
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UserForm, UserList } from '@/playground/components';
|
|
2
2
|
import { ROLES } from '@/playground/config';
|
|
3
|
+
import { UserOutlined } from '@ant-design/icons';
|
|
3
4
|
import { Create, Edit } from '@applica-software-guru/react-admin';
|
|
4
5
|
|
|
5
6
|
function UserCreate() {
|
|
@@ -22,6 +23,5 @@ export const user = {
|
|
|
22
23
|
create: UserCreate,
|
|
23
24
|
options: {
|
|
24
25
|
group: 'control-panel'
|
|
25
|
-
}
|
|
26
|
-
recordRepresentation: (record) => record?.name ?? record?.mail ?? record?.id
|
|
26
|
+
}
|
|
27
27
|
};
|
package/src/playground/menu.jsx
CHANGED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ReferenceLookupInput, ReferenceManyLookupInput, TextField } from '@/components';
|
|
2
|
-
import { TextInput, useThemeConfig } from '@applica-software-guru/react-admin';
|
|
3
|
-
import { Grid } from '@mui/material';
|
|
4
|
-
import { useRecordContext } from 'ra-core';
|
|
5
|
-
import { SimpleForm } from 'ra-ui-materialui';
|
|
6
|
-
|
|
7
|
-
function TempForm({ roles }) {
|
|
8
|
-
const { spacing } = useThemeConfig();
|
|
9
|
-
const record = useRecordContext();
|
|
10
|
-
return (
|
|
11
|
-
<SimpleForm defaultValues={{ active: true }}>
|
|
12
|
-
<Grid container spacing={spacing}>
|
|
13
|
-
<Grid item lg={6} xs={12}>
|
|
14
|
-
<TextInput fullWidth source="description" />
|
|
15
|
-
<ReferenceLookupInput fullWidth source="userId" reference="entities/user" />
|
|
16
|
-
<ReferenceManyLookupInput fullWidth source="userIds" reference="entities/user">
|
|
17
|
-
<TextField source="name" />
|
|
18
|
-
<TextField source="email" />
|
|
19
|
-
</ReferenceManyLookupInput>
|
|
20
|
-
</Grid>
|
|
21
|
-
</Grid>
|
|
22
|
-
</SimpleForm>
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { TempForm };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Datagrid, List, SearchInput, TextField } from '@applica-software-guru/react-admin';
|
|
2
|
-
|
|
3
|
-
function TempList() {
|
|
4
|
-
return (
|
|
5
|
-
<List perPage={25} filters={[<SearchInput key="keyword" source="keyword" alwaysOn fullWidth />]}>
|
|
6
|
-
<Datagrid rowClick="edit">
|
|
7
|
-
<TextField source="description" />
|
|
8
|
-
</Datagrid>
|
|
9
|
-
</List>
|
|
10
|
-
);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { TempList };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { TempForm, TempList } from '@/playground/components';
|
|
2
|
-
import { Create, Edit } from '@applica-software-guru/react-admin';
|
|
3
|
-
|
|
4
|
-
function TempCreate() {
|
|
5
|
-
return (
|
|
6
|
-
<Create>
|
|
7
|
-
<TempForm />
|
|
8
|
-
</Create>
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
function TempEdit() {
|
|
12
|
-
return (
|
|
13
|
-
<Edit mutationMode="pessimistic">
|
|
14
|
-
<TempForm />
|
|
15
|
-
</Edit>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
export const temp = {
|
|
19
|
-
list: <TempList />,
|
|
20
|
-
edit: TempEdit,
|
|
21
|
-
create: TempCreate,
|
|
22
|
-
options: {
|
|
23
|
-
group: 'control-panel'
|
|
24
|
-
}
|
|
25
|
-
};
|