@applica-software-guru/react-admin 1.3.183 → 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/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.183",
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": "^4.14.5",
62
- "ra-i18n-polyglot": "^4.14.1",
63
- "ra-ui-materialui": "4.14.5",
64
- "react-admin": "4.14.5",
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",
@@ -185,6 +185,7 @@ export function ApplicaAdmin({
185
185
  'Invalid prop `file` of type `string` supplied to `FileInputPreview`, expected `object`.',
186
186
  'Failed prop type: Invalid prop `checked` of type `string` supplied to `ForwardRef(Switch)`, expected `boolean`.',
187
187
  'Failed prop type: Invalid prop `checked` of type `string` supplied to `ForwardRef(SwitchBase)`, expected `boolean`.',
188
+ 'Support for defaultProps will be removed from function components in a future major release.',
188
189
  'validateDOMNesting(...): <form> cannot appear as a descendant of <form>.',
189
190
  'Missing translation for key:',
190
191
  'HttpError: '
@@ -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
- * 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
- };
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: FC<DatagridProps> = React.forwardRef((props, ref) => {
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');