@applica-software-guru/react-admin 1.3.184 → 1.4.185
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/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/SimpleList.d.ts +2 -2
- package/dist/components/ra-lists/SimpleList.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +62 -78
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +8842 -8964
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +63 -79
- package/dist/react-admin.umd.js.map +1 -1
- package/index.html +5 -0
- package/package.json +5 -5
- package/src/components/ra-lists/Datagrid/Datagrid.tsx +33 -71
- package/vite.config.js +3 -4
package/index.html
CHANGED
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
|
|
9
9
|
<title>React-Admin Demo Application</title>
|
|
10
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
11
|
+
<link
|
|
12
|
+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@400;500;600;700&family=Roboto:wght@400;500;700&display=swap&family=Public+Sans:wght@400;500;600;700"
|
|
13
|
+
rel="stylesheet"
|
|
14
|
+
/>
|
|
10
15
|
</head>
|
|
11
16
|
<body>
|
|
12
17
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applica-software-guru/react-admin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.185",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"dayjs": "^1.11.8",
|
|
59
59
|
"framer-motion": "^10.12.17",
|
|
60
60
|
"history": "^5.1.0",
|
|
61
|
-
"ra-core": "
|
|
62
|
-
"ra-i18n-polyglot": "
|
|
63
|
-
"ra-ui-materialui": "4.
|
|
64
|
-
"react-admin": "4.
|
|
61
|
+
"ra-core": "4.16.16",
|
|
62
|
+
"ra-i18n-polyglot": "4.16.16",
|
|
63
|
+
"ra-ui-materialui": "4.16.16",
|
|
64
|
+
"react-admin": "4.16.16",
|
|
65
65
|
"react-device-detect": "^2.2.3",
|
|
66
66
|
"react-hook-form": "^7.43.9",
|
|
67
67
|
"react-router": "^6.1.0",
|
|
@@ -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',
|
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');
|