@applica-software-guru/react-admin 1.4.185 → 1.4.187
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/ActionsMenu.d.ts +3 -16
- package/dist/components/ActionsMenu.d.ts.map +1 -1
- package/dist/components/MenuPopover/MenuPopover.d.ts.map +1 -1
- package/dist/components/ra-buttons/CreateInDialogButton.d.ts.map +1 -1
- package/dist/components/ra-custom/ListItem.d.ts +3 -6
- package/dist/components/ra-custom/ListItem.d.ts.map +1 -1
- package/dist/components/ra-fields/BaseAttachmentField.d.ts.map +1 -1
- package/dist/components/ra-fields/DateField.d.ts.map +1 -1
- package/dist/components/ra-fields/EmailField.d.ts.map +1 -1
- package/dist/components/ra-fields/FileField.d.ts.map +1 -1
- package/dist/components/ra-fields/ImageField.d.ts.map +1 -1
- package/dist/components/ra-fields/ReferenceManyField.d.ts +0 -3
- package/dist/components/ra-fields/ReferenceManyField.d.ts.map +1 -1
- package/dist/components/ra-fields/TextField.d.ts.map +1 -1
- package/dist/components/ra-forms/CardForm.d.ts.map +1 -1
- package/dist/components/ra-forms/Create.d.ts.map +1 -1
- package/dist/components/ra-forms/Edit.d.ts +2 -24
- package/dist/components/ra-forms/Edit.d.ts.map +1 -1
- package/dist/components/ra-forms/Show.d.ts +2 -1
- package/dist/components/ra-forms/Show.d.ts.map +1 -1
- package/dist/components/ra-forms/SimpleForm.d.ts.map +1 -1
- package/dist/components/ra-forms/SimpleFormIterator.d.ts +1 -1
- package/dist/components/ra-forms/SimpleFormIterator.d.ts.map +1 -1
- package/dist/components/ra-forms/TabbedForm.d.ts.map +1 -1
- package/dist/components/ra-forms/TableForm/TableFormIterator.d.ts +0 -3
- package/dist/components/ra-forms/TableForm/TableFormIterator.d.ts.map +1 -1
- package/dist/components/ra-forms/Toolbar.d.ts.map +1 -1
- package/dist/components/ra-forms/index.d.ts +1 -0
- package/dist/components/ra-forms/index.d.ts.map +1 -1
- package/dist/components/ra-inputs/ArrayInput.d.ts +2 -5
- package/dist/components/ra-inputs/ArrayInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/AttachmentInput.d.ts +0 -3
- package/dist/components/ra-inputs/AttachmentInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/BooleanInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/DateInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/DateTimeInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/FileInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/NumberInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/SearchInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/SelectArrayInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/SelectInput.d.ts.map +1 -1
- package/dist/components/ra-inputs/TimeInput.d.ts.map +1 -1
- package/dist/components/ra-lists/Datagrid/index.d.ts.map +1 -1
- package/dist/components/ra-lists/List.d.ts.map +1 -1
- package/dist/hooks/useMemoizedObject.d.ts +3 -5
- package/dist/hooks/useMemoizedObject.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 +10346 -9930
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +67 -67
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ActionsMenu.tsx +17 -19
- package/src/components/MenuPopover/MenuPopover.jsx +1 -0
- package/src/components/ra-buttons/CreateInDialogButton.tsx +6 -14
- package/src/components/ra-buttons/EditInDialogButton.tsx +1 -1
- package/src/components/ra-custom/ListItem.tsx +3 -6
- package/src/components/ra-fields/BaseAttachmentField.tsx +1 -6
- package/src/components/ra-fields/DateField.tsx +1 -4
- package/src/components/ra-fields/EmailField.tsx +1 -4
- package/src/components/ra-fields/FileField.tsx +1 -4
- package/src/components/ra-fields/ImageField.tsx +1 -4
- package/src/components/ra-fields/ReferenceManyField.tsx +1 -7
- package/src/components/ra-fields/TextField.tsx +1 -4
- package/src/components/ra-forms/CardForm.tsx +1 -4
- package/src/components/ra-forms/Create.tsx +2 -5
- package/src/components/ra-forms/Edit.tsx +8 -6
- package/src/components/ra-forms/LongForm/BaseForm.tsx +2 -2
- package/src/components/ra-forms/Show.tsx +18 -19
- package/src/components/ra-forms/SimpleForm.tsx +2 -5
- package/src/components/ra-forms/SimpleFormIterator.tsx +24 -26
- package/src/components/ra-forms/TabbedForm.tsx +1 -4
- package/src/components/ra-forms/TableForm/TableFormIterator.tsx +1 -7
- package/src/components/ra-forms/Toolbar.tsx +1 -4
- package/src/components/ra-forms/index.ts +1 -0
- package/src/components/ra-inputs/ArrayInput.tsx +3 -9
- package/src/components/ra-inputs/AttachmentInput.tsx +1 -7
- package/src/components/ra-inputs/BooleanInput.tsx +1 -4
- package/src/components/ra-inputs/DateInput.tsx +1 -4
- package/src/components/ra-inputs/DateTimeInput.tsx +1 -4
- package/src/components/ra-inputs/FileInput.tsx +1 -4
- package/src/components/ra-inputs/NumberInput.tsx +1 -4
- package/src/components/ra-inputs/SearchInput.tsx +1 -4
- package/src/components/ra-inputs/SelectArrayInput.tsx +1 -4
- package/src/components/ra-inputs/SelectInput.tsx +2 -5
- package/src/components/ra-inputs/TimeInput.tsx +1 -4
- package/src/components/ra-lists/Datagrid/index.tsx +1 -4
- package/src/components/ra-lists/List.tsx +1 -4
- package/src/hooks/useMemoizedObject.tsx +3 -5
- package/src/playground/types.ts +16 -18
|
@@ -6,10 +6,7 @@ import { useWatch } from 'react-hook-form';
|
|
|
6
6
|
import LabeledInput from './LabeledInput';
|
|
7
7
|
import React, { useMemo } from 'react';
|
|
8
8
|
|
|
9
|
-
const StyledFileInput = styled(RaFileInput, {
|
|
10
|
-
name: 'RaApplicaFileInput',
|
|
11
|
-
slot: 'root'
|
|
12
|
-
})(({ theme }) => ({
|
|
9
|
+
const StyledFileInput = styled(RaFileInput, { slot: 'root' })(({ theme }) => ({
|
|
13
10
|
'& .previews': {},
|
|
14
11
|
'& .previews>div': {
|
|
15
12
|
marginTop: theme.spacing(1),
|
|
@@ -2,10 +2,7 @@ import { NumberInputProps, NumberInput as RaNumberInput } from 'react-admin';
|
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
3
|
import LabeledInput from './LabeledInput';
|
|
4
4
|
|
|
5
|
-
const StyledNumberInput = styled(RaNumberInput, {
|
|
6
|
-
name: 'RaApplicaNumberInput',
|
|
7
|
-
slot: 'root'
|
|
8
|
-
})(({ label }) => ({
|
|
5
|
+
const StyledNumberInput = styled(RaNumberInput, { slot: 'root' })(({ label }) => ({
|
|
9
6
|
'& legend': {
|
|
10
7
|
width: label === false ? 0 : 'auto'
|
|
11
8
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { SearchInput as RaSearchInput, SearchInputProps } from 'react-admin';
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
3
|
|
|
4
|
-
const StyledSearchInput = styled(RaSearchInput, {
|
|
5
|
-
name: 'RaApplicaSearchInput',
|
|
6
|
-
slot: 'root'
|
|
7
|
-
})(() => ({}));
|
|
4
|
+
const StyledSearchInput = styled(RaSearchInput, { slot: 'root' })(() => ({}));
|
|
8
5
|
|
|
9
6
|
export function SearchInput(props: SearchInputProps): JSX.Element {
|
|
10
7
|
return <StyledSearchInput {...props} />;
|
|
@@ -2,10 +2,7 @@ import { SelectArrayInput as RaSelectArrayInput, SelectArrayInputProps } from 'r
|
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
3
|
import LabeledInput from './LabeledInput';
|
|
4
4
|
|
|
5
|
-
const StyledSelectArrayInput = styled(RaSelectArrayInput, {
|
|
6
|
-
name: 'RaApplicaSelectArrayInput',
|
|
7
|
-
slot: 'Root'
|
|
8
|
-
})(({ label }) => ({
|
|
5
|
+
const StyledSelectArrayInput = styled(RaSelectArrayInput, { slot: 'Root' })(({ label }) => ({
|
|
9
6
|
'& legend': {
|
|
10
7
|
width: label === false ? 0 : 'auto'
|
|
11
8
|
},
|
|
@@ -2,10 +2,7 @@ import { SelectInput as RaSelectInput, SelectInputProps as RaSelectInputProps }
|
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
3
|
import LabeledInput, { LabeledInputProps } from './LabeledInput';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
name: 'RaApplicaSelectArrayInput',
|
|
7
|
-
slot: 'Root'
|
|
8
|
-
})(({ label }) => ({
|
|
5
|
+
const StyledSelectInput = styled(RaSelectInput, { slot: 'Root' })(({ label }) => ({
|
|
9
6
|
'& legend': {
|
|
10
7
|
width: label === false || label === null ? 0 : 'auto'
|
|
11
8
|
}
|
|
@@ -14,7 +11,7 @@ export type SelectInputProps = LabeledInputProps & RaSelectInputProps;
|
|
|
14
11
|
export function SelectInput(props: SelectInputProps): JSX.Element {
|
|
15
12
|
return (
|
|
16
13
|
<LabeledInput {...props}>
|
|
17
|
-
<
|
|
14
|
+
<StyledSelectInput />
|
|
18
15
|
</LabeledInput>
|
|
19
16
|
);
|
|
20
17
|
}
|
|
@@ -17,10 +17,7 @@ function defaultParser(v: string): string {
|
|
|
17
17
|
return v;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const StyledTimeInput = styled(RaTimeInput, {
|
|
21
|
-
name: 'RaApplicaTimeInput',
|
|
22
|
-
slot: 'root'
|
|
23
|
-
})(({ label }) => ({
|
|
20
|
+
const StyledTimeInput = styled(RaTimeInput, { slot: 'root' })(({ label }) => ({
|
|
24
21
|
'& legend': {
|
|
25
22
|
width: label === false ? 0 : 'auto'
|
|
26
23
|
}
|
|
@@ -2,10 +2,7 @@ import { Datagrid as RaDatagrid } from './Datagrid';
|
|
|
2
2
|
import { DatagridProps } from 'react-admin';
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
|
|
5
|
-
const StyledDatagrid = styled(RaDatagrid, {
|
|
6
|
-
name: 'ApplicaDatagrid',
|
|
7
|
-
slot: 'root'
|
|
8
|
-
})(({ theme }) => ({
|
|
5
|
+
const StyledDatagrid = styled(RaDatagrid, { slot: 'root' })(({ theme }) => ({
|
|
9
6
|
'& .RaBulkActionsToolbar-toolbar': {
|
|
10
7
|
height: 48
|
|
11
8
|
},
|
|
@@ -88,10 +88,7 @@ const RaList = <RecordType extends RaRecord = any>({
|
|
|
88
88
|
|
|
89
89
|
const defaultFilter = {};
|
|
90
90
|
|
|
91
|
-
const StyledList = styled(RaList, {
|
|
92
|
-
name: 'RaApplicaList',
|
|
93
|
-
slot: 'root'
|
|
94
|
-
})(({ theme }) => ({
|
|
91
|
+
const StyledList = styled(RaList, { slot: 'root' })(({ theme }) => ({
|
|
95
92
|
'& .RaList-main': {
|
|
96
93
|
overflowX: 'auto',
|
|
97
94
|
'& .RaBulkActionsToolbar-toolbar': {
|
|
@@ -2,11 +2,9 @@ import _ from 'lodash';
|
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @param object
|
|
9
|
-
* @returns
|
|
5
|
+
* This hook automatically memoizes an object using its value's equality check as a discrimination criterion.
|
|
6
|
+
* PLEASE NOTE!!! The equality check of a JS object is an extremely complex issue.
|
|
7
|
+
* Therefore, this hook should be used with extreme caution, only when strictly necessary and only if you fully master the topic above and its implications in the conditional rendering logic of React
|
|
10
8
|
*/
|
|
11
9
|
function useMemoizedObject<T extends object>(object: T): T {
|
|
12
10
|
if (!_.isPlainObject(object)) {
|
package/src/playground/types.ts
CHANGED
|
@@ -46,17 +46,15 @@ export type ApplicaDataProviderConfig = {
|
|
|
46
46
|
|
|
47
47
|
export type ApplicaDataProviderInterface = DataProvider & {
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Allows you to get the REST service URL.
|
|
50
50
|
*/
|
|
51
51
|
getApiUrl(): string;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
53
|
+
* Allows you to retrieve a single file from the server using any mechanisms
|
|
54
|
+
* authentication associated with the dataProvider (e.g. JWT passed through getHeaders).
|
|
55
55
|
*
|
|
56
|
-
* @param
|
|
57
|
-
* @
|
|
58
|
-
*
|
|
59
|
-
* @example Simulazione del download di un file.
|
|
56
|
+
* @param resource Resource to request
|
|
57
|
+
* @example Simple download of a file
|
|
60
58
|
* const attachment = await dataProvider.getFile(`/attachments/post/1/picture/1}`);
|
|
61
59
|
* const link = document.createElement('a');
|
|
62
60
|
* link.href = attachment;
|
|
@@ -66,29 +64,29 @@ export type ApplicaDataProviderInterface = DataProvider & {
|
|
|
66
64
|
*/
|
|
67
65
|
getFile(resource: string): Promise<string>;
|
|
68
66
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* Response code
|
|
67
|
+
* Allows you to make a generic GET call to the REST service.
|
|
68
|
+
* The service response must contain at least 'responseCode' as expected by the applica standard.
|
|
69
|
+
* Response code must be equal to 'ok' if the call was successful.
|
|
72
70
|
*
|
|
73
71
|
* @example
|
|
74
|
-
* //
|
|
72
|
+
* // Example: users?name=Roberto
|
|
75
73
|
* const data = await dataProvider.get("users", { name: "Roberto" })
|
|
76
74
|
*
|
|
77
75
|
*
|
|
78
|
-
* @param resource
|
|
79
|
-
* @param params
|
|
76
|
+
* @param resource Resource to request
|
|
77
|
+
* @param params Query string parameters to insert
|
|
80
78
|
*/
|
|
81
79
|
get(resource: string, params: any): Promise<any>;
|
|
82
80
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* Response code
|
|
81
|
+
* Allows you to make a generic POST call to the REST service.
|
|
82
|
+
* The service response must contain at least 'responseCode' as expected by the applica standard.
|
|
83
|
+
* Response code must be equal to 'ok' if the call was successful.
|
|
86
84
|
*
|
|
87
85
|
* @example
|
|
88
86
|
* const data = await dataProvider.post("users", { name: "Roberto" })
|
|
89
87
|
*
|
|
90
|
-
* @param resource
|
|
91
|
-
* @param params
|
|
88
|
+
* @param resource Resource to request
|
|
89
|
+
* @param params Query string parameters to insert
|
|
92
90
|
*/
|
|
93
91
|
post(resource: string, params: any): Promise<any>;
|
|
94
92
|
};
|