@applica-software-guru/react-admin 1.3.133 → 1.3.136
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 +1 -1
- package/build.sh +9 -0
- package/dist/ApplicaAdmin.d.ts.map +1 -1
- package/dist/components/ra-forms/ChangePasswordForm.d.ts.map +1 -1
- package/dist/components/ra-forms/TableForm/TableFormIteratorItem.d.ts.map +1 -1
- package/dist/components/ra-forms/TableForm/index.d.ts +0 -3
- package/dist/components/ra-forms/TableForm/index.d.ts.map +1 -1
- package/dist/components/ra-lists/ListView.d.ts.map +1 -1
- package/dist/{components/ra-forms/TableForm → contexts}/TableFormIteratorContext.d.ts +2 -1
- package/dist/contexts/TableFormIteratorContext.d.ts.map +1 -0
- package/dist/{components/ra-forms/TableForm → contexts}/TableFormIteratorItemContext.d.ts +2 -1
- package/dist/contexts/TableFormIteratorItemContext.d.ts.map +1 -0
- package/dist/contexts/index.d.ts +2 -0
- package/dist/contexts/index.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +3 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/{components/ra-forms/TableForm → hooks}/useTableFormIterator.d.ts +2 -1
- package/dist/hooks/useTableFormIterator.d.ts.map +1 -0
- package/dist/hooks/useTableFormIteratorItem.d.ts +9 -0
- package/dist/hooks/useTableFormIteratorItem.d.ts.map +1 -0
- package/dist/react-admin.cjs.js +49 -49
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +2753 -2745
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +54 -54
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +3 -3
- package/src/ApplicaAdmin.tsx +3 -1
- package/src/components/ra-forms/ChangePasswordForm.tsx +3 -1
- package/src/components/ra-forms/TableForm/TableFormIterator.tsx +1 -1
- package/src/components/ra-forms/TableForm/TableFormIteratorItem.tsx +3 -3
- package/src/components/ra-forms/TableForm/index.ts +0 -3
- package/src/components/ra-lists/ListView.tsx +1 -2
- package/src/{components/ra-forms/TableForm → contexts}/TableFormIteratorContext.ts +3 -1
- package/src/{components/ra-forms/TableForm → contexts}/TableFormIteratorItemContext.ts +3 -1
- package/src/contexts/index.jsx +2 -0
- package/src/hooks/index.jsx +13 -1
- package/src/{components/ra-forms/TableForm → hooks}/useTableFormIterator.ts +4 -2
- package/src/hooks/useTableFormIteratorItem.ts +12 -0
- package/dist/components/ra-forms/TableForm/TableFormIteratorContext.d.ts.map +0 -1
- package/dist/components/ra-forms/TableForm/TableFormIteratorItemContext.d.ts.map +0 -1
- package/dist/components/ra-forms/TableForm/useTableFormIterator.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applica-software-guru/react-admin",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.136",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"simplebar-react": "3.2.4"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@applica-software-guru/crud-client": "1.1
|
|
75
|
-
"@applica-software-guru/iam-client": "1.1
|
|
74
|
+
"@applica-software-guru/crud-client": "^1.1",
|
|
75
|
+
"@applica-software-guru/iam-client": "^1.1",
|
|
76
76
|
"@testing-library/jest-dom": "^5.16.5",
|
|
77
77
|
"@testing-library/react": "^14.0.0",
|
|
78
78
|
"@types/node": "^18.7.6",
|
package/src/ApplicaAdmin.tsx
CHANGED
|
@@ -170,7 +170,9 @@ const ApplicaAdmin = ({
|
|
|
170
170
|
'Invalid prop `file` of type `string` supplied to `FileInputPreview`, expected `object`.',
|
|
171
171
|
'Failed prop type: Invalid prop `checked` of type `string` supplied to `ForwardRef(Switch)`, expected `boolean`.',
|
|
172
172
|
'Failed prop type: Invalid prop `checked` of type `string` supplied to `ForwardRef(SwitchBase)`, expected `boolean`.',
|
|
173
|
-
'validateDOMNesting(...): <form> cannot appear as a descendant of <form>.'
|
|
173
|
+
'validateDOMNesting(...): <form> cannot appear as a descendant of <form>.',
|
|
174
|
+
'Missing translation for key:',
|
|
175
|
+
'HttpError: '
|
|
174
176
|
];
|
|
175
177
|
const isKnowBug = knownErrors.some((knownError) => errorMessage?.includes(knownError));
|
|
176
178
|
const result = new CatchResult({
|
|
@@ -28,7 +28,9 @@ const ChangePasswordForm = ({ onSuccess, firstAccess }: ChangePasswordFormProps)
|
|
|
28
28
|
notify('ra.auth.password_changed');
|
|
29
29
|
onSuccess();
|
|
30
30
|
})
|
|
31
|
-
.catch((error:
|
|
31
|
+
.catch((error: any) => {
|
|
32
|
+
notify(error?.message || error?.toString(), { type: 'error' });
|
|
33
|
+
})
|
|
32
34
|
.finally(() => setSaving(false));
|
|
33
35
|
},
|
|
34
36
|
[authProvider, onSuccess]
|
|
@@ -20,7 +20,7 @@ import { styled, useTheme } from '@mui/material/styles';
|
|
|
20
20
|
|
|
21
21
|
import { PlusCircleOutlined } from '@ant-design/icons';
|
|
22
22
|
import PropTypes from 'prop-types';
|
|
23
|
-
import { TableFormIteratorContext } from '
|
|
23
|
+
import { TableFormIteratorContext } from '../../../contexts';
|
|
24
24
|
import { TableFormIteratorItem } from './TableFormIteratorItem';
|
|
25
25
|
import { UseFieldArrayReturn, useFormContext } from 'react-hook-form';
|
|
26
26
|
import get from 'lodash/get';
|
|
@@ -3,11 +3,11 @@ import * as React from 'react';
|
|
|
3
3
|
import { Children, ReactElement, ReactNode, cloneElement, isValidElement, useMemo } from 'react';
|
|
4
4
|
import { Confirm, useTranslate } from 'react-admin';
|
|
5
5
|
import { TableCell, Typography } from '@mui/material';
|
|
6
|
-
import { TableFormIteratorItemContext, TableFormIteratorItemContextValue } from '
|
|
7
|
-
|
|
6
|
+
import { TableFormIteratorItemContext, TableFormIteratorItemContextValue } from '../../../contexts';
|
|
8
7
|
import ActionsMenu from '../../ActionsMenu';
|
|
9
8
|
import { RaRecord } from 'ra-core';
|
|
10
|
-
import { useTableFormIterator } from '
|
|
9
|
+
import { useTableFormIterator } from '../../../hooks';
|
|
10
|
+
|
|
11
11
|
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
13
|
export const TableFormIteratorItem = React.forwardRef((props: TableFormIteratorItemProps, ref: any) => {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import TableFormIterator from './TableFormIterator';
|
|
2
|
-
export * from './TableFormIteratorContext';
|
|
3
2
|
export * from './TableFormIteratorItem';
|
|
4
|
-
export * from './TableFormIteratorItemContext';
|
|
5
|
-
export * from './useTableFormIterator';
|
|
6
3
|
|
|
7
4
|
export default TableFormIterator;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
3
|
import { cloneElement, ReactElement, ReactNode, ElementType } from 'react';
|
|
4
|
-
import { Title, TitlePropType, Pagination as DefaultPagination, ListToolbar, ListActions as DefaultActions } from 'react-admin';
|
|
4
|
+
import { Title, TitlePropType, Pagination as DefaultPagination, ListToolbar, ListActions as DefaultActions, Empty } from 'react-admin';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { SxProps } from '@mui/system';
|
|
7
7
|
import Card from '@mui/material/Card';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import { ComponentPropType, useListContext, RaRecord } from 'ra-core';
|
|
10
10
|
|
|
11
|
-
import Empty from './Empty';
|
|
12
11
|
import Error from '../Layout/Error';
|
|
13
12
|
|
|
14
13
|
const defaultActions = <DefaultActions />;
|
|
@@ -8,7 +8,7 @@ import { createContext } from 'react';
|
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
10
|
// @ts-ignore
|
|
11
|
-
|
|
11
|
+
const TableFormIteratorContext = createContext<TableFormIteratorContextValue>(undefined);
|
|
12
12
|
|
|
13
13
|
export type TableFormIteratorContextValue = {
|
|
14
14
|
add: () => void;
|
|
@@ -17,3 +17,5 @@ export type TableFormIteratorContextValue = {
|
|
|
17
17
|
source: string;
|
|
18
18
|
total: number;
|
|
19
19
|
};
|
|
20
|
+
|
|
21
|
+
export { TableFormIteratorContext };
|
|
@@ -7,7 +7,7 @@ import { createContext } from 'react';
|
|
|
7
7
|
* @see {ArrayInput}
|
|
8
8
|
*/
|
|
9
9
|
// @ts-ignore
|
|
10
|
-
|
|
10
|
+
const TableFormIteratorItemContext = createContext<TableFormIteratorItemContextValue>(undefined);
|
|
11
11
|
|
|
12
12
|
export type TableFormIteratorItemContextValue = {
|
|
13
13
|
index: number;
|
|
@@ -15,3 +15,5 @@ export type TableFormIteratorItemContextValue = {
|
|
|
15
15
|
remove: () => void;
|
|
16
16
|
reOrder: (newIndex: number) => void;
|
|
17
17
|
};
|
|
18
|
+
|
|
19
|
+
export { TableFormIteratorItemContext };
|
package/src/contexts/index.jsx
CHANGED
package/src/hooks/index.jsx
CHANGED
|
@@ -5,7 +5,19 @@ import useMenu from './useMenu';
|
|
|
5
5
|
import useMenuConfig from './useMenuConfig';
|
|
6
6
|
import useResourceTitle from './useResourceTitle';
|
|
7
7
|
import useThemeConfig from './useThemeConfig';
|
|
8
|
-
|
|
8
|
+
import useTableFormIterator from './useTableFormIterator';
|
|
9
|
+
import useTableFormIteratorItem from './useTableFormIteratorItem';
|
|
10
|
+
export {
|
|
11
|
+
useAppConfig,
|
|
12
|
+
useMenu,
|
|
13
|
+
useBreadcrumbs,
|
|
14
|
+
useLocalStorage,
|
|
15
|
+
useThemeConfig,
|
|
16
|
+
useResourceTitle,
|
|
17
|
+
useMenuConfig,
|
|
18
|
+
useTableFormIterator,
|
|
19
|
+
useTableFormIteratorItem
|
|
20
|
+
};
|
|
9
21
|
export { useSx } from './mui';
|
|
10
22
|
export { useRefDimensions } from './useRefDimensions';
|
|
11
23
|
export { useMemoizedObject } from './useMemoizedObject';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import { TableFormIteratorContext } from '
|
|
2
|
+
import { TableFormIteratorContext } from '../contexts';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A hook that provides access to a TableFormIterator data (the total number of items) and mutators (add, reorder and remove).
|
|
@@ -7,4 +7,6 @@ import { TableFormIteratorContext } from './TableFormIteratorContext';
|
|
|
7
7
|
* @see {TableFormIterator}
|
|
8
8
|
* @see {ArrayInput}
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
const useTableFormIterator = () => useContext(TableFormIteratorContext);
|
|
11
|
+
|
|
12
|
+
export default useTableFormIterator;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { TableFormIteratorItemContext } from '../contexts';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A hook that provides access to a TableFormIterator item meta (its index and the total number of items) and mutators (reorder and remove this remove).
|
|
6
|
+
* Useful to create custom array input iterators.
|
|
7
|
+
* @see {TableFormIterator}
|
|
8
|
+
* @see {ArrayInput}
|
|
9
|
+
*/
|
|
10
|
+
const useTableFormIteratorItem = () => useContext(TableFormIteratorItemContext);
|
|
11
|
+
|
|
12
|
+
export default useTableFormIteratorItem;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableFormIteratorContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/ra-forms/TableForm/TableFormIteratorContext.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG;AAEH,eAAO,MAAM,wBAAwB,wDAA0D,CAAC;AAEhG,MAAM,MAAM,6BAA6B,GAAG;IAC1C,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableFormIteratorItemContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/ra-forms/TableForm/TableFormIteratorItemContext.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,eAAO,MAAM,4BAA4B,4DAA8D,CAAC;AAExG,MAAM,MAAM,iCAAiC,GAAG;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTableFormIterator.d.ts","sourceRoot":"","sources":["../../../../../src/components/ra-forms/TableForm/useTableFormIterator.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,0EAA6C,CAAC"}
|