@m4l/widgets 0.6.0-beta-pkg-801-ajustes-mf-52.0 → 0.6.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartPie.d.ts","sourceRoot":"","sources":["../../../../../../packages/widgets/src/charts/ChartPie/ChartPie.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAUjE;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"ChartPie.d.ts","sourceRoot":"","sources":["../../../../../../packages/widgets/src/charts/ChartPie/ChartPie.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAUjE;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,aAAa,oDAsC3D;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
import { jsx as t, jsxs as o } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { CustomLegend as
|
|
5
|
-
import { ChartPieRootStyled as
|
|
6
|
-
import { useChartPieData as
|
|
7
|
-
import { useChartResize as
|
|
8
|
-
function
|
|
9
|
-
const e =
|
|
2
|
+
import d from "echarts-for-react";
|
|
3
|
+
import { useRef as f } from "react";
|
|
4
|
+
import { CustomLegend as c } from "./subcomponents/CustomLegend/CustomLegend.js";
|
|
5
|
+
import { ChartPieRootStyled as p, ChartPieParentStyled as u, ChartContainerStyled as C, LegendContainerStyled as y } from "./slots/ChartPieSlots.js";
|
|
6
|
+
import { useChartPieData as R } from "./hooks/useChartPieData.js";
|
|
7
|
+
import { useChartResize as g } from "./hooks/useChartResize.js";
|
|
8
|
+
function L({ values: n, size: a, sx: i }) {
|
|
9
|
+
const e = f(null), { data: r, options: s } = R(n), { setParentElement: h, onChartReady: l } = g(e), m = {
|
|
10
10
|
length: r.length
|
|
11
11
|
};
|
|
12
|
-
return /* @__PURE__ */ t(
|
|
13
|
-
/* @__PURE__ */ t(
|
|
14
|
-
|
|
12
|
+
return /* @__PURE__ */ t(p, { sx: i, children: /* @__PURE__ */ o(u, { children: [
|
|
13
|
+
/* @__PURE__ */ t(C, { ref: h, children: /* @__PURE__ */ t(
|
|
14
|
+
d,
|
|
15
15
|
{
|
|
16
16
|
ref: e,
|
|
17
|
-
option:
|
|
17
|
+
option: s,
|
|
18
18
|
style: { height: "100%", width: "100%" },
|
|
19
19
|
notMerge: !0,
|
|
20
|
-
lazyUpdate: !0
|
|
20
|
+
lazyUpdate: !0,
|
|
21
|
+
autoResize: !1,
|
|
22
|
+
onChartReady: l
|
|
21
23
|
}
|
|
22
24
|
) }),
|
|
23
|
-
/* @__PURE__ */ o(
|
|
25
|
+
/* @__PURE__ */ o(y, { ownerState: m, children: [
|
|
24
26
|
/* @__PURE__ */ t(
|
|
25
|
-
|
|
27
|
+
c,
|
|
26
28
|
{
|
|
27
29
|
data: r,
|
|
28
|
-
size:
|
|
30
|
+
size: a
|
|
29
31
|
}
|
|
30
32
|
),
|
|
31
33
|
" "
|
|
@@ -33,6 +35,6 @@ function E({ values: n, size: i, sx: a }) {
|
|
|
33
35
|
] }) });
|
|
34
36
|
}
|
|
35
37
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
L as ChartPie,
|
|
39
|
+
L as default
|
|
38
40
|
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { EChartsType } from 'echarts';
|
|
1
2
|
import { default as ReactECharts } from 'echarts-for-react';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* Resize a ready pie chart when its visible container size changes.
|
|
4
5
|
* @param chartRef - Reference to the chart element
|
|
5
|
-
* @returns
|
|
6
|
+
* @returns Parent reference setter and final chart readiness callback.
|
|
6
7
|
*/
|
|
7
|
-
export declare function useChartResize(chartRef: React.RefObject<ReactECharts | null>):
|
|
8
|
+
export declare function useChartResize(chartRef: React.RefObject<ReactECharts | null>): {
|
|
9
|
+
setParentElement: import('react').Dispatch<import('react').SetStateAction<HTMLDivElement | null>>;
|
|
10
|
+
onChartReady: (instance: EChartsType) => void;
|
|
11
|
+
};
|
|
8
12
|
//# sourceMappingURL=useChartResize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChartResize.d.ts","sourceRoot":"","sources":["../../../../../../../packages/widgets/src/charts/ChartPie/hooks/useChartResize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"useChartResize.d.ts","sourceRoot":"","sources":["../../../../../../../packages/widgets/src/charts/ChartPie/hooks/useChartResize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC;;6BAwB/B,WAAW;EAkBxD"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { useState as h, useRef as d, useCallback as u, useLayoutEffect as f } from "react";
|
|
2
|
+
function m(o) {
|
|
3
|
+
const [n, a] = h(null), c = d(null), t = u(() => {
|
|
4
|
+
const e = o.current?.getEchartsInstance();
|
|
5
|
+
if (!e || e !== c.current || e.isDisposed())
|
|
6
|
+
return;
|
|
7
|
+
const r = e.getDom(), s = r.clientWidth, i = r.clientHeight;
|
|
8
|
+
!r.isConnected || s <= 0 || i <= 0 || (e.getWidth() !== s || e.getHeight() !== i) && e.resize({ width: s, height: i, animation: { duration: 0 } });
|
|
9
|
+
}, [o]), l = u((e) => {
|
|
10
|
+
c.current = e, t();
|
|
11
|
+
}, [t]);
|
|
12
|
+
return f(() => {
|
|
13
|
+
if (!n)
|
|
14
|
+
return;
|
|
15
|
+
const e = new ResizeObserver(t);
|
|
16
|
+
return e.observe(n), t(), () => e.disconnect();
|
|
17
|
+
}, [n, t]), { setParentElement: a, onChartReady: l };
|
|
14
18
|
}
|
|
15
19
|
export {
|
|
16
|
-
|
|
20
|
+
m as useChartResize
|
|
17
21
|
};
|