@pie-lib/charting 8.0.4-next.20261009061152 → 8.0.4-next.20261010144103
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__/mark-label-fraction.test.d.ts +1 -0
- package/dist/actions-button.d.ts +1 -0
- package/dist/actions-button.js +28 -33
- package/dist/axes.js +1 -1
- package/dist/mark-label.js +19 -20
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/actions-button.d.ts
CHANGED
package/dist/actions-button.js
CHANGED
|
@@ -4,11 +4,10 @@ import { styled as n } from "@mui/material/styles";
|
|
|
4
4
|
import { color as r, createUniqueId as i } from "@pie-lib/render-ui";
|
|
5
5
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
6
|
import s from "@pie-lib/translator";
|
|
7
|
-
import c from "@mui/material/
|
|
8
|
-
import l from "@mui/material/
|
|
9
|
-
import u from "@mui/material/Paper";
|
|
7
|
+
import c from "@mui/material/Menu";
|
|
8
|
+
import l from "@mui/material/MenuItem";
|
|
10
9
|
//#region src/actions-button.tsx
|
|
11
|
-
var { translator:
|
|
10
|
+
var { translator: u } = s, d = n("div")(() => ({ alignSelf: "flex-end" })), f = n("button")(({ theme: e }) => ({
|
|
12
11
|
display: "block",
|
|
13
12
|
margin: 0,
|
|
14
13
|
border: 0,
|
|
@@ -16,24 +15,16 @@ var { translator: d } = s, f = n("div")(() => ({ alignSelf: "flex-end" })), p =
|
|
|
16
15
|
font: "inherit",
|
|
17
16
|
cursor: "pointer",
|
|
18
17
|
fontSize: e.typography.fontSize,
|
|
19
|
-
color: r.
|
|
18
|
+
color: r.defaults.TERTIARY,
|
|
20
19
|
padding: e.spacing(1),
|
|
21
20
|
"&:focus-visible": {
|
|
22
21
|
outline: `2px solid ${r.focusOutline()}`,
|
|
23
22
|
outlineOffset: "-2px"
|
|
24
23
|
}
|
|
25
|
-
})),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
gap: e.spacing(1),
|
|
30
|
-
"& button": {
|
|
31
|
-
textTransform: "none",
|
|
32
|
-
fontSize: e.typography.fontSize,
|
|
33
|
-
color: r.text(),
|
|
34
|
-
justifyContent: "flex-start"
|
|
35
|
-
}
|
|
36
|
-
})), h = class extends e.Component {
|
|
24
|
+
})), p = n(l)(({ theme: e }) => ({
|
|
25
|
+
fontSize: e.typography.fontSize,
|
|
26
|
+
color: r.text()
|
|
27
|
+
})), m = class extends e.Component {
|
|
37
28
|
constructor(e) {
|
|
38
29
|
super(e), this.state = { actionsAnchorEl: null };
|
|
39
30
|
}
|
|
@@ -47,6 +38,7 @@ var { translator: d } = s, f = n("div")(() => ({ alignSelf: "flex-end" })), p =
|
|
|
47
38
|
categories: t.array
|
|
48
39
|
};
|
|
49
40
|
triggerId = i("chart-actions");
|
|
41
|
+
menuId = i("chart-actions-menu");
|
|
50
42
|
handleActionsClick = (e) => {
|
|
51
43
|
this.setState({ actionsAnchorEl: e.currentTarget });
|
|
52
44
|
};
|
|
@@ -62,18 +54,24 @@ var { translator: d } = s, f = n("div")(() => ({ alignSelf: "flex-end" })), p =
|
|
|
62
54
|
t(e), this.handleActionsClose();
|
|
63
55
|
};
|
|
64
56
|
render() {
|
|
65
|
-
let { categories: e, language: t } = this.props, { actionsAnchorEl: n } = this.state, r = !!n
|
|
66
|
-
|
|
57
|
+
let { categories: e, language: t } = this.props, { actionsAnchorEl: n } = this.state, r = !!n, i = (e || []).map((e, t) => ({
|
|
58
|
+
category: e,
|
|
59
|
+
index: t
|
|
60
|
+
})).filter(({ category: e }) => e.deletable && !e.correctness);
|
|
61
|
+
return /* @__PURE__ */ o(d, { children: [/* @__PURE__ */ a(f, {
|
|
67
62
|
type: "button",
|
|
68
63
|
id: this.triggerId,
|
|
69
|
-
"aria-haspopup": "
|
|
64
|
+
"aria-haspopup": "menu",
|
|
70
65
|
"aria-expanded": r,
|
|
66
|
+
"aria-controls": r ? this.menuId : void 0,
|
|
71
67
|
onClick: this.handleActionsClick,
|
|
72
|
-
children:
|
|
73
|
-
}), /* @__PURE__ */
|
|
68
|
+
children: u.t("charting.actions", { lng: t })
|
|
69
|
+
}), /* @__PURE__ */ o(c, {
|
|
70
|
+
id: this.menuId,
|
|
74
71
|
open: r,
|
|
75
72
|
anchorEl: n,
|
|
76
73
|
onClose: this.handleActionsClose,
|
|
74
|
+
variant: "menu",
|
|
77
75
|
anchorOrigin: {
|
|
78
76
|
vertical: "bottom",
|
|
79
77
|
horizontal: "left"
|
|
@@ -82,19 +80,16 @@ var { translator: d } = s, f = n("div")(() => ({ alignSelf: "flex-end" })), p =
|
|
|
82
80
|
vertical: "top",
|
|
83
81
|
horizontal: "left"
|
|
84
82
|
},
|
|
85
|
-
slotProps: {
|
|
86
|
-
|
|
87
|
-
"aria-labelledby": this.triggerId
|
|
88
|
-
} },
|
|
89
|
-
children: /* @__PURE__ */ o(m, { children: [/* @__PURE__ */ o(c, {
|
|
83
|
+
slotProps: { list: { "aria-labelledby": this.triggerId } },
|
|
84
|
+
children: [/* @__PURE__ */ o(p, {
|
|
90
85
|
onClick: () => this.handleAddCategory(),
|
|
91
|
-
children: ["+ ",
|
|
92
|
-
}),
|
|
86
|
+
children: ["+ ", u.t("charting.add", { lng: t })]
|
|
87
|
+
}), i.map(({ category: e, index: n }) => /* @__PURE__ */ a(p, {
|
|
93
88
|
onClick: () => this.handleDeleteCategory(n),
|
|
94
|
-
children: `${
|
|
95
|
-
}, n))]
|
|
96
|
-
}
|
|
89
|
+
children: `${u.t("charting.delete", { lng: t })} <${e.label || u.t("charting.newLabel", { lng: t })}>`
|
|
90
|
+
}, n))]
|
|
91
|
+
})] });
|
|
97
92
|
}
|
|
98
93
|
};
|
|
99
94
|
//#endregion
|
|
100
|
-
export {
|
|
95
|
+
export { m as ActionsButton, m as default };
|
package/dist/axes.js
CHANGED
package/dist/mark-label.js
CHANGED
|
@@ -14,7 +14,7 @@ var _ = u("div")({
|
|
|
14
14
|
display: "flex",
|
|
15
15
|
flexDirection: "column",
|
|
16
16
|
alignItems: "center"
|
|
17
|
-
}), v = f.
|
|
17
|
+
}), v = f.defaults.DISABLED_TEXT;
|
|
18
18
|
u("input")(({ theme: e }) => ({
|
|
19
19
|
float: "right",
|
|
20
20
|
fontFamily: e.typography.fontFamily,
|
|
@@ -30,8 +30,7 @@ var y = u("div")(({ theme: e }) => ({
|
|
|
30
30
|
textAlign: "center",
|
|
31
31
|
fontSize: e.typography.fontSize + 2,
|
|
32
32
|
fontFamily: e.typography.fontFamily,
|
|
33
|
-
color: f.
|
|
34
|
-
paddingTop: e.typography.fontSize / 2,
|
|
33
|
+
color: f.defaults.PRIMARY_DARK,
|
|
35
34
|
"&.disabledMarkLabel": {
|
|
36
35
|
...r("color"),
|
|
37
36
|
color: v,
|
|
@@ -56,24 +55,24 @@ function x(e) {
|
|
|
56
55
|
if (b(e)) return i[0] && i[1] && (r = i[0]), a = `\\(${r}\\frac{${n[0]}}{${n[1]}}\\)`, a;
|
|
57
56
|
}
|
|
58
57
|
var S = (n) => {
|
|
59
|
-
let [r, i] = c(null), l = a((e) => i(e), null), { mark: u = {}, disabled: d, inputRef: f, barWidth: b, rotate: S, correctness: C, autoFocus: w, error: T, isHiddenLabel: E, limitCharacters: D, correctnessIndicator: O, ariaLabel: k, mathAriaLabel: A } = n, [j, M] = c(u.label), [N, P] = c(
|
|
58
|
+
let [r, i] = c(null), l = a((e) => i(e), null), { mark: u = {}, disabled: d, inputRef: f, barWidth: b, rotate: S, correctness: C, autoFocus: w, error: T, isHiddenLabel: E, limitCharacters: D, correctnessIndicator: O, ariaLabel: k, mathAriaLabel: A } = n, [j, M] = c(u.label), [N, P] = c(u.label), [F, I] = c(!1), L = x(N), R = s(null), z = (e) => {
|
|
60
59
|
D && e.target.value && e.target.value.length > 20 || M(e.target.value);
|
|
61
|
-
},
|
|
62
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
63
|
-
},
|
|
64
|
-
P(
|
|
65
|
-
},
|
|
66
|
-
return S && (
|
|
60
|
+
}, B = () => F === !1 && L !== void 0, V = () => I(!0), H = (e) => {
|
|
61
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), V());
|
|
62
|
+
}, U = (e) => {
|
|
63
|
+
P(e.target.value), I(!1), n.onChange(e.target.value);
|
|
64
|
+
}, W = {};
|
|
65
|
+
return S && (W = {
|
|
67
66
|
width: "unset",
|
|
68
67
|
textAlign: "left"
|
|
69
68
|
}), o(() => {
|
|
70
|
-
M(u.label);
|
|
69
|
+
M(u.label), P(u.label);
|
|
71
70
|
}, [u.label]), o(() => {
|
|
72
|
-
let e =
|
|
73
|
-
e &&
|
|
74
|
-
}, [
|
|
71
|
+
let e = R.current;
|
|
72
|
+
e && L && !F && (e.innerHTML = g(L), h(e));
|
|
73
|
+
}, [L, F]), /* @__PURE__ */ m(_, { children: [O, B() ? /* @__PURE__ */ p(y, {
|
|
75
74
|
ref: (e) => {
|
|
76
|
-
|
|
75
|
+
R.current = e, typeof f == "function" && f(e);
|
|
77
76
|
},
|
|
78
77
|
"data-math-label": !0,
|
|
79
78
|
className: e({
|
|
@@ -86,8 +85,8 @@ var S = (n) => {
|
|
|
86
85
|
role: "button",
|
|
87
86
|
tabIndex: 0,
|
|
88
87
|
"aria-label": A || k,
|
|
89
|
-
onClick:
|
|
90
|
-
onKeyDown:
|
|
88
|
+
onClick: V,
|
|
89
|
+
onKeyDown: H
|
|
91
90
|
},
|
|
92
91
|
style: {
|
|
93
92
|
minWidth: b,
|
|
@@ -118,7 +117,7 @@ var S = (n) => {
|
|
|
118
117
|
color: v,
|
|
119
118
|
WebkitTextFillColor: v
|
|
120
119
|
} : {},
|
|
121
|
-
...
|
|
120
|
+
...W
|
|
122
121
|
},
|
|
123
122
|
value: j,
|
|
124
123
|
style: {
|
|
@@ -132,8 +131,8 @@ var S = (n) => {
|
|
|
132
131
|
visibility: E ? "hidden" : "unset",
|
|
133
132
|
marginTop: O ? "24px" : "0"
|
|
134
133
|
},
|
|
135
|
-
onChange:
|
|
136
|
-
onBlur:
|
|
134
|
+
onChange: z,
|
|
135
|
+
onBlur: U
|
|
137
136
|
})] });
|
|
138
137
|
};
|
|
139
138
|
S.propTypes = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/charting",
|
|
3
|
-
"version": "8.0.4-next.
|
|
3
|
+
"version": "8.0.4-next.20261010144103",
|
|
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.4-next.20261008072957",
|
|
17
|
-
"@pie-lib/plot": "5.0.4-next.
|
|
17
|
+
"@pie-lib/plot": "5.0.4-next.20261010144103",
|
|
18
18
|
"@pie-lib/render-ui": "8.0.4-next.20261009061152",
|
|
19
19
|
"@pie-lib/translator": "5.0.2-next.20261006160832",
|
|
20
20
|
"@visx/axis": "^4.0.0",
|