@pie-lib/charting 8.0.0-next.35 → 8.0.0-next.37
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/mark-label.js +43 -38
- package/package.json +5 -5
package/dist/mark-label.js
CHANGED
|
@@ -13,7 +13,7 @@ var g = u("div")({
|
|
|
13
13
|
display: "flex",
|
|
14
14
|
flexDirection: "column",
|
|
15
15
|
alignItems: "center"
|
|
16
|
-
});
|
|
16
|
+
}), _ = m.disabledText();
|
|
17
17
|
u("input")(({ theme: e }) => ({
|
|
18
18
|
float: "right",
|
|
19
19
|
fontFamily: e.typography.fontFamily,
|
|
@@ -24,7 +24,7 @@ u("input")(({ theme: e }) => ({
|
|
|
24
24
|
"&.disabledMarkLabel": { backgroundColor: "transparent !important" },
|
|
25
25
|
"&.error": { border: `2px solid ${e.palette.error.main}` }
|
|
26
26
|
}));
|
|
27
|
-
var
|
|
27
|
+
var v = u("div")(({ theme: e }) => ({
|
|
28
28
|
pointerEvents: "auto",
|
|
29
29
|
textAlign: "center",
|
|
30
30
|
fontSize: e.typography.fontSize + 2,
|
|
@@ -33,90 +33,95 @@ var _ = u("div")(({ theme: e }) => ({
|
|
|
33
33
|
paddingTop: e.typography.fontSize / 2,
|
|
34
34
|
"&.disabledMarkLabel": {
|
|
35
35
|
...r("color"),
|
|
36
|
+
color: _,
|
|
36
37
|
backgroundColor: "transparent !important"
|
|
37
38
|
},
|
|
38
39
|
"&.error": { border: `2px solid ${e.palette.error.main}` },
|
|
39
40
|
"&.correct": { ...n("color") },
|
|
40
41
|
"&.incorrect": { ...i("color") }
|
|
41
42
|
}));
|
|
42
|
-
function
|
|
43
|
+
function y(e) {
|
|
43
44
|
let t = e?.trim() || "";
|
|
44
45
|
return (/* @__PURE__ */ new RegExp(/^[1-9]*[0-9]*\s?[1-9][0-9]*\/[1-9][0-9]*$/)).test(t);
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function b(e) {
|
|
47
48
|
let t = e?.trim() || "", n, r = "", i = t.split(" ");
|
|
48
49
|
n = i[1] && i[1].includes("/") ? i[1].split("/") || "" : t?.split("/") || "";
|
|
49
50
|
let a;
|
|
50
|
-
if (
|
|
51
|
+
if (y(e)) return i[0] && i[1] && (r = i[0]), a = `\\(${r}\\frac{${n[0]}}{${n[1]}}\\)`, a;
|
|
51
52
|
}
|
|
52
|
-
var
|
|
53
|
-
let [r, i] = c(null), l = a((e) => i(e), null), { mark: u = {}, disabled: d, inputRef: m, barWidth:
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
return
|
|
53
|
+
var x = (n) => {
|
|
54
|
+
let [r, i] = c(null), l = a((e) => i(e), null), { mark: u = {}, disabled: d, inputRef: m, barWidth: y, rotate: x, correctness: S, autoFocus: C, error: w, isHiddenLabel: T, limitCharacters: E, correctnessIndicator: D } = n, [O, k] = c(u.label), [A, j] = c(b(u.label)), [M, N] = c(!1), P = s(null), F = (e) => {
|
|
55
|
+
E && e.target.value && e.target.value.length > 20 || k(e.target.value);
|
|
56
|
+
}, I = () => M === !1 && A !== void 0, L = (e) => {
|
|
57
|
+
j(b(u.label)), N(!1), n.onChange(e.target.value);
|
|
58
|
+
}, R = {};
|
|
59
|
+
return x && (R = {
|
|
59
60
|
width: "unset",
|
|
60
61
|
textAlign: "left"
|
|
61
62
|
}), o(() => {
|
|
62
|
-
|
|
63
|
+
k(u.label);
|
|
63
64
|
}, [u.label]), o(() => {
|
|
64
|
-
let e =
|
|
65
|
-
e &&
|
|
66
|
-
}, [
|
|
65
|
+
let e = P.current;
|
|
66
|
+
e && A && (e.innerHTML = A, h(e));
|
|
67
|
+
}, [O, A]), /* @__PURE__ */ p(g, { children: [D, I() ? /* @__PURE__ */ f(v, {
|
|
67
68
|
ref: (e) => {
|
|
68
|
-
|
|
69
|
+
P.current = e, typeof m == "function" && m(e);
|
|
69
70
|
},
|
|
70
71
|
className: e({
|
|
71
72
|
disabledMarkLabel: d,
|
|
72
|
-
error:
|
|
73
|
-
correct: u.editable &&
|
|
74
|
-
incorrect: u.editable &&
|
|
73
|
+
error: w,
|
|
74
|
+
correct: u.editable && S?.label === "correct",
|
|
75
|
+
incorrect: u.editable && S?.label === "incorrect"
|
|
75
76
|
}),
|
|
76
|
-
onClick: () =>
|
|
77
|
+
onClick: () => N(!0),
|
|
77
78
|
style: {
|
|
78
|
-
minWidth:
|
|
79
|
+
minWidth: y,
|
|
79
80
|
position: "fixed",
|
|
80
81
|
transformOrigin: "left",
|
|
81
|
-
transform: `rotate(${
|
|
82
|
-
visibility:
|
|
83
|
-
marginTop:
|
|
82
|
+
transform: `rotate(${x}deg)`,
|
|
83
|
+
visibility: T ? "hidden" : "unset",
|
|
84
|
+
marginTop: D ? "24px" : "0"
|
|
84
85
|
}
|
|
85
86
|
}) : /* @__PURE__ */ f(t, {
|
|
86
87
|
inputRef: (e) => {
|
|
87
88
|
l(e), typeof m == "function" && m(e);
|
|
88
89
|
},
|
|
89
90
|
name: "mark-label-input",
|
|
90
|
-
autoFocus:
|
|
91
|
+
autoFocus: M || C,
|
|
91
92
|
disabled: d,
|
|
92
|
-
inputClassName: e(
|
|
93
|
+
inputClassName: e(S && u.editable ? S.label : null, d && "disabledMarkLabel", w && "error"),
|
|
93
94
|
inputStyle: {
|
|
94
|
-
minWidth:
|
|
95
|
+
minWidth: y,
|
|
95
96
|
textAlign: "center",
|
|
96
97
|
background: "transparent",
|
|
97
98
|
boxSizing: "border-box",
|
|
98
99
|
paddingLeft: 0,
|
|
99
100
|
paddingRight: 0,
|
|
100
101
|
border: "none",
|
|
101
|
-
...
|
|
102
|
+
...d ? {
|
|
103
|
+
color: _,
|
|
104
|
+
WebkitTextFillColor: _
|
|
105
|
+
} : {},
|
|
106
|
+
...R
|
|
102
107
|
},
|
|
103
|
-
value:
|
|
108
|
+
value: O,
|
|
104
109
|
style: {
|
|
105
110
|
position: "fixed",
|
|
106
111
|
pointerEvents: "auto",
|
|
107
112
|
top: 0,
|
|
108
113
|
left: 0,
|
|
109
|
-
minWidth:
|
|
114
|
+
minWidth: y,
|
|
110
115
|
transformOrigin: "left",
|
|
111
|
-
transform: `rotate(${
|
|
112
|
-
visibility:
|
|
113
|
-
marginTop:
|
|
116
|
+
transform: `rotate(${x}deg)`,
|
|
117
|
+
visibility: T ? "hidden" : "unset",
|
|
118
|
+
marginTop: D ? "24px" : "0"
|
|
114
119
|
},
|
|
115
|
-
onChange:
|
|
116
|
-
onBlur:
|
|
120
|
+
onChange: F,
|
|
121
|
+
onBlur: L
|
|
117
122
|
})] });
|
|
118
123
|
};
|
|
119
|
-
|
|
124
|
+
x.propTypes = {
|
|
120
125
|
autoFocus: l.bool,
|
|
121
126
|
disabled: l.bool,
|
|
122
127
|
error: l.any,
|
|
@@ -135,4 +140,4 @@ b.propTypes = {
|
|
|
135
140
|
correctnessIndicator: l.node
|
|
136
141
|
};
|
|
137
142
|
//#endregion
|
|
138
|
-
export {
|
|
143
|
+
export { x as MarkLabel, x as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/charting",
|
|
3
|
-
"version": "8.0.0-next.
|
|
3
|
+
"version": "8.0.0-next.37",
|
|
4
4
|
"description": "charting",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,9 +13,9 @@
|
|
|
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/plot": "5.0.0-next.
|
|
17
|
-
"@pie-lib/render-ui": "6.2.0-next.
|
|
18
|
-
"@pie-lib/translator": "5.0.0-next.
|
|
16
|
+
"@pie-lib/plot": "5.0.0-next.36",
|
|
17
|
+
"@pie-lib/render-ui": "6.2.0-next.42",
|
|
18
|
+
"@pie-lib/translator": "5.0.0-next.4",
|
|
19
19
|
"@visx/axis": "^4.0.0",
|
|
20
20
|
"@visx/event": "^4.0.0",
|
|
21
21
|
"@visx/grid": "^4.0.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"invariant": "^2.2.4",
|
|
30
30
|
"react-draggable": "^4.7.1",
|
|
31
31
|
"prop-types": "^15.8.1",
|
|
32
|
-
"@pie-lib/config-ui": "14.0.0-next.
|
|
32
|
+
"@pie-lib/config-ui": "14.0.0-next.36",
|
|
33
33
|
"@pie-element/shared-math-rendering-mathjax": "0.1.1-next.0",
|
|
34
34
|
"@pie-element/shared-lodash": "0.1.1-next.1",
|
|
35
35
|
"clsx": "^2.1.1",
|