@applica-software-guru/react-admin 1.3.184 → 1.4.186
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/bitbucket-pipelines.yml +3 -3
- 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/Datagrid.d.ts +1 -1
- package/dist/components/ra-lists/Datagrid/Datagrid.d.ts.map +1 -1
- package/dist/components/ra-lists/List.d.ts.map +1 -1
- package/dist/components/ra-lists/SimpleList.d.ts +2 -2
- package/dist/components/ra-lists/SimpleList.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 -82
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +10378 -10081
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +67 -83
- package/dist/react-admin.umd.js.map +1 -1
- package/index.html +5 -0
- package/package.json +5 -5
- 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/Datagrid.tsx +33 -71
- package/src/components/ra-lists/List.tsx +1 -4
- package/src/hooks/useMemoizedObject.tsx +3 -5
- package/src/playground/types.ts +16 -18
- package/vite.config.js +3 -4
|
@@ -2,10 +2,7 @@ import { DateInputProps, DateInput as RaDateInput } from 'react-admin';
|
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
3
|
import LabeledInput from './LabeledInput';
|
|
4
4
|
|
|
5
|
-
const StyledDateInput = styled(RaDateInput, {
|
|
6
|
-
name: 'RaApplicaDateInput',
|
|
7
|
-
slot: 'root'
|
|
8
|
-
})(({ label }) => ({
|
|
5
|
+
const StyledDateInput = styled(RaDateInput, { slot: 'root' })(({ label }) => ({
|
|
9
6
|
'& legend': {
|
|
10
7
|
width: label === false ? 0 : 'auto'
|
|
11
8
|
}
|
|
@@ -2,10 +2,7 @@ import { DateTimeInputProps, DateTimeInput as RaDateTimeInput } from 'react-admi
|
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
3
|
import LabeledInput from './LabeledInput';
|
|
4
4
|
|
|
5
|
-
const StyledDateInput = styled(RaDateTimeInput, {
|
|
6
|
-
name: 'RaApplicaDateTimeInput',
|
|
7
|
-
slot: 'root'
|
|
8
|
-
})(({ label }) => ({
|
|
5
|
+
const StyledDateInput = styled(RaDateTimeInput, { slot: 'root' })(({ label }) => ({
|
|
9
6
|
'& legend': {
|
|
10
7
|
width: label === false ? 0 : 'auto'
|
|
11
8
|
}
|
|
@@ -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
|
}
|
|
@@ -17,41 +17,41 @@ import BulkActionsToolbar from '../BulkActionsToolbar';
|
|
|
17
17
|
import clsx from 'clsx';
|
|
18
18
|
import DatagridContextProvider from './DatagridContextProvider';
|
|
19
19
|
import difference from 'lodash/difference';
|
|
20
|
-
import PropTypes from 'prop-types';
|
|
21
20
|
import union from 'lodash/union';
|
|
22
21
|
|
|
23
22
|
const defaultBulkActionButtons = <BulkDeleteButton />;
|
|
24
23
|
|
|
25
|
-
export type DatagridProps = RaDatagridProps &
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
24
|
+
export type DatagridProps = RaDatagridProps &
|
|
25
|
+
React.RefAttributes<HTMLTableElement> & {
|
|
26
|
+
/**
|
|
27
|
+
* An alternative to bulkActionButtons, to be used when the actions are too complex to be expressed.
|
|
28
|
+
* In this case you are free to fully control the rendering of the bulk actions toolbar.
|
|
29
|
+
* @see BulkActionsToolbar
|
|
30
|
+
* @example <caption>Using the BulkActionsToolbar component</caption>
|
|
31
|
+
* import { BulkActionsToolbar } from '@applica-software-guru/react-admin';
|
|
32
|
+
* import { BulkDeleteButton } from 'react-admin';
|
|
33
|
+
*
|
|
34
|
+
* const PostBulkActionButtons = props => (
|
|
35
|
+
* <BulkActionsToolbar {...props}>
|
|
36
|
+
* <BulkDeleteButton />
|
|
37
|
+
* // add your custom actions here
|
|
38
|
+
* </BulkActionsToolbar>
|
|
39
|
+
* );
|
|
40
|
+
*
|
|
41
|
+
* @example <caption>Using BulkFloatingActionsToolbar component</caption>
|
|
42
|
+
* import { BulkActionsToolbar } from '@applica-software-guru/react-admin';
|
|
43
|
+
* import { BulkDeleteButton } from 'react-admin';
|
|
44
|
+
*
|
|
45
|
+
* const PostBulkActionButtons = props => (
|
|
46
|
+
* <BulkActionsToolbar {...props}>
|
|
47
|
+
* <BulkDeleteButton />
|
|
48
|
+
* // add your custom actions here
|
|
49
|
+
* </BulkActionsToolbar>
|
|
50
|
+
* );
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
bulkActionsToolbar: React.ReactNode | React.FC | boolean;
|
|
54
|
+
};
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* The Datagrid component renders a list of records as a table.
|
|
@@ -131,7 +131,7 @@ export type DatagridProps = RaDatagridProps & {
|
|
|
131
131
|
* );
|
|
132
132
|
* }
|
|
133
133
|
*/
|
|
134
|
-
export const Datagrid
|
|
134
|
+
export const Datagrid = React.forwardRef((props, ref) => {
|
|
135
135
|
const {
|
|
136
136
|
optimized = false,
|
|
137
137
|
body = optimized ? PureDatagridBody : DatagridBody,
|
|
@@ -156,11 +156,8 @@ export const Datagrid: FC<DatagridProps> = React.forwardRef((props, ref) => {
|
|
|
156
156
|
} = props;
|
|
157
157
|
|
|
158
158
|
const { sort, data, isLoading, onSelect, onToggleItem, selectedIds, setSort, total } = useListContext(props);
|
|
159
|
-
|
|
160
159
|
const hasBulkActions = !!bulkActionButtons !== false;
|
|
161
|
-
|
|
162
160
|
const contextValue = useMemo(() => ({ isRowExpandable, expandSingle }), [isRowExpandable, expandSingle]);
|
|
163
|
-
|
|
164
161
|
const lastSelected = useRef(null);
|
|
165
162
|
|
|
166
163
|
useEffect(() => {
|
|
@@ -278,47 +275,12 @@ export const Datagrid: FC<DatagridProps> = React.forwardRef((props, ref) => {
|
|
|
278
275
|
</DatagridRoot>
|
|
279
276
|
</DatagridContextProvider>
|
|
280
277
|
);
|
|
281
|
-
})
|
|
278
|
+
}) as FC<DatagridProps>;
|
|
282
279
|
|
|
283
280
|
// @ts-ignore
|
|
284
281
|
const createOrCloneElement = (element, props, children) =>
|
|
285
282
|
isValidElement(element) ? cloneElement(element, props, children) : createElement(element, props, children);
|
|
286
283
|
|
|
287
|
-
Datagrid.propTypes = {
|
|
288
|
-
// @ts-ignore
|
|
289
|
-
body: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType]),
|
|
290
|
-
// @ts-ignore-line
|
|
291
|
-
bulkActionButtons: PropTypes.oneOfType([PropTypes.bool, PropTypes.element]),
|
|
292
|
-
children: PropTypes.node.isRequired,
|
|
293
|
-
className: PropTypes.string,
|
|
294
|
-
// @ts-ignore
|
|
295
|
-
sort: PropTypes.exact({
|
|
296
|
-
field: PropTypes.string,
|
|
297
|
-
order: PropTypes.oneOf(['ASC', 'DESC'] as const)
|
|
298
|
-
}),
|
|
299
|
-
data: PropTypes.arrayOf(PropTypes.any),
|
|
300
|
-
empty: PropTypes.element,
|
|
301
|
-
// @ts-ignore
|
|
302
|
-
expand: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType]),
|
|
303
|
-
// @ts-ignore
|
|
304
|
-
header: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType]),
|
|
305
|
-
hover: PropTypes.bool,
|
|
306
|
-
isLoading: PropTypes.bool,
|
|
307
|
-
onSelect: PropTypes.func,
|
|
308
|
-
onToggleItem: PropTypes.func,
|
|
309
|
-
resource: PropTypes.string,
|
|
310
|
-
// @ts-ignore
|
|
311
|
-
rowClick: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.bool]),
|
|
312
|
-
rowSx: PropTypes.func,
|
|
313
|
-
rowStyle: PropTypes.func,
|
|
314
|
-
selectedIds: PropTypes.arrayOf(PropTypes.any),
|
|
315
|
-
setSort: PropTypes.func,
|
|
316
|
-
total: PropTypes.number,
|
|
317
|
-
isRowSelectable: PropTypes.func,
|
|
318
|
-
isRowExpandable: PropTypes.func,
|
|
319
|
-
expandSingle: PropTypes.bool
|
|
320
|
-
};
|
|
321
|
-
|
|
322
284
|
const injectedProps = [
|
|
323
285
|
'isRequired',
|
|
324
286
|
'setFilter',
|
|
@@ -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
|
};
|
package/vite.config.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import * as packageJson from './package.json';
|
|
2
|
-
|
|
3
|
-
import EsLint from 'vite-plugin-linter';
|
|
4
2
|
import { defineConfig } from 'vite';
|
|
5
3
|
import dts from 'vite-plugin-dts';
|
|
6
4
|
import react from '@vitejs/plugin-react';
|
|
7
5
|
import { resolve } from 'node:path';
|
|
8
6
|
import process from 'process';
|
|
9
|
-
|
|
10
|
-
const { EsLinter, linterPlugin } = EsLint;
|
|
7
|
+
// import EsLint from 'vite-plugin-linter';
|
|
8
|
+
// const { EsLinter, linterPlugin } = EsLint;
|
|
9
|
+
import { EsLinter, linterPlugin } from 'vite-plugin-linter';
|
|
11
10
|
|
|
12
11
|
export default defineConfig((configEnv) => {
|
|
13
12
|
const isWatching = process.argv.includes('--watch');
|