@applica-software-guru/react-admin 1.3.126 → 1.3.127

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 (46) hide show
  1. package/dist/ApplicaAdmin.d.ts +14 -29
  2. package/dist/ApplicaAdmin.d.ts.map +1 -1
  3. package/dist/components/Layout/Content.d.ts +4 -1
  4. package/dist/components/Layout/Content.d.ts.map +1 -1
  5. package/dist/components/Layout/Error.d.ts +27 -0
  6. package/dist/components/Layout/Error.d.ts.map +1 -0
  7. package/dist/components/Layout/Layout.d.ts +3 -0
  8. package/dist/components/Layout/Layout.d.ts.map +1 -1
  9. package/dist/components/Layout/index.d.ts +1 -0
  10. package/dist/components/Layout/index.d.ts.map +1 -1
  11. package/dist/components/ra-lists/List.d.ts +19 -18
  12. package/dist/components/ra-lists/List.d.ts.map +1 -1
  13. package/dist/components/ra-lists/ListView.d.ts +257 -0
  14. package/dist/components/ra-lists/ListView.d.ts.map +1 -0
  15. package/dist/dev/CatchResult.d.ts +17 -0
  16. package/dist/dev/CatchResult.d.ts.map +1 -0
  17. package/dist/dev/ErrorEventHandler.d.ts +13 -0
  18. package/dist/dev/ErrorEventHandler.d.ts.map +1 -0
  19. package/dist/dev/index.d.ts +4 -2
  20. package/dist/dev/index.d.ts.map +1 -1
  21. package/dist/dev/useErrorEventCatcher.d.ts +12 -0
  22. package/dist/dev/useErrorEventCatcher.d.ts.map +1 -0
  23. package/dist/react-admin.cjs.js +63 -63
  24. package/dist/react-admin.cjs.js.map +1 -1
  25. package/dist/react-admin.es.js +9561 -8991
  26. package/dist/react-admin.es.js.map +1 -1
  27. package/dist/react-admin.umd.js +66 -66
  28. package/dist/react-admin.umd.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/ApplicaAdmin.tsx +19 -33
  31. package/src/components/Layout/Content.tsx +37 -16
  32. package/src/components/Layout/Error.tsx +81 -0
  33. package/src/components/Layout/Layout.tsx +3 -2
  34. package/src/components/Layout/index.ts +1 -0
  35. package/src/components/ra-lists/List.tsx +117 -2
  36. package/src/components/ra-lists/ListView.tsx +369 -0
  37. package/src/components/ra-pages/GenericErrorPage.tsx +1 -1
  38. package/src/dev/CatchResult.ts +32 -0
  39. package/src/dev/ErrorEventHandler.ts +51 -0
  40. package/src/dev/index.ts +4 -2
  41. package/src/dev/useErrorEventCatcher.ts +50 -0
  42. package/src/playground/components/pages/CustomPage.jsx +6 -0
  43. package/dist/dev/useCliErrorCatcher.d.ts +0 -59
  44. package/dist/dev/useCliErrorCatcher.d.ts.map +0 -1
  45. package/src/dev/useCliErrorCatcher.ts +0 -142
  46. /package/src/assets/{genericError.png → generic-error.png} +0 -0
@@ -1,6 +1,8 @@
1
1
  import { AdminProps, AuthProvider, DataProvider } from 'react-admin';
2
2
  import { ThemeConfig } from './contexts';
3
+ import React from 'react';
3
4
  import { MenuProps } from './types';
5
+ import { IErrorEventHandler } from './dev/ErrorEventHandler';
4
6
  export type ApplicaAdminProps = AdminProps & {
5
7
  /**
6
8
  * Eventuali configurazioni aggiuntive da passare al tema.
@@ -63,6 +65,16 @@ export type ApplicaAdminProps = AdminProps & {
63
65
  * Il provider di dati da utilizzare nell'applicazione.
64
66
  */
65
67
  authProvider: AuthProvider;
68
+ /**
69
+ * Indica l'eventuale handler da utilizzare per la gestione degli errori.
70
+ * Di default è eseguita una chiamata PUT /api/ui/error con il messaggio di errore "error".
71
+ * Puoi implementare un tuo handler per gestire gli errori in modo diverso.
72
+ */
73
+ errorHandler?: IErrorEventHandler | undefined;
74
+ /**
75
+ * Indica il componente da visualizzare in caso di errore.
76
+ */
77
+ error: React.Component;
66
78
  /**
67
79
  * Indica il nome della risorsa REST da utilizzare per la gestione delle notifiche.
68
80
  * @default "entities/notification"
@@ -105,39 +117,12 @@ export type ApplicaAdminProps = AdminProps & {
105
117
  enablePasswordRecover: boolean;
106
118
  };
107
119
  /**
108
- * Definisce un'applicazione super figa basata su React Admi, Mantis Theme ed il nostro stile.
109
- * Ogni applicazione che crei dovrebbe partire con un 'C'era una volta un ApplicaAdmin'.
110
- *
111
- * @example
112
- * // Esempio di utilizzo
113
- * import { ApplicaAdmin } from '.';
114
- * import { createAuthProvider } from '@applica-software-guru/iam-client';
115
- * import { createDataProvider } from '@applica-software-guru/crud-client';
116
- * import * as entities from './entities';
117
- *
118
- * const apiUrl = "https://bimbobruno.applica.guru/api";
119
- * const authProvider = createAuthProvider({ apiUrl });
120
- * const getToken = async () => await authProvider.getToken();
121
- * const getHeaders = async () => await authProvider.getHeaders();
122
- *
123
- * const dataProvider = createDataProvider({ apiUrl, getToken, getHeaders });
124
- *
125
- * const App = () => (
126
- * <ApplicaAdmin
127
- * apiUrl="https://api.applica.software-guru.it"
128
- * dataProvider={dataProvider}
129
- * authProvider={authProvider}
130
- * menu={menu}
131
- * name="Applica Admin"
132
- * version="1.0.0">
133
- * <Resource name="entities/user" {...entities.user} />
134
- * </ApplicaAdmin>
135
- *
120
+ * Definisce un'applicazione super figa basata su React Admin, Mantis Theme ed il nostro stile.
136
121
  * @param {ApplicaAdminProps}
137
122
  * @returns {React.ReactElement}
138
123
  */
139
124
  declare const ApplicaAdmin: {
140
- ({ theme, themeConfig, apiUrl, defaultLocale, development, logoMain, logoIcon, loginPage, menu, name, copy, version, dataProvider, authProvider, notification, enableNotification, enableRegistration, enablePasswordRecover, ...props }: ApplicaAdminProps): import("react/jsx-runtime").JSX.Element;
125
+ ({ theme, themeConfig, apiUrl, defaultLocale, development, logoMain, logoIcon, loginPage, menu, name, copy, version, dataProvider, authProvider, errorHandler, error, notification, enableNotification, enableRegistration, enablePasswordRecover, ...props }: ApplicaAdminProps): import("react/jsx-runtime").JSX.Element;
141
126
  defaultProps: {
142
127
  fileFields: never[];
143
128
  defaultLocale: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicaAdmin.d.ts","sourceRoot":"","sources":["../../src/ApplicaAdmin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,E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,CAAC;AAkCF,eAAe,YAAY,CAAC"}
@@ -1,5 +1,8 @@
1
1
  /// <reference types="react" />
2
- type ILayoutContentProps = React.PropsWithChildren;
2
+ import { ErrorProps } from './Error';
3
+ type ILayoutContentProps = React.PropsWithChildren & {
4
+ error?: React.ComponentType<ErrorProps>;
5
+ };
3
6
  declare function LayoutContent(props: ILayoutContentProps): import("react/jsx-runtime").JSX.Element;
4
7
  export { LayoutContent };
5
8
  //# sourceMappingURL=Content.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Content.tsx"],"names":[],"mappings":";AAIA,KAAK,mBAAmB,GAAG,KAAK,CAAC,iBAAiB,CAAC;AAEnD,iBAAS,aAAa,CAAC,KAAK,EAAE,mBAAmB,2CAqBhD;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Content.tsx"],"names":[],"mappings":";AAMA,OAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE5C,KAAK,mBAAmB,GAAG,KAAK,CAAC,iBAAiB,GAAG;IACnD,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;CACzC,CAAC;AAEF,iBAAS,aAAa,CAAC,KAAK,EAAE,mBAAmB,2CAoChD;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,27 @@
1
+ import PropTypes from 'prop-types';
2
+ import { ComponentType, ErrorInfo, HtmlHTMLAttributes } from 'react';
3
+ import { TitleComponent } from 'ra-core';
4
+ import { FallbackProps } from 'react-error-boundary';
5
+ export type ErrorBoundaryProps = InternalErrorProps & {
6
+ errorComponent?: ComponentType<ErrorProps>;
7
+ title?: TitleComponent;
8
+ resetErrorBoundary?: null | (() => void);
9
+ };
10
+ declare function Error(props: ErrorBoundaryProps): import("react/jsx-runtime").JSX.Element;
11
+ declare namespace Error {
12
+ var propTypes: {
13
+ className: PropTypes.Requireable<string>;
14
+ error: PropTypes.Validator<object>;
15
+ errorInfo: PropTypes.Requireable<object>;
16
+ title: PropTypes.Requireable<NonNullable<string | PropTypes.ReactElementLike>>;
17
+ };
18
+ }
19
+ interface InternalErrorProps extends Omit<HtmlHTMLAttributes<HTMLDivElement>, 'title'>, FallbackProps, ErrorProps {
20
+ className?: string;
21
+ }
22
+ export interface ErrorProps extends Pick<FallbackProps, 'error'> {
23
+ errorInfo?: ErrorInfo;
24
+ title?: TitleComponent;
25
+ }
26
+ export default Error;
27
+ //# sourceMappingURL=Error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Error.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Error.tsx"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,kBAAkB,EAAe,MAAM,OAAO,CAAC;AAClF,OAAO,EAAE,cAAc,EAAgB,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GAAG;IACpD,cAAc,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,kBAAkB,CAAC,EAAE,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;CAC1C,CAAC;AAKF,iBAAS,KAAK,CAAC,KAAK,EAAE,kBAAkB,2CA4CvC;kBA5CQ,KAAK;;;;;;;;AAoDd,UAAU,kBAAmB,SAAQ,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,EAAE,aAAa,EAAE,UAAU;IAC/G,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC;IAC9D,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,eAAe,KAAK,CAAC"}
@@ -1,13 +1,16 @@
1
1
  /// <reference types="react" />
2
+ import { ErrorProps } from 'ra-ui-materialui';
2
3
  type ILayoutProps = React.PropsWithChildren<{
3
4
  name: string;
4
5
  version: string;
5
6
  copy?: string;
7
+ error?: React.ComponentType<ErrorProps>;
6
8
  }>;
7
9
  declare const Layout: import("react").ForwardRefExoticComponent<{
8
10
  name: string;
9
11
  version: string;
10
12
  copy?: string | undefined;
13
+ error?: import("react").ComponentType<ErrorProps> | undefined;
11
14
  } & {
12
15
  children?: import("react").ReactNode;
13
16
  } & {
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Layout.tsx"],"names":[],"mappings":";AAaA,KAAK,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,QAAA,MAAM,MAAM;UALJ,MAAM;aACH,MAAM;;;;;;;;;2CA0Cf,CAAC;AAEH,YAAY,EAAE,YAAY,EAAE,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Layout.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AAOhE,KAAK,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;CACzC,CAAC,CAAC;AAEH,QAAA,MAAM,MAAM;UANJ,MAAM;aACH,MAAM;;;;;;;;;;2CA2Cf,CAAC;AAEH,YAAY,EAAE,YAAY,EAAE,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -8,4 +8,5 @@ export * from './Navigation';
8
8
  export * from './NavMenu';
9
9
  export * from './Provider';
10
10
  export * from './Wrapper';
11
+ export * from './Error';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAChE,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAChE,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAA"}
@@ -1,27 +1,28 @@
1
1
  /// <reference types="react" />
2
2
  import { ListProps } from 'react-admin';
3
+ import PropTypes from 'prop-types';
3
4
  declare const List: {
4
5
  (props: ListProps): JSX.Element;
5
6
  propTypes: {
6
- actions: import("prop-types").Requireable<NonNullable<boolean | import("prop-types").ReactElementLike>>;
7
- aside: import("prop-types").Requireable<import("prop-types").ReactElementLike>;
8
- children: import("prop-types").Validator<NonNullable<import("prop-types").ReactNodeLike>>;
9
- className: import("prop-types").Requireable<string>;
10
- emptyWhileLoading: import("prop-types").Requireable<boolean>;
11
- filter: import("prop-types").Requireable<object>;
12
- filterDefaultValues: import("prop-types").Requireable<object>;
13
- filters: import("prop-types").Requireable<NonNullable<import("prop-types").ReactElementLike | import("prop-types").ReactElementLike[]>>;
14
- pagination: import("prop-types").Requireable<NonNullable<boolean | import("prop-types").ReactElementLike>>;
15
- perPage: import("prop-types").Requireable<number>;
16
- sort: import("prop-types").Requireable<import("prop-types").InferProps<{
17
- field: import("prop-types").Requireable<string>;
18
- order: import("prop-types").Requireable<"ASC" | "DESC">;
7
+ actions: PropTypes.Requireable<NonNullable<boolean | PropTypes.ReactElementLike | null | undefined>>;
8
+ aside: PropTypes.Requireable<PropTypes.ReactElementLike>;
9
+ children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
10
+ className: PropTypes.Requireable<string>;
11
+ emptyWhileLoading: PropTypes.Requireable<boolean>;
12
+ filter: PropTypes.Requireable<object>;
13
+ filterDefaultValues: PropTypes.Requireable<object>;
14
+ filters: PropTypes.Requireable<NonNullable<PropTypes.ReactElementLike | (PropTypes.ReactElementLike | null | undefined)[] | null | undefined>>;
15
+ pagination: PropTypes.Requireable<NonNullable<boolean | PropTypes.ReactElementLike | null | undefined>>;
16
+ perPage: PropTypes.Requireable<number>;
17
+ sort: PropTypes.Requireable<PropTypes.InferProps<{
18
+ field: PropTypes.Requireable<string>;
19
+ order: PropTypes.Requireable<"ASC" | "DESC">;
19
20
  }>>;
20
- sx: import("prop-types").Requireable<any>;
21
- title: import("prop-types").Requireable<NonNullable<string | import("prop-types").ReactElementLike>>;
22
- disableSyncWithLocation: import("prop-types").Requireable<boolean>;
23
- hasCreate: import("prop-types").Requireable<boolean>;
24
- resource: import("prop-types").Requireable<string>;
21
+ sx: PropTypes.Requireable<any>;
22
+ title: PropTypes.Requireable<NonNullable<string | PropTypes.ReactElementLike>>;
23
+ disableSyncWithLocation: PropTypes.Requireable<boolean>;
24
+ hasCreate: PropTypes.Requireable<boolean>;
25
+ resource: PropTypes.Requireable<string>;
25
26
  };
26
27
  };
27
28
  export default List;
@@ -1 +1 @@
1
- {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../src/components/ra-lists/List.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAC;AA0FxD,QAAA,MAAM,IAAI;YAAW,SAAS,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;CAM3C,CAAC;AAMF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../src/components/ra-lists/List.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAiB,SAAS,EAAE,MAAM,aAAa,CAAC;AAIvD,OAAO,SAAS,MAAM,YAAY,CAAC;AAyMnC,QAAA,MAAM,IAAI;YAAW,SAAS,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;CAM3C,CAAC;AAMF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,257 @@
1
+ import { ReactElement, ReactNode, ElementType } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { SxProps } from '@mui/system';
4
+ import { RaRecord } from 'ra-core';
5
+ export declare const ListView: {
6
+ <RecordType extends RaRecord<import("react-admin").Identifier> = any>(props: ListViewProps): import("react/jsx-runtime").JSX.Element | null;
7
+ propTypes: {
8
+ actions: PropTypes.Requireable<NonNullable<boolean | PropTypes.ReactElementLike | null | undefined>>;
9
+ aside: PropTypes.Requireable<PropTypes.ReactElementLike>;
10
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
11
+ className: PropTypes.Requireable<string>;
12
+ component: (props: any, propName: any, componentName: any) => Error;
13
+ emptyWhileLoading: PropTypes.Requireable<boolean>;
14
+ filters: PropTypes.Requireable<NonNullable<PropTypes.ReactElementLike | (PropTypes.ReactElementLike | null | undefined)[] | null | undefined>>;
15
+ hasCreate: PropTypes.Requireable<boolean>;
16
+ pagination: PropTypes.Requireable<NonNullable<boolean | PropTypes.ReactElementLike | null | undefined>>;
17
+ title: PropTypes.Requireable<NonNullable<string | PropTypes.ReactElementLike>>;
18
+ };
19
+ };
20
+ export interface ListViewProps {
21
+ /**
22
+ * The actions to display in the toolbar. defaults to Filter + Create + Export.
23
+ *
24
+ * @see https://marmelab.com/react-admin/List.html#actions
25
+ * @example
26
+ * import {
27
+ * CreateButton,
28
+ * DatagridConfigurable,
29
+ * ExportButton,
30
+ * FilterButton,
31
+ * List,
32
+ * SelectColumnsButton,
33
+ * TopToolbar,
34
+ * } from 'react-admin';
35
+ * import IconEvent from '@mui/icons-material/Event';
36
+ *
37
+ * const ListActions = () => (
38
+ * <TopToolbar>
39
+ * <SelectColumnsButton />
40
+ * <FilterButton/>
41
+ * <CreateButton/>
42
+ * <ExportButton/>
43
+ * </TopToolbar>
44
+ * );
45
+ *
46
+ * export const PostList = () => (
47
+ * <List actions={<ListActions/>}>
48
+ * <DatagridConfigurable>
49
+ * ...
50
+ * </DatagridConfigurable>
51
+ * </List>
52
+ * );
53
+ */
54
+ actions?: ReactElement | false;
55
+ /**
56
+ * The content to render as a sidebar.
57
+ * @see https://marmelab.com/react-admin/List.html#aside
58
+ * @example
59
+ * import { List, useListContext } from 'react-admin';
60
+ * import { Typography } from '@mui/material';
61
+ *
62
+ * const Aside = () => {
63
+ * const { data, isLoading } = useListContext();
64
+ * if (isLoading) return null;
65
+ * return (
66
+ * <div style={{ width: 200, margin: '4em 1em' }}>
67
+ * <Typography variant="h6">Posts stats</Typography>
68
+ * <Typography variant="body2">
69
+ * Total views: {data.reduce((sum, post) => sum + post.views, 0)}
70
+ * </Typography>
71
+ * </div>
72
+ * );
73
+ * };
74
+ *
75
+ * const PostList = () => (
76
+ * <List aside={<Aside />}>
77
+ * ...
78
+ * </List>
79
+ * );
80
+ */
81
+ aside?: ReactElement;
82
+ /**
83
+ * @deprecated pass the bulkActionButtons prop to the List child (Datagrid or SimpleList) instead
84
+ */
85
+ bulkActionButtons?: ReactElement | false;
86
+ /**
87
+ * A class name to apply to the root div element
88
+ */
89
+ className?: string;
90
+ /**
91
+ * The components rendering the list of records. Usually a <Datagrid> or <SimpleList>.
92
+ *
93
+ * @see https://marmelab.com/react-admin/List.html#children
94
+ * @example
95
+ * import { List, Datagrid, TextField, DateField, NumberField, BooleanField, ReferenceManyCount } from 'react-admin';
96
+ *
97
+ * export const BookList = () => (
98
+ * <List>
99
+ * <Datagrid rowClick="edit">
100
+ * <TextField source="id" />
101
+ * <TextField source="title" />
102
+ * <DateField source="published_at" />
103
+ * <ReferenceManyCount label="Nb comments" reference="comments" target="post_id" link />
104
+ * <BooleanField source="commentable" label="Com." />
105
+ * <NumberField source="nb_views" label="Views" />
106
+ * </Datagrid>
107
+ * </List>
108
+ * );
109
+ */
110
+ children: ReactNode;
111
+ /**
112
+ * The component used to display the list. Defaults to <Card>.
113
+ *
114
+ * @see https://marmelab.com/react-admin/List.html#component
115
+ * @example
116
+ * import { List } from 'react-admin';
117
+ *
118
+ * const PostList = () => (
119
+ * <List component="div">
120
+ * ...
121
+ * </List>
122
+ * );
123
+ */
124
+ component?: ElementType;
125
+ /**
126
+ * The component to display when the list is empty.
127
+ *
128
+ * @see https://marmelab.com/react-admin/List.html#empty
129
+ * @example
130
+ * import { CreateButton, List } from 'react-admin';
131
+ * import { Box, Button, Typography } from '@mui/material';
132
+ *
133
+ * const Empty = () => (
134
+ * <Box textAlign="center" m={1}>
135
+ * <Typography variant="h4" paragraph>
136
+ * No products available
137
+ * </Typography>
138
+ * <Typography variant="body1">
139
+ * Create one or import products from a file
140
+ * </Typography>
141
+ * <CreateButton />
142
+ * <Button onClick={...}>Import</Button>
143
+ * </Box>
144
+ * );
145
+ *
146
+ * const ProductList = () => (
147
+ * <List empty={<Empty />}>
148
+ * ...
149
+ * </List>
150
+ * );
151
+ */
152
+ empty?: ReactElement | false;
153
+ /**
154
+ * Set to true to return null while the list is loading.
155
+ *
156
+ * @see https://marmelab.com/react-admin/List.html#emptywhileloading
157
+ * @example
158
+ * import { List } from 'react-admin';
159
+ * import { SimpleBookList } from './BookList';
160
+ *
161
+ * const BookList = () => (
162
+ * <List emptyWhileLoading>
163
+ * <SimpleBookList />
164
+ * </List>
165
+ * );
166
+ */
167
+ emptyWhileLoading?: boolean;
168
+ /**
169
+ * The filter inputs to display in the toolbar.
170
+ *
171
+ * @see https://marmelab.com/react-admin/List.html#filters
172
+ * @example
173
+ * import { List, TextInput } from 'react-admin';
174
+ *
175
+ * const postFilters = [
176
+ * <TextInput label="Search" source="q" alwaysOn />,
177
+ * <TextInput label="Title" source="title" defaultValue="Hello, World!" />,
178
+ * ];
179
+ *
180
+ * export const PostList = () => (
181
+ * <List filters={postFilters}>
182
+ * ...
183
+ * </List>
184
+ * );
185
+ */
186
+ filters?: ReactElement | ReactElement[];
187
+ /**
188
+ * Set to true to force a Create button in the toolbar, even if there is no create view declared in Resource
189
+ *
190
+ * @see https://marmelab.com/react-admin/List.html#hascreate
191
+ * @example
192
+ * import { List } from 'react-admin';
193
+ *
194
+ * export const PostList = () => (
195
+ * <List hasCreate={false}>
196
+ * ...
197
+ * </List>
198
+ * );
199
+ */
200
+ hasCreate?: boolean;
201
+ /**
202
+ * The pagination component to display. defaults to <Pagination />
203
+ *
204
+ * @see https://marmelab.com/react-admin/List.html#pagination
205
+ * @example
206
+ * import { Pagination, List } from 'react-admin';
207
+ *
208
+ * const PostPagination = props => <Pagination rowsPerPageOptions={[10, 25, 50, 100]} {...props} />;
209
+ *
210
+ * export const PostList = () => (
211
+ * <List pagination={<PostPagination />}>
212
+ * ...
213
+ * </List>
214
+ * );
215
+ */
216
+ pagination?: ReactElement | false;
217
+ /**
218
+ * The page title (main title) to display above the data. Defaults to the humanized resource name.
219
+ *
220
+ * @see https://marmelab.com/react-admin/List.html#title
221
+ * @example
222
+ * import { List } from 'react-admin';
223
+ *
224
+ * export const PostList = () => (
225
+ * <List title="List of posts">
226
+ * ...
227
+ * </List>
228
+ * );
229
+ */
230
+ title?: string | ReactElement;
231
+ /**
232
+ * The CSS styles to apply to the component.
233
+ *
234
+ * @see https://marmelab.com/react-admin/List.html#sx-css-api
235
+ * @example
236
+ * const PostList = () => (
237
+ * <List
238
+ * sx={{
239
+ * backgroundColor: 'yellow',
240
+ * '& .RaList-content': {
241
+ * backgroundColor: 'red',
242
+ * },
243
+ * }}
244
+ * >
245
+ * ...
246
+ * </List>
247
+ * );
248
+ */
249
+ sx?: SxProps;
250
+ }
251
+ export declare const ListClasses: {
252
+ main: string;
253
+ content: string;
254
+ actions: string;
255
+ noResults: string;
256
+ };
257
+ //# sourceMappingURL=ListView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../../../src/components/ra-lists/ListView.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgB,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAE3E,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,OAAO,EAAqC,QAAQ,EAAE,MAAM,SAAS,CAAC;AAUtE,eAAO,MAAM,QAAQ;iFAA8C,aAAa;;;;;;;;;;;;;CA2D/E,CAAC;AAeF,MAAM,WAAW,aAAa;IAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,OAAO,CAAC,EAAE,YAAY,GAAG,KAAK,CAAC;IAE/B;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB;;OAEG;IACH,iBAAiB,CAAC,EAAE,YAAY,GAAG,KAAK,CAAC;IAEzC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,KAAK,CAAC,EAAE,YAAY,GAAG,KAAK,CAAC;IAE7B;;;;;;;;;;;;;OAaG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,EAAE,YAAY,GAAG,YAAY,EAAE,CAAC;IAExC;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;;;;;;;;;OAcG;IACH,UAAU,CAAC,EAAE,YAAY,GAAG,KAAK,CAAC;IAElC;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAE9B;;;;;;;;;;;;;;;;;OAiBG;IACH,EAAE,CAAC,EAAE,OAAO,CAAC;CACd;AAID,eAAO,MAAM,WAAW;;;;;CAKvB,CAAC"}
@@ -0,0 +1,17 @@
1
+ export type CatchResultConstructorData = {
2
+ catch: boolean;
3
+ display: boolean;
4
+ log: boolean;
5
+ error?: string;
6
+ };
7
+ export default class CatchResult {
8
+ catch: boolean;
9
+ display: boolean;
10
+ log: boolean;
11
+ error?: string;
12
+ constructor({ catch: catchErr, display: displayErr, log: logErr, error }: CatchResultConstructorData);
13
+ isCatched(): boolean;
14
+ logError(): boolean;
15
+ displayError(): boolean;
16
+ }
17
+ //# sourceMappingURL=CatchResult.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CatchResult.d.ts","sourceRoot":"","sources":["../../../src/dev/CatchResult.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B,GAAG;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;gBAEH,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,0BAA0B;IAOpG,SAAS;IAIT,QAAQ;IAIR,YAAY;CAGb"}
@@ -0,0 +1,13 @@
1
+ export type IErrorEventHandlerConstructData = {
2
+ apiUrl: string;
3
+ };
4
+ export interface IErrorEventHandler {
5
+ handle(event: ErrorEvent): void;
6
+ }
7
+ declare class ErrorEventHandler implements IErrorEventHandler {
8
+ #private;
9
+ constructor(data: IErrorEventHandlerConstructData);
10
+ handle(error: ErrorEvent): void;
11
+ }
12
+ export default ErrorEventHandler;
13
+ //# sourceMappingURL=ErrorEventHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorEventHandler.d.ts","sourceRoot":"","sources":["../../../src/dev/ErrorEventHandler.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;CACjC;AAED,cAAM,iBAAkB,YAAW,kBAAkB;;gBAKvC,IAAI,EAAE,+BAA+B;IASjD,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;CAyBhC;AAED,eAAe,iBAAiB,CAAC"}
@@ -1,3 +1,5 @@
1
- import useCliErrorCatcher, { CatchResult } from './useCliErrorCatcher';
2
- export { useCliErrorCatcher, CatchResult };
1
+ import useErrorEventCatcher from './useErrorEventCatcher';
2
+ import CatchResult from './CatchResult';
3
+ import ErrorEventHandler from './ErrorEventHandler';
4
+ export { useErrorEventCatcher, CatchResult, ErrorEventHandler };
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dev/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,EAAE,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dev/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { IErrorEventHandler } from './ErrorEventHandler';
2
+ import CatchResult from './CatchResult';
3
+ export type UseErrorEventCatcherProps = {
4
+ apiUrl: string;
5
+ enabled?: boolean;
6
+ loading?: boolean;
7
+ catcherFn?: (error: string | any) => CatchResult;
8
+ errorHandler?: IErrorEventHandler;
9
+ };
10
+ declare const useErrorEventCatcher: ({ enabled, apiUrl, loading, catcherFn, ...props }: UseErrorEventCatcherProps) => boolean;
11
+ export default useErrorEventCatcher;
12
+ //# sourceMappingURL=useErrorEventCatcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useErrorEventCatcher.d.ts","sourceRoot":"","sources":["../../../src/dev/useErrorEventCatcher.ts"],"names":[],"mappings":"AAIA,OAA0B,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,MAAM,MAAM,yBAAyB,GAAG;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,KAAK,WAAW,CAAC;IACjD,YAAY,CAAC,EAAE,kBAAkB,CAAC;CACnC,CAAC;AAEF,QAAA,MAAM,oBAAoB,sDAMvB,yBAAyB,YA2B3B,CAAC;AACF,eAAe,oBAAoB,CAAC"}