@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.
Files changed (59) hide show
  1. package/.eslintrc.json +3 -0
  2. package/README.md +14 -0
  3. package/dist/ApplicaAdmin.d.ts +1 -1
  4. package/dist/react-admin.cjs.js +45 -45
  5. package/dist/react-admin.cjs.js.map +1 -1
  6. package/dist/react-admin.es.js +3091 -3075
  7. package/dist/react-admin.es.js.map +1 -1
  8. package/dist/react-admin.umd.js +44 -44
  9. package/dist/react-admin.umd.js.map +1 -1
  10. package/dist/themes/index.d.ts.map +1 -1
  11. package/dist/themes/overrides/IconButton.d.ts +5 -0
  12. package/dist/themes/overrides/IconButton.d.ts.map +1 -1
  13. package/index.html +13 -0
  14. package/package.json +1 -1
  15. package/src/main.tsx +10 -0
  16. package/{playground/src/App.js → src/playground/App.jsx} +2 -2
  17. package/{playground/src/components/index.js → src/playground/components/index.jsx} +1 -0
  18. package/{playground/src/components/ra-lists/DeviceList.js → src/playground/components/ra-lists/DeviceList.jsx} +1 -1
  19. package/{playground/src/config.js → src/playground/config.jsx} +1 -1
  20. package/{playground/src/entities/device.js → src/playground/entities/device.jsx} +1 -1
  21. package/{playground/src/entities/i18n-message.js → src/playground/entities/i18n-message.jsx} +1 -1
  22. package/{playground/src/entities/user.js → src/playground/entities/user.jsx} +2 -2
  23. package/src/playground/hooks/index.jsx +1 -0
  24. package/{playground/src/theme.js → src/playground/theme.jsx} +1 -1
  25. package/src/themes/index.jsx +40 -26
  26. package/src/themes/overrides/IconButton.jsx +5 -0
  27. package/vite.config.js +5 -0
  28. package/playground/config-overrides.js +0 -31
  29. package/playground/jsconfig.json +0 -9
  30. package/playground/package-lock.json +0 -17777
  31. package/playground/package.json +0 -69
  32. package/playground/public/favicon-dark.png +0 -0
  33. package/playground/public/favicon-light.png +0 -0
  34. package/playground/public/index.html +0 -46
  35. package/playground/src/hooks/index.js +0 -1
  36. package/playground/src/react-app-env.d.js +0 -1
  37. /package/{playground/src → src/playground}/.prettierrc +0 -0
  38. /package/{playground/src → src/playground}/build.json +0 -0
  39. /package/{playground/src → src/playground}/components/pages/CustomPage.jsx +0 -0
  40. /package/{playground/src → src/playground}/components/pages/index.jsx +0 -0
  41. /package/{playground/src/components/ra-buttons/index.js → src/playground/components/ra-buttons/index.jsx} +0 -0
  42. /package/{playground/src/components/ra-fields/UserPictureField.js → src/playground/components/ra-fields/UserPictureField.jsx} +0 -0
  43. /package/{playground/src/components/ra-fields/index.js → src/playground/components/ra-fields/index.jsx} +0 -0
  44. /package/{playground/src/components/ra-forms/DeviceForm.js → src/playground/components/ra-forms/DeviceForm.jsx} +0 -0
  45. /package/{playground/src/components/ra-forms/I18nMessageForm.js → src/playground/components/ra-forms/I18nMessageForm.jsx} +0 -0
  46. /package/{playground/src/components/ra-forms/UserForm.js → src/playground/components/ra-forms/UserForm.jsx} +0 -0
  47. /package/{playground/src/components/ra-forms/index.js → src/playground/components/ra-forms/index.jsx} +0 -0
  48. /package/{playground/src/components/ra-inputs/LangSelectInput.js → src/playground/components/ra-inputs/LangSelectInput.jsx} +0 -0
  49. /package/{playground/src/components/ra-inputs/YesOrNoSelectInput.js → src/playground/components/ra-inputs/YesOrNoSelectInput.jsx} +0 -0
  50. /package/{playground/src/components/ra-inputs/index.js → src/playground/components/ra-inputs/index.jsx} +0 -0
  51. /package/{playground/src/components/ra-lists/I18nMessageList.js → src/playground/components/ra-lists/I18nMessageList.jsx} +0 -0
  52. /package/{playground/src/components/ra-lists/UserList.js → src/playground/components/ra-lists/UserList.jsx} +0 -0
  53. /package/{playground/src/components/ra-lists/index.js → src/playground/components/ra-lists/index.jsx} +0 -0
  54. /package/{playground/src/contexts/index.js → src/playground/contexts/index.jsx} +0 -0
  55. /package/{playground/src/entities/index.js → src/playground/entities/index.jsx} +0 -0
  56. /package/{playground/src/entities/notification.js → src/playground/entities/notification.jsx} +0 -0
  57. /package/{playground/src/index.js → src/playground/index.jsx} +0 -0
  58. /package/{playground/src/menu.js → src/playground/menu.jsx} +0 -0
  59. /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;;;4CAkDC;;;;;;;sBAvDqB,aAAa;sBACb,aAAa;sBAJb,YAAY"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/themes/index.jsx"],"names":[],"mappings":"AAcA;;;4CAgEC;;;;;;;sBArEqB,aAAa;sBACb,aAAa;sBAJb,YAAY"}
@@ -19,6 +19,11 @@ export default function IconButton(theme: any): {
19
19
  height: any;
20
20
  fontSize: string;
21
21
  };
22
+ sizeExtraSmall: {
23
+ width: any;
24
+ height: any;
25
+ fontSize: string;
26
+ };
22
27
  };
23
28
  };
24
29
  };
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/themes/overrides/IconButton.jsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;EAyBC"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applica-software-guru/react-admin",
3
- "version": "1.0.56",
3
+ "version": "1.0.58",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
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';
@@ -3,3 +3,4 @@ export * from './ra-inputs';
3
3
  export * from './ra-fields';
4
4
  export * from './ra-forms';
5
5
  export * from './ra-buttons';
6
+ export * from './pages';
@@ -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,6 +1,6 @@
1
1
  let environment = 'PRODUCTION';
2
2
  let appUrl = `//${document.location.host}/`;
3
- if (appUrl.endsWith(':3000/')) {
3
+ if (appUrl.endsWith(':3000/') || appUrl.indexOf(':51') !== -1) {
4
4
  appUrl = 'http://localhost:8080/';
5
5
  environment = 'DEVELOPER';
6
6
  }
@@ -1,5 +1,5 @@
1
1
  import { Create, Edit } from '@applica-software-guru/react-admin';
2
- import { DeviceForm, DeviceList } from 'components';
2
+ import { DeviceForm, DeviceList } from '../components';
3
3
  const DeviceCreate = () => (
4
4
  <Create>
5
5
  <DeviceForm />
@@ -1,5 +1,5 @@
1
1
  import { Create, Edit } from '@applica-software-guru/react-admin';
2
- import { I18nMessageForm, I18nMessageList } from 'components';
2
+ import { I18nMessageForm, I18nMessageList } from '../components';
3
3
 
4
4
  import { FlagOutlined } from '@ant-design/icons';
5
5
 
@@ -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 {};
@@ -1,4 +1,4 @@
1
- const theme = (theme) => ({
1
+ const theme = () => ({
2
2
  components: {
3
3
  MuiPaper: {
4
4
  styleOverrides: {}
@@ -1,4 +1,4 @@
1
- import _ from "lodash";
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
- () => _.merge({
26
- breakpoints: {
27
- values: {
28
- xs: 0,
29
- sm: 768,
30
- md: 1024,
31
- lg: 1266,
32
- xl: 1440
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
- direction: themeDirection,
36
- mixins: {
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
- };
@@ -1,9 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "module": "commonjs",
5
- "baseUrl": "src"
6
- },
7
- "include": ["src/**/*"],
8
- "exclude": ["node_modules"]
9
- }