@applica-software-guru/react-admin 1.3.144 → 1.3.146

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.
Files changed (31) hide show
  1. package/dist/components/ra-lists/BulkActionsToolbar.d.ts +26 -0
  2. package/dist/components/ra-lists/BulkActionsToolbar.d.ts.map +1 -0
  3. package/dist/components/ra-lists/BulkFloatingActionsToolbar.d.ts +13 -0
  4. package/dist/components/ra-lists/BulkFloatingActionsToolbar.d.ts.map +1 -0
  5. package/dist/components/ra-lists/Datagrid/Datagrid.d.ts +114 -0
  6. package/dist/components/ra-lists/Datagrid/Datagrid.d.ts.map +1 -0
  7. package/dist/components/ra-lists/Datagrid/DatagridContext.d.ts +9 -0
  8. package/dist/components/ra-lists/Datagrid/DatagridContext.d.ts.map +1 -0
  9. package/dist/components/ra-lists/Datagrid/DatagridContextProvider.d.ts +8 -0
  10. package/dist/components/ra-lists/Datagrid/DatagridContextProvider.d.ts.map +1 -0
  11. package/dist/components/ra-lists/Datagrid/index.d.ts +15 -0
  12. package/dist/components/ra-lists/Datagrid/index.d.ts.map +1 -0
  13. package/dist/components/ra-lists/index.d.ts +6 -5
  14. package/dist/components/ra-lists/index.d.ts.map +1 -1
  15. package/dist/react-admin.cjs.js +59 -59
  16. package/dist/react-admin.cjs.js.map +1 -1
  17. package/dist/react-admin.es.js +10034 -9399
  18. package/dist/react-admin.es.js.map +1 -1
  19. package/dist/react-admin.umd.js +59 -59
  20. package/dist/react-admin.umd.js.map +1 -1
  21. package/package.json +1 -1
  22. package/src/components/ra-lists/BulkActionsToolbar.tsx +141 -0
  23. package/src/components/ra-lists/BulkFloatingActionsToolbar.tsx +100 -0
  24. package/src/components/ra-lists/Datagrid/Datagrid.tsx +345 -0
  25. package/src/components/ra-lists/Datagrid/DatagridContext.ts +13 -0
  26. package/src/components/ra-lists/Datagrid/DatagridContextProvider.tsx +8 -0
  27. package/src/components/ra-lists/{Datagrid.tsx → Datagrid/index.tsx} +6 -9
  28. package/src/components/ra-lists/index.ts +6 -5
  29. package/src/playground/components/ra-forms/TestModelForm.jsx +18 -0
  30. package/dist/components/ra-lists/Datagrid.d.ts +0 -638
  31. package/dist/components/ra-lists/Datagrid.d.ts.map +0 -1
@@ -0,0 +1,26 @@
1
+ import { ReactNode } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { Identifier } from 'ra-core';
4
+ declare const BulkActionsToolbar: {
5
+ (props: BulkActionsToolbarProps): import("react/jsx-runtime").JSX.Element;
6
+ propTypes: {
7
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
8
+ label: PropTypes.Requireable<string>;
9
+ };
10
+ };
11
+ export interface BulkActionsToolbarProps {
12
+ children?: ReactNode;
13
+ label?: string;
14
+ selectedIds?: Identifier[];
15
+ className?: string;
16
+ }
17
+ export declare const BulkActionsToolbarClasses: {
18
+ toolbar: string;
19
+ topToolbar: string;
20
+ buttons: string;
21
+ collapsed: string;
22
+ title: string;
23
+ icon: string;
24
+ };
25
+ export default BulkActionsToolbar;
26
+ //# sourceMappingURL=BulkActionsToolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BulkActionsToolbar.d.ts","sourceRoot":"","sources":["../../../../src/components/ra-lists/BulkActionsToolbar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAA6C,MAAM,OAAO,CAAC;AACvF,OAAO,SAAS,MAAM,YAAY,CAAC;AAQnC,OAAO,EAAuD,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1F,QAAA,MAAM,kBAAkB;YAAW,uBAAuB;;;;;CAmDzD,CAAC;AAOF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,eAAO,MAAM,yBAAyB;;;;;;;CAOrC,CAAC;AAqDF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ declare const BulkFloatingActionsToolbar: {
4
+ (props: BulkFloatingActionsToolbarProps): import("react/jsx-runtime").JSX.Element;
5
+ propTypes: {
6
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
7
+ };
8
+ };
9
+ export interface BulkFloatingActionsToolbarProps {
10
+ children?: React.ReactNode | React.ReactNode[];
11
+ }
12
+ export default BulkFloatingActionsToolbar;
13
+ //# sourceMappingURL=BulkFloatingActionsToolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BulkFloatingActionsToolbar.d.ts","sourceRoot":"","sources":["../../../../src/components/ra-lists/BulkFloatingActionsToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,SAAS,MAAM,YAAY,CAAC;AAenC,QAAA,MAAM,0BAA0B;YAAW,+BAA+B;;;;CAyEzE,CAAC;AAMF,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;CAChD;AAED,eAAe,0BAA0B,CAAC"}
@@ -0,0 +1,114 @@
1
+ import { DatagridProps as RaDatagridProps } from 'react-admin';
2
+ import * as React from 'react';
3
+ import { FC } from 'react';
4
+ export type DatagridProps = RaDatagridProps & {
5
+ /**
6
+ * An alternative to bulkActionButtons, to be used when the actions are too complex to be expressed.
7
+ * In this case you are free to fully control the rendering of the bulk actions toolbar.
8
+ * @see BulkActionsToolbar
9
+ * @example <caption>Using the BulkActionsToolbar component</caption>
10
+ * import { BulkActionsToolbar } from '../../..';
11
+ * import { BulkDeleteButton } from 'react-admin';
12
+ *
13
+ * const PostBulkActionButtons = props => (
14
+ * <BulkActionsToolbar {...props}>
15
+ * <BulkDeleteButton />
16
+ * // add your custom actions here
17
+ * </BulkActionsToolbar>
18
+ * );
19
+ *
20
+ * @example <caption>Using BulkFloatingActionsToolbar component</caption>
21
+ * import { BulkActionsToolbar } from '../../..';
22
+ * import { BulkDeleteButton } from 'react-admin';
23
+ *
24
+ * const PostBulkActionButtons = props => (
25
+ * <BulkActionsToolbar {...props}>
26
+ * <BulkDeleteButton />
27
+ * // add your custom actions here
28
+ * </BulkActionsToolbar>
29
+ * );
30
+ *
31
+ */
32
+ bulkActionsToolbar: React.ReactNode | React.FC | boolean;
33
+ };
34
+ /**
35
+ * The Datagrid component renders a list of records as a table.
36
+ * It is usually used as a child of the <List> and <ReferenceManyField> components.
37
+ *
38
+ * Props:
39
+ * - body
40
+ * - bulkActionButtons
41
+ * - children
42
+ * - empty
43
+ * - expand
44
+ * - header
45
+ * - hover
46
+ * - isRowExpandable
47
+ * - isRowSelectable
48
+ * - optimized
49
+ * - rowClick
50
+ * - rowSx
51
+ * - size
52
+ * - sx
53
+ *
54
+ * @example // Display all posts as a datagrid
55
+ * const postRowSx = (record, index) => ({
56
+ * backgroundColor: record.nb_views >= 500 ? '#efe' : 'white',
57
+ * });
58
+ * export const PostList = () => (
59
+ * <List>
60
+ * <Datagrid rowSx={postRowSx}>
61
+ * <TextField source="id" />
62
+ * <TextField source="title" />
63
+ * <TextField source="body" />
64
+ * <EditButton />
65
+ * </Datagrid>
66
+ * </List>
67
+ * );
68
+ *
69
+ * @example // Display all the comments of the current post as a datagrid
70
+ * <ReferenceManyField reference="comments" target="post_id">
71
+ * <Datagrid>
72
+ * <TextField source="id" />
73
+ * <TextField source="body" />
74
+ * <DateField source="created_at" />
75
+ * <EditButton />
76
+ * </Datagrid>
77
+ * </ReferenceManyField>
78
+ *
79
+ * @example // Usage outside of a <List> or a <ReferenceManyField>.
80
+ *
81
+ * const sort = { field: 'published_at', order: 'DESC' };
82
+ *
83
+ * export const MyCustomList = (props) => {
84
+ * const { data, total, isLoading } = useGetList(
85
+ * 'posts',
86
+ * { pagination: { page: 1, perPage: 10 }, sort: sort }
87
+ * );
88
+ *
89
+ * return (
90
+ * <Datagrid
91
+ * data={data}
92
+ * total={total}
93
+ * isLoading={isLoading}
94
+ * sort={sort}
95
+ * selectedIds={[]}
96
+ * setSort={() => {
97
+ * console.log('set sort');
98
+ * }}
99
+ * onSelect={() => {
100
+ * console.log('on select');
101
+ * }}
102
+ * onToggleItem={() => {
103
+ * console.log('on toggle item');
104
+ * }}
105
+ * >
106
+ * <TextField source="id" />
107
+ * <TextField source="title" />
108
+ * </Datagrid>
109
+ * );
110
+ * }
111
+ */
112
+ export declare const Datagrid: FC<DatagridProps>;
113
+ export default Datagrid;
114
+ //# sourceMappingURL=Datagrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Datagrid.d.ts","sourceRoot":"","sources":["../../../../../src/components/ra-lists/Datagrid/Datagrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,IAAI,eAAe,EASjC,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA+E,EAAE,EAAW,MAAM,OAAO,CAAC;AAYjH,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,kBAAkB,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,EAAE,GAAG,OAAO,CAAC;CAC1D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AACH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAmJrC,CAAC;AA+DH,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { RaRecord } from 'ra-core';
3
+ declare const DatagridContext: import("react").Context<DatagridContextValue>;
4
+ export type DatagridContextValue = {
5
+ isRowExpandable?: (record: RaRecord) => boolean;
6
+ expandSingle?: boolean;
7
+ };
8
+ export default DatagridContext;
9
+ //# sourceMappingURL=DatagridContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatagridContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/ra-lists/Datagrid/DatagridContext.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,QAAA,MAAM,eAAe,+CAA0C,CAAC;AAIhE,MAAM,MAAM,oBAAoB,GAAG;IAC/B,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,KAAK,OAAO,CAAC;IAChD,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { DatagridContextValue } from './DatagridContext';
3
+ declare const DatagridContextProvider: ({ children, value }: {
4
+ children: ReactNode;
5
+ value: DatagridContextValue;
6
+ }) => ReactElement;
7
+ export default DatagridContextProvider;
8
+ //# sourceMappingURL=DatagridContextProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatagridContextProvider.d.ts","sourceRoot":"","sources":["../../../../../src/components/ra-lists/Datagrid/DatagridContextProvider.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAwB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE1E,QAAA,MAAM,uBAAuB;cAAqC,SAAS;WAAS,oBAAoB;MAAK,YAE5G,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import { DatagridProps } from 'react-admin';
3
+ /**
4
+ * This component is a wrapper of the React-Admin Datagrid component.
5
+ * It is used to customize the Datagrid component.
6
+ * It is used by the List component.
7
+ * It is not meant to be used directly.
8
+ * Thsi version is designed by Applica for Mantis and expose few overrides on css styles based on this theme.
9
+ *
10
+ * @param {DatagridProps} props
11
+ * @returns {JSX.Element}
12
+ */
13
+ declare const Datagrid: (props: DatagridProps) => JSX.Element;
14
+ export default Datagrid;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ra-lists/Datagrid/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAgC5C;;;;;;;;;GASG;AACH,QAAA,MAAM,QAAQ,UAAW,aAAa,KAAG,WAGxC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,6 +1,7 @@
1
- import Datagrid from './Datagrid';
2
- import Empty from './Empty';
3
- import List from './List';
4
- import NotificationList from './NotificationList';
5
- export { Datagrid, Empty, NotificationList, List };
1
+ export { default as Datagrid } from './Datagrid';
2
+ export { default as Empty } from './Empty';
3
+ export { default as NotificationList } from './NotificationList';
4
+ export { default as List } from './List';
5
+ export { default as BulkActionsToolbar } from './BulkActionsToolbar';
6
+ export { default as BulkFloatingActionsToolbar } from './BulkFloatingActionsToolbar';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ra-lists/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ra-lists/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC"}