@pie-lib/charting 8.0.8-next.20261102105711 → 8.0.8-next.20261102140134
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/actions-button.js +54 -35
- package/dist/mark-label.d.ts +1 -0
- package/dist/mark-label.js +1 -1
- package/package.json +3 -3
package/dist/actions-button.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import { getLabelMathFormat as e } from "./mark-label.js";
|
|
2
|
+
import t, { useEffect as n, useRef as r } from "react";
|
|
3
|
+
import i from "prop-types";
|
|
4
|
+
import { styled as a } from "@mui/material/styles";
|
|
5
|
+
import { color as o, createUniqueId as s } from "@pie-lib/render-ui";
|
|
6
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
+
import { renderMath as d } from "@pie-element/shared-math-rendering-mathjax";
|
|
8
|
+
import f from "@pie-lib/translator";
|
|
9
|
+
import p from "@mui/material/Menu";
|
|
10
|
+
import m from "@mui/material/MenuItem";
|
|
9
11
|
//#region src/actions-button.tsx
|
|
10
|
-
var { translator:
|
|
12
|
+
var { translator: h } = f, g = a("div")(() => ({ alignSelf: "flex-end" })), _ = a("button")(({ theme: e }) => ({
|
|
11
13
|
display: "block",
|
|
12
14
|
margin: 0,
|
|
13
15
|
border: 0,
|
|
@@ -15,16 +17,25 @@ var { translator: u } = s, d = n("div")(() => ({ alignSelf: "flex-end" })), f =
|
|
|
15
17
|
font: "inherit",
|
|
16
18
|
cursor: "pointer",
|
|
17
19
|
fontSize: e.typography.fontSize,
|
|
18
|
-
color:
|
|
20
|
+
color: o.defaults.TERTIARY,
|
|
19
21
|
padding: e.spacing(1),
|
|
20
22
|
"&:focus-visible": {
|
|
21
|
-
outline: `2px solid ${
|
|
23
|
+
outline: `2px solid ${o.focusOutline()}`,
|
|
22
24
|
outlineOffset: "-2px"
|
|
23
25
|
}
|
|
24
|
-
})),
|
|
26
|
+
})), v = a(m)(({ theme: e }) => ({
|
|
25
27
|
fontSize: e.typography.fontSize,
|
|
26
|
-
color:
|
|
27
|
-
})),
|
|
28
|
+
color: o.defaults.TEXT
|
|
29
|
+
})), y = ({ math: e }) => {
|
|
30
|
+
let t = r(null);
|
|
31
|
+
return n(() => {
|
|
32
|
+
let n = t.current;
|
|
33
|
+
n && (n.textContent = e, d(n));
|
|
34
|
+
}, [e]), /* @__PURE__ */ l("span", {
|
|
35
|
+
ref: t,
|
|
36
|
+
style: { pointerEvents: "none" }
|
|
37
|
+
});
|
|
38
|
+
}, b = class extends t.Component {
|
|
28
39
|
constructor(e) {
|
|
29
40
|
super(e), this.state = { actionsAnchorEl: null };
|
|
30
41
|
}
|
|
@@ -32,13 +43,13 @@ var { translator: u } = s, d = n("div")(() => ({ alignSelf: "flex-end" })), f =
|
|
|
32
43
|
this.setState({ actionsAnchorEl: null });
|
|
33
44
|
}
|
|
34
45
|
static propTypes = {
|
|
35
|
-
addCategory:
|
|
36
|
-
deleteCategory:
|
|
37
|
-
language:
|
|
38
|
-
categories:
|
|
46
|
+
addCategory: i.func.isRequired,
|
|
47
|
+
deleteCategory: i.func.isRequired,
|
|
48
|
+
language: i.string,
|
|
49
|
+
categories: i.array
|
|
39
50
|
};
|
|
40
|
-
triggerId =
|
|
41
|
-
menuId =
|
|
51
|
+
triggerId = s("chart-actions");
|
|
52
|
+
menuId = s("chart-actions-menu");
|
|
42
53
|
handleActionsClick = (e) => {
|
|
43
54
|
this.setState({ actionsAnchorEl: e.currentTarget });
|
|
44
55
|
};
|
|
@@ -54,22 +65,22 @@ var { translator: u } = s, d = n("div")(() => ({ alignSelf: "flex-end" })), f =
|
|
|
54
65
|
t(e), this.handleActionsClose();
|
|
55
66
|
};
|
|
56
67
|
render() {
|
|
57
|
-
let { categories:
|
|
68
|
+
let { categories: t, language: n } = this.props, { actionsAnchorEl: r } = this.state, i = !!r, a = (t || []).map((e, t) => ({
|
|
58
69
|
category: e,
|
|
59
70
|
index: t
|
|
60
71
|
})).filter(({ category: e }) => e.deletable && !e.correctness);
|
|
61
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ u(g, { children: [/* @__PURE__ */ l(_, {
|
|
62
73
|
type: "button",
|
|
63
74
|
id: this.triggerId,
|
|
64
75
|
"aria-haspopup": "menu",
|
|
65
|
-
"aria-expanded":
|
|
66
|
-
"aria-controls":
|
|
76
|
+
"aria-expanded": i,
|
|
77
|
+
"aria-controls": i ? this.menuId : void 0,
|
|
67
78
|
onClick: this.handleActionsClick,
|
|
68
|
-
children:
|
|
69
|
-
}), /* @__PURE__ */
|
|
79
|
+
children: h.t("charting.actions", { lng: n })
|
|
80
|
+
}), /* @__PURE__ */ u(p, {
|
|
70
81
|
id: this.menuId,
|
|
71
|
-
open:
|
|
72
|
-
anchorEl:
|
|
82
|
+
open: i,
|
|
83
|
+
anchorEl: r,
|
|
73
84
|
onClose: this.handleActionsClose,
|
|
74
85
|
variant: "menu",
|
|
75
86
|
anchorOrigin: {
|
|
@@ -81,15 +92,23 @@ var { translator: u } = s, d = n("div")(() => ({ alignSelf: "flex-end" })), f =
|
|
|
81
92
|
horizontal: "left"
|
|
82
93
|
},
|
|
83
94
|
slotProps: { list: { "aria-labelledby": this.triggerId } },
|
|
84
|
-
children: [/* @__PURE__ */
|
|
95
|
+
children: [/* @__PURE__ */ u(v, {
|
|
85
96
|
onClick: () => this.handleAddCategory(),
|
|
86
|
-
children: ["+ ",
|
|
87
|
-
}),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
97
|
+
children: ["+ ", h.t("charting.add", { lng: n })]
|
|
98
|
+
}), a.map(({ category: t, index: r }) => {
|
|
99
|
+
let i = h.t("charting.delete", { lng: n }), a = e(t.label), o = t.label || h.t("charting.newLabel", { lng: n });
|
|
100
|
+
return /* @__PURE__ */ l(v, {
|
|
101
|
+
"aria-label": a ? `${i} <${t.label.trim()}>` : void 0,
|
|
102
|
+
onClick: () => this.handleDeleteCategory(r),
|
|
103
|
+
children: a ? /* @__PURE__ */ u(c, { children: [
|
|
104
|
+
`${i} <`,
|
|
105
|
+
/* @__PURE__ */ l(y, { math: a }),
|
|
106
|
+
">"
|
|
107
|
+
] }) : `${i} <${o}>`
|
|
108
|
+
}, r);
|
|
109
|
+
})]
|
|
91
110
|
})] });
|
|
92
111
|
}
|
|
93
112
|
};
|
|
94
113
|
//#endregion
|
|
95
|
-
export {
|
|
114
|
+
export { b as ActionsButton, b as default };
|
package/dist/mark-label.d.ts
CHANGED
package/dist/mark-label.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/charting",
|
|
3
|
-
"version": "8.0.8-next.
|
|
3
|
+
"version": "8.0.8-next.20261102140134",
|
|
4
4
|
"description": "charting",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@mui/icons-material": "^7.3.4",
|
|
15
15
|
"@mui/material": "^7.3.4",
|
|
16
16
|
"@pie-element/shared-utils": "0.1.7-next.20261027193325",
|
|
17
|
-
"@pie-lib/plot": "5.0.8-next.
|
|
17
|
+
"@pie-lib/plot": "5.0.8-next.20261102140134",
|
|
18
18
|
"@pie-lib/render-ui": "8.0.8-next.20261027193325",
|
|
19
19
|
"@pie-lib/translator": "5.0.3-next.20261027184745",
|
|
20
20
|
"@visx/axis": "^4.0.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"invariant": "^2.2.4",
|
|
31
31
|
"react-draggable": "^4.7.2",
|
|
32
32
|
"prop-types": "^15.8.1",
|
|
33
|
-
"@pie-lib/config-ui": "14.0.8-next.
|
|
33
|
+
"@pie-lib/config-ui": "14.0.8-next.20261102140134",
|
|
34
34
|
"@pie-element/shared-math-rendering-mathjax": "0.1.9-next.20261026200905",
|
|
35
35
|
"@pie-element/shared-lodash": "0.1.4-next.20261026212738",
|
|
36
36
|
"clsx": "^2.1.1",
|