@applica-software-guru/react-admin 1.0.56 → 1.0.58
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/.eslintrc.json +3 -0
- package/README.md +14 -0
- package/dist/ApplicaAdmin.d.ts +1 -1
- package/dist/react-admin.cjs.js +45 -45
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +3091 -3075
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +44 -44
- package/dist/react-admin.umd.js.map +1 -1
- package/dist/themes/index.d.ts.map +1 -1
- package/dist/themes/overrides/IconButton.d.ts +5 -0
- package/dist/themes/overrides/IconButton.d.ts.map +1 -1
- package/index.html +13 -0
- package/package.json +1 -1
- package/src/main.tsx +10 -0
- package/{playground/src/App.js → src/playground/App.jsx} +2 -2
- package/{playground/src/components/index.js → src/playground/components/index.jsx} +1 -0
- package/{playground/src/components/ra-lists/DeviceList.js → src/playground/components/ra-lists/DeviceList.jsx} +1 -1
- package/{playground/src/config.js → src/playground/config.jsx} +1 -1
- package/{playground/src/entities/device.js → src/playground/entities/device.jsx} +1 -1
- package/{playground/src/entities/i18n-message.js → src/playground/entities/i18n-message.jsx} +1 -1
- package/{playground/src/entities/user.js → src/playground/entities/user.jsx} +2 -2
- package/src/playground/hooks/index.jsx +1 -0
- package/{playground/src/theme.js → src/playground/theme.jsx} +1 -1
- package/src/themes/index.jsx +40 -26
- package/src/themes/overrides/IconButton.jsx +5 -0
- package/vite.config.js +5 -0
- package/playground/config-overrides.js +0 -31
- package/playground/jsconfig.json +0 -9
- package/playground/package-lock.json +0 -17777
- package/playground/package.json +0 -69
- package/playground/public/favicon-dark.png +0 -0
- package/playground/public/favicon-light.png +0 -0
- package/playground/public/index.html +0 -46
- package/playground/src/hooks/index.js +0 -1
- package/playground/src/react-app-env.d.js +0 -1
- /package/{playground/src → src/playground}/.prettierrc +0 -0
- /package/{playground/src → src/playground}/build.json +0 -0
- /package/{playground/src → src/playground}/components/pages/CustomPage.jsx +0 -0
- /package/{playground/src → src/playground}/components/pages/index.jsx +0 -0
- /package/{playground/src/components/ra-buttons/index.js → src/playground/components/ra-buttons/index.jsx} +0 -0
- /package/{playground/src/components/ra-fields/UserPictureField.js → src/playground/components/ra-fields/UserPictureField.jsx} +0 -0
- /package/{playground/src/components/ra-fields/index.js → src/playground/components/ra-fields/index.jsx} +0 -0
- /package/{playground/src/components/ra-forms/DeviceForm.js → src/playground/components/ra-forms/DeviceForm.jsx} +0 -0
- /package/{playground/src/components/ra-forms/I18nMessageForm.js → src/playground/components/ra-forms/I18nMessageForm.jsx} +0 -0
- /package/{playground/src/components/ra-forms/UserForm.js → src/playground/components/ra-forms/UserForm.jsx} +0 -0
- /package/{playground/src/components/ra-forms/index.js → src/playground/components/ra-forms/index.jsx} +0 -0
- /package/{playground/src/components/ra-inputs/LangSelectInput.js → src/playground/components/ra-inputs/LangSelectInput.jsx} +0 -0
- /package/{playground/src/components/ra-inputs/YesOrNoSelectInput.js → src/playground/components/ra-inputs/YesOrNoSelectInput.jsx} +0 -0
- /package/{playground/src/components/ra-inputs/index.js → src/playground/components/ra-inputs/index.jsx} +0 -0
- /package/{playground/src/components/ra-lists/I18nMessageList.js → src/playground/components/ra-lists/I18nMessageList.jsx} +0 -0
- /package/{playground/src/components/ra-lists/UserList.js → src/playground/components/ra-lists/UserList.jsx} +0 -0
- /package/{playground/src/components/ra-lists/index.js → src/playground/components/ra-lists/index.jsx} +0 -0
- /package/{playground/src/contexts/index.js → src/playground/contexts/index.jsx} +0 -0
- /package/{playground/src/entities/index.js → src/playground/entities/index.jsx} +0 -0
- /package/{playground/src/entities/notification.js → src/playground/entities/notification.jsx} +0 -0
- /package/{playground/src/index.js → src/playground/index.jsx} +0 -0
- /package/{playground/src/menu.js → src/playground/menu.jsx} +0 -0
- /package/{playground/src/reportWebVitals.js → src/playground/reportWebVitals.jsx} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/themes/index.jsx"],"names":[],"mappings":"AAcA;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/themes/index.jsx"],"names":[],"mappings":"AAcA;;;4CAgEC;;;;;;;sBArEqB,aAAa;sBACb,aAAa;sBAJb,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/themes/overrides/IconButton.jsx"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/themes/overrides/IconButton.jsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BC"}
|
package/index.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>React-Admin Demo Application</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
package/package.json
CHANGED
package/src/main.tsx
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import App from './playground/App';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import ReactDOM from 'react-dom/client';
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
6
|
+
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
7
|
+
<React.StrictMode>
|
|
8
|
+
<App />
|
|
9
|
+
</React.StrictMode>
|
|
10
|
+
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '@applica-software-guru/react-admin/style.css';
|
|
1
|
+
// import '@applica-software-guru/react-admin/style.css';
|
|
2
2
|
|
|
3
3
|
import * as entities from './entities';
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ import { API_URL, FILE_FIELDS } from './config';
|
|
|
6
6
|
import { ApplicaAdmin, HttpError, Resource } from '@applica-software-guru/react-admin';
|
|
7
7
|
import { createAttachmentsParser, createDataProvider } from '@applica-software-guru/crud-client';
|
|
8
8
|
|
|
9
|
-
import { CustomPage } from 'components/pages';
|
|
9
|
+
import { CustomPage } from './components/pages';
|
|
10
10
|
import { CustomRoutes } from 'ra-core';
|
|
11
11
|
import { Route } from 'react-router-dom';
|
|
12
12
|
import build from './build.json';
|
|
@@ -12,7 +12,7 @@ const AlertBox = () => {
|
|
|
12
12
|
);
|
|
13
13
|
};
|
|
14
14
|
const DeviceList = () => (
|
|
15
|
-
<List perPage={25} filters={[<SearchInput source="keyword" alwaysOn />]}>
|
|
15
|
+
<List perPage={25} filters={[<SearchInput key="keyword" source="keyword" alwaysOn />]}>
|
|
16
16
|
<AlertBox />
|
|
17
17
|
<Datagrid rowClick="edit">
|
|
18
18
|
<TextField source="id" />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Create, Edit } from '@applica-software-guru/react-admin';
|
|
2
|
-
import { UserForm, UserList } from 'components';
|
|
2
|
+
import { UserForm, UserList } from '../components';
|
|
3
3
|
|
|
4
|
-
import { CONFIGURED_ROLES } from 'config';
|
|
4
|
+
import { CONFIGURED_ROLES } from '../config';
|
|
5
5
|
import { UserOutlined } from '@ant-design/icons';
|
|
6
6
|
|
|
7
7
|
const UserCreate = () => (
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/src/themes/index.jsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _ from
|
|
1
|
+
import _ from 'lodash';
|
|
2
2
|
import { CssBaseline, StyledEngineProvider } from '@mui/material';
|
|
3
3
|
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
|
4
4
|
|
|
@@ -22,37 +22,51 @@ const ThemeCustomization = ({ themeOverrides, children }) => {
|
|
|
22
22
|
const themeCustomShadows = useMemo(() => CustomShadows(theme), [theme]);
|
|
23
23
|
|
|
24
24
|
const themeOptions = useMemo(
|
|
25
|
-
() =>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
() =>
|
|
26
|
+
_.merge(
|
|
27
|
+
{
|
|
28
|
+
breakpoints: {
|
|
29
|
+
values: {
|
|
30
|
+
xs: 0,
|
|
31
|
+
sm: 768,
|
|
32
|
+
md: 1024,
|
|
33
|
+
lg: 1266,
|
|
34
|
+
xl: 1440
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
direction: themeDirection,
|
|
38
|
+
mixins: {
|
|
39
|
+
toolbar: {
|
|
40
|
+
minHeight: 60,
|
|
41
|
+
paddingTop: 8,
|
|
42
|
+
paddingBottom: 8
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
palette: theme.palette,
|
|
46
|
+
customShadows: themeCustomShadows,
|
|
47
|
+
typography: themeTypography,
|
|
48
|
+
shadows: theme.shadows.map(() => 'none'),
|
|
49
|
+
components: {
|
|
50
|
+
MuiIconButton: {
|
|
51
|
+
styleOverrides: {
|
|
52
|
+
sizeExtraSmall: {
|
|
53
|
+
width: theme.spacing(2.6875),
|
|
54
|
+
height: theme.spacing(2.6875),
|
|
55
|
+
fontSize: '0.625rem'
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
33
59
|
}
|
|
34
60
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
toolbar: {
|
|
38
|
-
minHeight: 60,
|
|
39
|
-
paddingTop: 8,
|
|
40
|
-
paddingBottom: 8
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
palette: theme.palette,
|
|
44
|
-
customShadows: themeCustomShadows,
|
|
45
|
-
typography: themeTypography,
|
|
46
|
-
shadows: theme.shadows.map(() => 'none'),
|
|
47
|
-
},
|
|
48
|
-
typeof themeOverrides === 'function' ? themeOverrides(theme) : themeOverrides
|
|
49
|
-
),
|
|
61
|
+
typeof themeOverrides === 'function' ? themeOverrides(theme) : themeOverrides
|
|
62
|
+
),
|
|
50
63
|
[themeDirection, theme, themeTypography, themeCustomShadows, themeOverrides]
|
|
51
64
|
);
|
|
52
65
|
|
|
53
|
-
const themes = createTheme(themeOptions)
|
|
66
|
+
const themes = createTheme(themeOptions),
|
|
67
|
+
currentComponents = _.cloneDeep(themes.components ?? {});
|
|
54
68
|
|
|
55
|
-
themes.components = componentsOverride(themes);
|
|
69
|
+
themes.components = _.merge(componentsOverride(themes), currentComponents);
|
|
56
70
|
|
|
57
71
|
return (
|
|
58
72
|
<StyledEngineProvider injectFirst>
|
|
@@ -21,6 +21,11 @@ export default function IconButton(theme) {
|
|
|
21
21
|
width: theme.spacing(3.75),
|
|
22
22
|
height: theme.spacing(3.75),
|
|
23
23
|
fontSize: '0.75rem'
|
|
24
|
+
},
|
|
25
|
+
sizeExtraSmall: {
|
|
26
|
+
width: theme.spacing(2.6875),
|
|
27
|
+
height: theme.spacing(2.6875),
|
|
28
|
+
fontSize: '0.625rem'
|
|
24
29
|
}
|
|
25
30
|
}
|
|
26
31
|
}
|
package/vite.config.js
CHANGED
|
@@ -8,6 +8,11 @@ import { resolve } from 'node:path';
|
|
|
8
8
|
|
|
9
9
|
const { EsLinter, linterPlugin } = EsLint;
|
|
10
10
|
export default defineConfig((configEnv) => ({
|
|
11
|
+
resolve: {
|
|
12
|
+
alias: {
|
|
13
|
+
'@applica-software-guru/react-admin': resolve(__dirname, 'src')
|
|
14
|
+
}
|
|
15
|
+
},
|
|
11
16
|
plugins: [
|
|
12
17
|
dts({
|
|
13
18
|
include: ['./src/**/*.{js,jsx,ts,tsx}']
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const webpack = require('webpack');
|
|
2
|
-
const WorkBoxPlugin = require('workbox-webpack-plugin');
|
|
3
|
-
|
|
4
|
-
module.exports = function override(config) {
|
|
5
|
-
config.resolve.fallback = {
|
|
6
|
-
process: require.resolve('process/browser'),
|
|
7
|
-
// zlib: require.resolve('browserify-zlib'),
|
|
8
|
-
stream: require.resolve('stream-browserify'),
|
|
9
|
-
crypto: require.resolve('crypto-browserify'),
|
|
10
|
-
util: require.resolve('util'),
|
|
11
|
-
buffer: require.resolve('buffer')
|
|
12
|
-
// asset: require.resolve('assert')
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
// https://stackoverflow.com/questions/69135310/workaround-for-cache-size-limit-in-create-react-app-pwa-service-worker
|
|
16
|
-
config.plugins.forEach((plugin) => {
|
|
17
|
-
if (plugin instanceof WorkBoxPlugin.InjectManifest) {
|
|
18
|
-
plugin.config.maximumFileSizeToCacheInBytes = 50 * 1024 * 1024;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
config.plugins = [
|
|
23
|
-
...config.plugins,
|
|
24
|
-
new webpack.ProvidePlugin({
|
|
25
|
-
process: 'process/browser.js',
|
|
26
|
-
Buffer: ['buffer', 'Buffer']
|
|
27
|
-
})
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
return config;
|
|
31
|
-
};
|