@applica-software-guru/react-admin 1.5.268 → 1.5.273
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/dist/ApplicaAdmin.d.ts +5 -1
- package/dist/ApplicaAdmin.d.ts.map +1 -1
- package/dist/components/Layout/Layout.d.ts +2 -15
- package/dist/components/Layout/Layout.d.ts.map +1 -1
- package/dist/components/Layout/Navigation/NavItem.d.ts.map +1 -1
- package/dist/components/Layout/Provider.d.ts +1 -8
- package/dist/components/Layout/Provider.d.ts.map +1 -1
- package/dist/components/ra-buttons/CreateInDialogButton.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +36 -36
- package/dist/react-admin.cjs.js.gz +0 -0
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +835 -820
- package/dist/react-admin.es.js.gz +0 -0
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +25 -25
- package/dist/react-admin.umd.js.gz +0 -0
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/ApplicaAdmin.tsx +20 -3
- package/src/components/Layout/Layout.tsx +3 -2
- package/src/components/Layout/Navigation/NavItem.tsx +3 -1
- package/src/components/Layout/Provider.tsx +1 -1
- package/src/components/ra-buttons/CreateInDialogButton.tsx +0 -1
package/package.json
CHANGED
package/src/ApplicaAdmin.tsx
CHANGED
|
@@ -52,6 +52,7 @@ function ApplicaAdmin({
|
|
|
52
52
|
enableRegistration = false,
|
|
53
53
|
enablePasswordRecover = false,
|
|
54
54
|
enableThemeToggler = false,
|
|
55
|
+
enableLocaleSwitcher = false,
|
|
55
56
|
queryClient = defaultQueryClient,
|
|
56
57
|
background,
|
|
57
58
|
notificationAPI = 'entities/notification',
|
|
@@ -76,7 +77,7 @@ function ApplicaAdmin({
|
|
|
76
77
|
const result = new CatchResult({
|
|
77
78
|
catch: isKnowBug,
|
|
78
79
|
display: !isKnowBug,
|
|
79
|
-
log: !isKnowBug,
|
|
80
|
+
log: !isKnowBug && development === true,
|
|
80
81
|
error: errorMessage
|
|
81
82
|
});
|
|
82
83
|
return result;
|
|
@@ -106,17 +107,29 @@ function ApplicaAdmin({
|
|
|
106
107
|
{...props}
|
|
107
108
|
name={name}
|
|
108
109
|
copy={copy}
|
|
109
|
-
enableThemeToggler={enableThemeToggler}
|
|
110
110
|
version={version}
|
|
111
111
|
logoMain={_logoMain}
|
|
112
112
|
logoIcon={_logoIcon}
|
|
113
113
|
notification={notificationAPI}
|
|
114
|
+
enableThemeToggler={enableThemeToggler}
|
|
114
115
|
enableNotification={enableNotification}
|
|
116
|
+
enableLocaleSwitcher={enableLocaleSwitcher}
|
|
115
117
|
error={error}
|
|
116
118
|
/>
|
|
117
119
|
);
|
|
118
120
|
},
|
|
119
|
-
[
|
|
121
|
+
[
|
|
122
|
+
logoMain,
|
|
123
|
+
logoIcon,
|
|
124
|
+
name,
|
|
125
|
+
copy,
|
|
126
|
+
version,
|
|
127
|
+
error,
|
|
128
|
+
notificationAPI,
|
|
129
|
+
enableNotification,
|
|
130
|
+
enableThemeToggler,
|
|
131
|
+
enableLocaleSwitcher
|
|
132
|
+
]
|
|
120
133
|
);
|
|
121
134
|
|
|
122
135
|
const i18nProvider = useI18nProvider({
|
|
@@ -292,6 +305,10 @@ type ApplicaAdminProps = AdminProps & {
|
|
|
292
305
|
* Indicates whether the theme toggler should be displayed.
|
|
293
306
|
*/
|
|
294
307
|
enableThemeToggler: boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Indicates whether the locale switcher should be displayed.
|
|
310
|
+
*/
|
|
311
|
+
enableLocaleSwitcher: boolean;
|
|
295
312
|
};
|
|
296
313
|
|
|
297
314
|
export { ApplicaAdmin };
|
|
@@ -19,17 +19,18 @@ type ILayoutProps = React.PropsWithChildren<{
|
|
|
19
19
|
error?: React.ComponentType<ErrorProps>;
|
|
20
20
|
enableThemeToggler: boolean;
|
|
21
21
|
enableNotification: boolean;
|
|
22
|
+
enableLocaleSwitcher: boolean;
|
|
22
23
|
}>;
|
|
23
24
|
|
|
24
25
|
const Layout = withLayoutProvider(function Layout(props: ILayoutProps) {
|
|
25
|
-
const { name, version, enableThemeToggler, enableNotification } = props;
|
|
26
|
+
const { name, version, enableThemeToggler, enableNotification, enableLocaleSwitcher } = props;
|
|
26
27
|
const { isLoading, navigation, breadcrumbs } = useBreadcrumbs();
|
|
27
28
|
|
|
28
29
|
return (
|
|
29
30
|
<LayoutWrapper>
|
|
30
31
|
<Header>
|
|
31
32
|
<HeaderSpacer />
|
|
32
|
-
<LocaleButton />
|
|
33
|
+
{enableLocaleSwitcher ? <LocaleButton /> : null}
|
|
33
34
|
{enableThemeToggler ? <ThemeToggler /> : null}
|
|
34
35
|
<ThemeColor />
|
|
35
36
|
<LoadingIndicator />
|
|
@@ -30,7 +30,9 @@ function NavItem({ item, level }: NavItemProps) {
|
|
|
30
30
|
|
|
31
31
|
const listItemProps: NavListItemProps =
|
|
32
32
|
item?.external !== false
|
|
33
|
-
? {
|
|
33
|
+
? {
|
|
34
|
+
component: forwardRef((props, ref) => <Link {...props} to={item.url} target={itemTarget} ref={ref as any} />)
|
|
35
|
+
}
|
|
34
36
|
: { component: 'a', href: item.url, target: itemTarget };
|
|
35
37
|
|
|
36
38
|
const Icon = item.icon;
|
|
@@ -238,7 +238,7 @@ function LayoutProvider(props: ILayoutProviderProps) {
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
function withLayoutProvider<P, T>(Component: React.ComponentType<P>) {
|
|
241
|
-
return forwardRef((props: P & ILayoutProviderProps, ref: React.ForwardedRef<T>) => {
|
|
241
|
+
return forwardRef((props: P & ILayoutProviderProps & any, ref: React.ForwardedRef<T>) => {
|
|
242
242
|
const { logoIcon, logoMain, enableNotification, notification } = props;
|
|
243
243
|
return (
|
|
244
244
|
<LayoutProvider
|