yaml-admin-front 0.0.22 → 0.0.23

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/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "yaml-admin-front",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "license": "MIT",
5
- "type": "module",
5
+ "type": "commonjs",
6
6
  "description": "React components for yaml-admin front (library)",
7
7
  "main": "src/index.js",
8
8
  "scripts": {},
@@ -6,8 +6,11 @@ import {
6
6
  import { useNavigate } from 'react-router-dom';
7
7
  import { useAdminContext } from '../AdminContext';
8
8
  import Chart from "react-apexcharts";
9
+ import { Box } from '@mui/material';
9
10
  import { fetcher } from '../common/axios';
10
11
 
12
+ const Chart2 = typeof Chart === 'object' ? Chart.default : Chart;
13
+
11
14
  export const YAMLComponent = ({ component, custom, ...props }) => {
12
15
  const navigate = useNavigate()
13
16
  const refresh = useRefresh();
@@ -21,14 +24,14 @@ export const YAMLComponent = ({ component, custom, ...props }) => {
21
24
  }, [component.id]);
22
25
 
23
26
  return (
24
- <div>
25
- {data && <Chart
27
+ <Box>
28
+ {data && component && <Chart2
26
29
  height={component.height || 300}
27
30
  options={data.options}
28
31
  series={data.series}
29
32
  type={component?.type}
30
33
  />}
31
- </div>
34
+ </Box>
32
35
  )
33
36
  };
34
37