@pie-lib/plot 5.0.1-next.20261004165705 → 5.0.1-next.20261004181842
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/dist/__tests__/label-theme.test.d.ts +1 -0
- package/dist/label.js +27 -27
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/label.js
CHANGED
|
@@ -3,17 +3,17 @@ import { useState as n } from "react";
|
|
|
3
3
|
import { styled as r } from "@mui/material/styles";
|
|
4
4
|
import i from "prop-types";
|
|
5
5
|
import * as a from "@pie-lib/render-ui";
|
|
6
|
-
import { Readable as o } from "@pie-lib/render-ui";
|
|
7
|
-
import { jsx as
|
|
8
|
-
import
|
|
6
|
+
import { Readable as o, color as s } from "@pie-lib/render-ui";
|
|
7
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
8
|
+
import l from "@pie-lib/editable-html-tip-tap";
|
|
9
9
|
//#region src/label.tsx
|
|
10
|
-
function
|
|
10
|
+
function u(e) {
|
|
11
11
|
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return !e ||
|
|
13
|
+
function d(e, t) {
|
|
14
|
+
return !e || u(e) ? e : u(e.default) ? e.default : t && u(e[t]) ? e[t] : t && u(e[t]?.default) ? e[t].default : e;
|
|
15
15
|
}
|
|
16
|
-
var
|
|
16
|
+
var f = d(o, "Readable") || d(h.Readable, "Readable"), p = a, m = p.default, h = m && typeof m == "object" ? m : p, g = {
|
|
17
17
|
axisLabel: {
|
|
18
18
|
fontSize: 12,
|
|
19
19
|
textAlign: "center",
|
|
@@ -32,7 +32,7 @@ var d = u(o, "Readable") || u(m.Readable, "Readable"), f = a, p = f.default, m =
|
|
|
32
32
|
},
|
|
33
33
|
editLabel: {
|
|
34
34
|
position: "absolute",
|
|
35
|
-
backgroundColor: "white",
|
|
35
|
+
backgroundColor: s.v("pie")("background", "white"),
|
|
36
36
|
borderRadius: 4,
|
|
37
37
|
boxShadow: "0px 5px 8px rgba(0,0,0,0.15)",
|
|
38
38
|
zIndex: 10
|
|
@@ -55,20 +55,20 @@ var d = u(o, "Readable") || u(m.Readable, "Readable"), f = a, p = f.default, m =
|
|
|
55
55
|
width: "100%",
|
|
56
56
|
textAlign: "center"
|
|
57
57
|
} }
|
|
58
|
-
},
|
|
59
|
-
...
|
|
58
|
+
}, _ = r("div")({ ...g.centerPlaceholder }), v = r("div")({
|
|
59
|
+
...g.disabledLabel,
|
|
60
60
|
"& p": { margin: 0 }
|
|
61
|
-
}),
|
|
62
|
-
let { disabledLabel: i, graphHeight: a, graphWidth: o, isChartBottomLabel:
|
|
61
|
+
}), y = (r) => {
|
|
62
|
+
let { disabledLabel: i, graphHeight: a, graphWidth: o, isChartBottomLabel: s, isDefineChartBottomLabel: u, isChartLeftLabel: d, isDefineChartLeftLabel: p, placeholder: m, text: h, side: y, onChange: b, mathMlOptions: x = {}, charactersLimit: S, titleHeight: C, preventNewLines: w } = r, [T, E] = n(!1), D = [
|
|
63
63
|
"bold",
|
|
64
64
|
"italic",
|
|
65
65
|
"underline",
|
|
66
66
|
"strikethrough",
|
|
67
67
|
"math"
|
|
68
|
-
], O =
|
|
68
|
+
], O = s || d || u || p, k = y === "left" && p && a - 220, A = {
|
|
69
69
|
width: k || (y === "left" || y === "right" ? a - 8 : o - 8),
|
|
70
|
-
top: k ||
|
|
71
|
-
left: y === "right" && `${o - 8}px` || (p || u) && "40px" ||
|
|
70
|
+
top: k || d && `${a - 70}px` || y === "left" && `${a - 8}px` || s && `${a - 60 + C}px` || y === "bottom" && `${a - 120 + C}px` || 0,
|
|
71
|
+
left: y === "right" && `${o - 8}px` || (p || u) && "40px" || s && "-10px" || 0
|
|
72
72
|
}, j = {
|
|
73
73
|
width: o - 8,
|
|
74
74
|
top: y === "right" ? `${a - 22}px` : 0,
|
|
@@ -80,21 +80,21 @@ var d = u(o, "Readable") || u(m.Readable, "Readable"), f = a, p = f.default, m =
|
|
|
80
80
|
document.activeElement?.blur?.();
|
|
81
81
|
});
|
|
82
82
|
}, P = (e) => !!(w && e.key === "Enter");
|
|
83
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ c(f, {
|
|
84
84
|
false: !0,
|
|
85
|
-
children: /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ c(_, {
|
|
86
86
|
onClick: M,
|
|
87
87
|
style: {
|
|
88
88
|
...T ? j : A,
|
|
89
|
-
...O ?
|
|
90
|
-
...y === "left" && !T ?
|
|
91
|
-
...y === "right" && !T ?
|
|
92
|
-
...T ?
|
|
93
|
-
...
|
|
94
|
-
...i && !O && t(e(
|
|
89
|
+
...O ? g.chartLabel : g.axisLabel,
|
|
90
|
+
...y === "left" && !T ? g.rotateLeftLabel : {},
|
|
91
|
+
...y === "right" && !T ? g.rotateRightLabel : {},
|
|
92
|
+
...T ? g.editLabel : {},
|
|
93
|
+
...s || u ? g.customBottom : {},
|
|
94
|
+
...i && !O && t(e(h)) && g.displayNone
|
|
95
95
|
},
|
|
96
|
-
children: i ? /* @__PURE__ */
|
|
97
|
-
markup:
|
|
96
|
+
children: i ? /* @__PURE__ */ c(v, { dangerouslySetInnerHTML: { __html: h || "" } }) : /* @__PURE__ */ c(l, {
|
|
97
|
+
markup: h || "",
|
|
98
98
|
onChange: b,
|
|
99
99
|
placeholder: !i && m,
|
|
100
100
|
toolbarOpts: {
|
|
@@ -112,7 +112,7 @@ var d = u(o, "Readable") || u(m.Readable, "Readable"), f = a, p = f.default, m =
|
|
|
112
112
|
})
|
|
113
113
|
});
|
|
114
114
|
};
|
|
115
|
-
|
|
115
|
+
y.propTypes = {
|
|
116
116
|
disabledLabel: i.bool,
|
|
117
117
|
graphHeight: i.number,
|
|
118
118
|
graphWidth: i.number,
|
|
@@ -129,4 +129,4 @@ v.propTypes = {
|
|
|
129
129
|
titleHeight: i.number
|
|
130
130
|
};
|
|
131
131
|
//#endregion
|
|
132
|
-
export {
|
|
132
|
+
export { y as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/plot",
|
|
3
|
-
"version": "5.0.1-next.
|
|
3
|
+
"version": "5.0.1-next.20261004181842",
|
|
4
4
|
"description": "Some underlying components for building charts/graphs",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@mapbox/point-geometry": "^1.1.0",
|
|
14
14
|
"@mui/icons-material": "^7.3.4",
|
|
15
15
|
"@mui/material": "^7.3.4",
|
|
16
|
-
"@pie-lib/editable-html-tip-tap": "3.0.1-next.
|
|
16
|
+
"@pie-lib/editable-html-tip-tap": "3.0.1-next.20261004181842",
|
|
17
17
|
"@pie-lib/render-ui": "8.0.1-next.20261004165705",
|
|
18
18
|
"assert": "^1.4.1",
|
|
19
19
|
"d3-scale": "^4.0.2",
|