@pie-lib/charting 8.0.1-next.20261003161149 → 8.0.1-next.20261004005223
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-name.test.d.ts +1 -0
- package/dist/actions-button.js +9 -9
- package/dist/axes.d.ts +1 -0
- package/dist/axes.js +78 -70
- package/dist/chart.js +2 -1
- package/dist/key-legend.js +6 -6
- package/dist/mark-label.d.ts +1 -0
- package/dist/mark-label.js +20 -18
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/actions-button.js
CHANGED
|
@@ -3,17 +3,17 @@ import t from "prop-types";
|
|
|
3
3
|
import { styled as n } from "@mui/material/styles";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
import { color as a } from "@pie-lib/render-ui";
|
|
6
|
-
import o from "@
|
|
7
|
-
import s from "@mui/material/
|
|
8
|
-
import c from "@mui/material/
|
|
9
|
-
import l from "@
|
|
6
|
+
import o from "@pie-lib/translator";
|
|
7
|
+
import s from "@mui/material/Button";
|
|
8
|
+
import c from "@mui/material/Popover";
|
|
9
|
+
import l from "@mui/material/Paper";
|
|
10
10
|
//#region src/actions-button.tsx
|
|
11
|
-
var { translator: u } =
|
|
11
|
+
var { translator: u } = o, d = n("div")(() => ({ alignSelf: "flex-end" })), f = n("div")(({ theme: e }) => ({
|
|
12
12
|
cursor: "pointer",
|
|
13
13
|
fontSize: e.typography.fontSize,
|
|
14
14
|
color: a.tertiary(),
|
|
15
15
|
padding: e.spacing(1)
|
|
16
|
-
})), p = n(
|
|
16
|
+
})), p = n(l)(({ theme: e }) => ({
|
|
17
17
|
padding: e.spacing(1),
|
|
18
18
|
display: "flex",
|
|
19
19
|
flexDirection: "column",
|
|
@@ -58,7 +58,7 @@ var { translator: u } = l, d = n("div")(() => ({ alignSelf: "flex-end" })), f =
|
|
|
58
58
|
tabIndex: 0,
|
|
59
59
|
onClick: this.handleActionsClick,
|
|
60
60
|
children: "Actions"
|
|
61
|
-
}), /* @__PURE__ */ r(
|
|
61
|
+
}), /* @__PURE__ */ r(c, {
|
|
62
62
|
open: !!n,
|
|
63
63
|
anchorEl: n,
|
|
64
64
|
onClose: this.handleActionsClose,
|
|
@@ -70,10 +70,10 @@ var { translator: u } = l, d = n("div")(() => ({ alignSelf: "flex-end" })), f =
|
|
|
70
70
|
vertical: "top",
|
|
71
71
|
horizontal: "left"
|
|
72
72
|
},
|
|
73
|
-
children: /* @__PURE__ */ i(p, { children: [/* @__PURE__ */ i(
|
|
73
|
+
children: /* @__PURE__ */ i(p, { children: [/* @__PURE__ */ i(s, {
|
|
74
74
|
onClick: () => this.handleAddCategory(),
|
|
75
75
|
children: ["+ ", u.t("charting.add", { lng: t })]
|
|
76
|
-
}), e.length > 0 && e.map((e, n) => e.deletable && !e.correctness && /* @__PURE__ */ r(
|
|
76
|
+
}), e.length > 0 && e.map((e, n) => e.deletable && !e.correctness && /* @__PURE__ */ r(s, {
|
|
77
77
|
onClick: () => this.handleDeleteCategory(n),
|
|
78
78
|
children: `${u.t("charting.delete", { lng: t })} <${e.label || u.t("charting.newLabel", { lng: t })}>`
|
|
79
79
|
}, n))] })
|
package/dist/axes.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export declare class RawChartAxes extends React.Component {
|
|
|
59
59
|
hiddenLabelRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.InferProps<{
|
|
60
60
|
current: PropTypes.Requireable<Element>;
|
|
61
61
|
}> | null | undefined>>;
|
|
62
|
+
language: PropTypes.Requireable<string>;
|
|
62
63
|
};
|
|
63
64
|
state: {
|
|
64
65
|
height: number;
|
package/dist/axes.js
CHANGED
|
@@ -12,23 +12,24 @@ import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
|
12
12
|
import { color as m } from "@pie-lib/render-ui";
|
|
13
13
|
import h from "@mui/material/Checkbox";
|
|
14
14
|
import { renderMath as g } from "@pie-element/shared-math-rendering-mathjax";
|
|
15
|
+
import _ from "@pie-lib/translator";
|
|
15
16
|
//#region src/axes.tsx
|
|
16
|
-
var _ = /* @__PURE__ */ new Set(),
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}),
|
|
17
|
+
var { translator: v } = _, y = /* @__PURE__ */ new Set(), b = null;
|
|
18
|
+
function x(e) {
|
|
19
|
+
y.add(e), !b && typeof document < "u" && (b = new MutationObserver(() => {
|
|
20
|
+
y.forEach((e) => e());
|
|
21
|
+
}), b.observe(document.body, {
|
|
21
22
|
childList: !0,
|
|
22
23
|
subtree: !0
|
|
23
24
|
}));
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
26
|
+
function S(e) {
|
|
27
|
+
y.delete(e), y.size === 0 && b && (b.disconnect(), b = null);
|
|
27
28
|
}
|
|
28
|
-
var
|
|
29
|
+
var C = l("text")(({ theme: e }) => ({
|
|
29
30
|
fontSize: e.typography.fontSize - 2,
|
|
30
31
|
fill: e.palette.error.main
|
|
31
|
-
})),
|
|
32
|
+
})), w = l(h)(() => ({ color: `${m.tertiary()} !important` })), T = l("g")(({ theme: e }) => ({
|
|
32
33
|
"& .vx-axis-line": {
|
|
33
34
|
stroke: m.visualElementsColors.AXIS_LINE_COLOR,
|
|
34
35
|
strokeWidth: 2
|
|
@@ -43,7 +44,7 @@ var x = l("text")(({ theme: e }) => ({
|
|
|
43
44
|
fontSize: e.typography.fontSize,
|
|
44
45
|
textAnchor: "middle"
|
|
45
46
|
}
|
|
46
|
-
})),
|
|
47
|
+
})), E = (e) => ({
|
|
47
48
|
borderRadius: e.spacing(2),
|
|
48
49
|
color: m.defaults.WHITE,
|
|
49
50
|
fontSize: "16px",
|
|
@@ -52,7 +53,7 @@ var x = l("text")(({ theme: e }) => ({
|
|
|
52
53
|
padding: "2px",
|
|
53
54
|
border: `1px solid ${m.defaults.WHITE}`,
|
|
54
55
|
boxSizing: "unset"
|
|
55
|
-
}),
|
|
56
|
+
}), D = { backgroundColor: m.incorrectWithIcon() }, O = { backgroundColor: m.correct() }, k = class extends s.Component {
|
|
56
57
|
static propTypes = {
|
|
57
58
|
defineChart: c.bool,
|
|
58
59
|
error: c.any
|
|
@@ -112,16 +113,16 @@ var x = l("text")(({ theme: e }) => ({
|
|
|
112
113
|
return n;
|
|
113
114
|
};
|
|
114
115
|
render() {
|
|
115
|
-
let { categories: e, xBand: t, bandWidth: i, barWidth: a, rotate: s, top: c, graphProps: l, defineChart: u, chartingOptions: m, x: h, y: g, formattedValue: _, changeInteractiveEnabled:
|
|
116
|
+
let { categories: e, xBand: t, bandWidth: i, barWidth: a, rotate: s, top: c, graphProps: l, defineChart: u, chartingOptions: m, x: h, y: g, formattedValue: _, changeInteractiveEnabled: y, changeEditableEnabled: b, error: x, autoFocus: S, hiddenLabelRef: T, showCorrectness: k, language: A } = this.props;
|
|
116
117
|
if (!_) return null;
|
|
117
|
-
let
|
|
118
|
-
correctnessIcon:
|
|
119
|
-
incorrectIcon:
|
|
120
|
-
correctIcon:
|
|
121
|
-
}, { dialog:
|
|
118
|
+
let j = {
|
|
119
|
+
correctnessIcon: E,
|
|
120
|
+
incorrectIcon: D,
|
|
121
|
+
correctIcon: O
|
|
122
|
+
}, { dialog: M } = this.state, { changeEditable: N, changeInteractive: P } = m || {}, F = parseInt(_.split("-")[0], 10), I = e[F], { editable: L, interactive: R, label: z, correctness: B } = I || {}, V = t(r({ label: z }, F)), H = (e || []).reduce((e, t) => (e && e.label ? e.label.length : 0) > (t && t.label ? t.label.length : 0) ? e : t, { label: "" }), U = x ? [...new Set(Object.values(x))].join(" ") : "";
|
|
122
123
|
return /* @__PURE__ */ p("g", { children: [
|
|
123
124
|
/* @__PURE__ */ p("foreignObject", {
|
|
124
|
-
x: i ?
|
|
125
|
+
x: i ? V : h - a / 2,
|
|
125
126
|
y: 18,
|
|
126
127
|
width: a,
|
|
127
128
|
height: 4,
|
|
@@ -129,42 +130,46 @@ var x = l("text")(({ theme: e }) => ({
|
|
|
129
130
|
pointerEvents: "none",
|
|
130
131
|
overflow: "visible"
|
|
131
132
|
},
|
|
132
|
-
children: [
|
|
133
|
+
children: [F === 0 && /* @__PURE__ */ f(o, {
|
|
133
134
|
isHiddenLabel: !0,
|
|
134
|
-
inputRef:
|
|
135
|
+
inputRef: T,
|
|
135
136
|
disabled: !0,
|
|
136
|
-
mark:
|
|
137
|
+
mark: H,
|
|
137
138
|
graphProps: l,
|
|
138
139
|
barWidth: a
|
|
139
140
|
}), /* @__PURE__ */ f(o, {
|
|
140
|
-
autoFocus: u &&
|
|
141
|
+
autoFocus: u && S,
|
|
141
142
|
inputRef: (e) => this.input = e,
|
|
142
|
-
disabled: !u && !
|
|
143
|
-
mark:
|
|
143
|
+
disabled: !u && !L,
|
|
144
|
+
mark: I,
|
|
144
145
|
graphProps: l,
|
|
145
|
-
onChange: (e) => this.changeCategory(
|
|
146
|
+
onChange: (e) => this.changeCategory(F, e),
|
|
146
147
|
barWidth: a,
|
|
147
148
|
rotate: s,
|
|
148
|
-
correctness:
|
|
149
|
-
error:
|
|
149
|
+
correctness: B,
|
|
150
|
+
error: x && x[F],
|
|
151
|
+
ariaLabel: v.t("charting.categoryLabel", {
|
|
152
|
+
lng: A,
|
|
153
|
+
index: F + 1
|
|
154
|
+
}),
|
|
150
155
|
limitCharacters: !0,
|
|
151
|
-
correctnessIndicator:
|
|
152
|
-
correctness:
|
|
153
|
-
interactive:
|
|
154
|
-
classes:
|
|
156
|
+
correctnessIndicator: k && B && /* @__PURE__ */ f(n, {
|
|
157
|
+
correctness: B,
|
|
158
|
+
interactive: R,
|
|
159
|
+
classes: j
|
|
155
160
|
})
|
|
156
161
|
})]
|
|
157
162
|
}),
|
|
158
|
-
|
|
163
|
+
x && F === 0 && /* @__PURE__ */ f(C, {
|
|
159
164
|
y: g + 23,
|
|
160
165
|
height: 6,
|
|
161
166
|
textAnchor: "start",
|
|
162
|
-
children:
|
|
167
|
+
children: U
|
|
163
168
|
}),
|
|
164
|
-
u &&
|
|
169
|
+
u && F === 0 && /* @__PURE__ */ p("svg", {
|
|
165
170
|
x: -55,
|
|
166
171
|
style: { overflow: "visible" },
|
|
167
|
-
children: [
|
|
172
|
+
children: [y && /* @__PURE__ */ f("text", {
|
|
168
173
|
y: g + 90 + c,
|
|
169
174
|
width: a,
|
|
170
175
|
height: 4,
|
|
@@ -175,12 +180,12 @@ var x = l("text")(({ theme: e }) => ({
|
|
|
175
180
|
maxWidth: a,
|
|
176
181
|
display: "inline-block"
|
|
177
182
|
},
|
|
178
|
-
children: this.splitText(
|
|
183
|
+
children: this.splitText(P?.authoringLabel, 20).map((e, t) => /* @__PURE__ */ f("tspan", {
|
|
179
184
|
x: "0",
|
|
180
185
|
dy: `${t > 0 ? "1.2em" : ".6em"}`,
|
|
181
186
|
children: e
|
|
182
187
|
}, t))
|
|
183
|
-
}),
|
|
188
|
+
}), b && /* @__PURE__ */ f("text", {
|
|
184
189
|
y: g + 145 + c,
|
|
185
190
|
width: a,
|
|
186
191
|
height: 4,
|
|
@@ -191,14 +196,14 @@ var x = l("text")(({ theme: e }) => ({
|
|
|
191
196
|
maxWidth: a,
|
|
192
197
|
display: "inline-block"
|
|
193
198
|
},
|
|
194
|
-
children: this.splitText(
|
|
199
|
+
children: this.splitText(N?.authoringLabel, 20).map((e, t) => /* @__PURE__ */ f("tspan", {
|
|
195
200
|
x: "0",
|
|
196
201
|
dy: `${t > 0 ? "1.2em" : ".6em"}`,
|
|
197
202
|
children: e
|
|
198
203
|
}, t))
|
|
199
204
|
})]
|
|
200
205
|
}),
|
|
201
|
-
u &&
|
|
206
|
+
u && y && /* @__PURE__ */ f("foreignObject", {
|
|
202
207
|
x: h - 24,
|
|
203
208
|
y: g + 80 + c,
|
|
204
209
|
width: a,
|
|
@@ -207,13 +212,13 @@ var x = l("text")(({ theme: e }) => ({
|
|
|
207
212
|
pointerEvents: "visible",
|
|
208
213
|
overflow: "visible"
|
|
209
214
|
},
|
|
210
|
-
children: /* @__PURE__ */ f(
|
|
215
|
+
children: /* @__PURE__ */ f(w, {
|
|
211
216
|
style: { position: "fixed" },
|
|
212
|
-
checked:
|
|
213
|
-
onChange: (e) => this.changeInteractive(
|
|
217
|
+
checked: R,
|
|
218
|
+
onChange: (e) => this.changeInteractive(F, e.target.checked)
|
|
214
219
|
})
|
|
215
220
|
}),
|
|
216
|
-
u &&
|
|
221
|
+
u && b && /* @__PURE__ */ f("foreignObject", {
|
|
217
222
|
x: h - 24,
|
|
218
223
|
y: g + 130 + c,
|
|
219
224
|
width: a,
|
|
@@ -222,10 +227,10 @@ var x = l("text")(({ theme: e }) => ({
|
|
|
222
227
|
pointerEvents: "visible",
|
|
223
228
|
overflow: "visible"
|
|
224
229
|
},
|
|
225
|
-
children: /* @__PURE__ */ f(
|
|
230
|
+
children: /* @__PURE__ */ f(w, {
|
|
226
231
|
style: { position: "fixed" },
|
|
227
|
-
checked:
|
|
228
|
-
onChange: (e) => this.changeEditable(
|
|
232
|
+
checked: L,
|
|
233
|
+
onChange: (e) => this.changeEditable(F, e.target.checked)
|
|
229
234
|
})
|
|
230
235
|
}),
|
|
231
236
|
/* @__PURE__ */ f("foreignObject", {
|
|
@@ -238,17 +243,17 @@ var x = l("text")(({ theme: e }) => ({
|
|
|
238
243
|
overflow: "visible"
|
|
239
244
|
},
|
|
240
245
|
children: /* @__PURE__ */ f(d, {
|
|
241
|
-
open:
|
|
242
|
-
title:
|
|
243
|
-
text:
|
|
244
|
-
onClose:
|
|
245
|
-
onConfirm:
|
|
246
|
+
open: M.open,
|
|
247
|
+
title: M.title,
|
|
248
|
+
text: M.text,
|
|
249
|
+
onClose: M.onClose,
|
|
250
|
+
onConfirm: M.onConfirm
|
|
246
251
|
})
|
|
247
252
|
})
|
|
248
253
|
] });
|
|
249
254
|
}
|
|
250
255
|
};
|
|
251
|
-
|
|
256
|
+
k.propTypes = {
|
|
252
257
|
categories: c.array,
|
|
253
258
|
xBand: c.func,
|
|
254
259
|
bandWidth: c.number,
|
|
@@ -269,9 +274,10 @@ D.propTypes = {
|
|
|
269
274
|
autoFocus: c.bool,
|
|
270
275
|
onAutoFocusUsed: c.func,
|
|
271
276
|
showCorrectness: c.bool,
|
|
272
|
-
hiddenLabelRef: c.oneOfType([c.func, c.shape({ current: c.instanceOf(Element) })])
|
|
277
|
+
hiddenLabelRef: c.oneOfType([c.func, c.shape({ current: c.instanceOf(Element) })]),
|
|
278
|
+
language: c.string
|
|
273
279
|
};
|
|
274
|
-
var
|
|
280
|
+
var A = class extends s.Component {
|
|
275
281
|
static propTypes = {
|
|
276
282
|
bottomScale: c.func,
|
|
277
283
|
categories: c.array,
|
|
@@ -290,7 +296,8 @@ var O = class extends s.Component {
|
|
|
290
296
|
autoFocus: c.bool,
|
|
291
297
|
onAutoFocusUsed: c.func,
|
|
292
298
|
showCorrectness: c.bool,
|
|
293
|
-
hiddenLabelRef: c.oneOfType([c.func, c.shape({ current: c.instanceOf(Element) })])
|
|
299
|
+
hiddenLabelRef: c.oneOfType([c.func, c.shape({ current: c.instanceOf(Element) })]),
|
|
300
|
+
language: c.string
|
|
294
301
|
};
|
|
295
302
|
state = {
|
|
296
303
|
height: 0,
|
|
@@ -310,7 +317,7 @@ var O = class extends s.Component {
|
|
|
310
317
|
observeHiddenLabel = (e) => {
|
|
311
318
|
if (!e) return;
|
|
312
319
|
let t = e.querySelector("[data-latex], [data-raw]");
|
|
313
|
-
t && g(e), (e.querySelector("mjx-container") || !t) && this.measureHiddenLabel(),
|
|
320
|
+
t && g(e), (e.querySelector("mjx-container") || !t) && this.measureHiddenLabel(), x(this._onDocMutation);
|
|
314
321
|
};
|
|
315
322
|
setHiddenLabelRef = (e) => {
|
|
316
323
|
e && e !== this.hiddenLabelRef && (this.hiddenLabelRef = e, this.observeHiddenLabel(e));
|
|
@@ -319,38 +326,38 @@ var O = class extends s.Component {
|
|
|
319
326
|
this.hiddenLabelRef && this.observeHiddenLabel(this.hiddenLabelRef);
|
|
320
327
|
}
|
|
321
328
|
componentWillUnmount() {
|
|
322
|
-
|
|
329
|
+
S(this._onDocMutation), this._updateTimer && clearTimeout(this._updateTimer);
|
|
323
330
|
}
|
|
324
331
|
componentDidUpdate(e) {
|
|
325
332
|
e.categories !== this.props.categories && (this._updateTimer && clearTimeout(this._updateTimer), this._updateTimer = setTimeout(() => this.measureHiddenLabel(), 50));
|
|
326
333
|
}
|
|
327
334
|
render() {
|
|
328
|
-
let { graphProps: n, xBand: r, leftAxis: o, onChange: s, onChangeCategory: c, categories: l = [], top: u, defineChart: d, chartingOptions: m, changeInteractiveEnabled: h, changeEditableEnabled: g, theme: _, autoFocus: v, onAutoFocusUsed: y, error: b, showCorrectness: x } = this.props, { scale:
|
|
335
|
+
let { graphProps: n, xBand: r, leftAxis: o, onChange: s, onChangeCategory: c, categories: l = [], top: u, defineChart: d, chartingOptions: m, changeInteractiveEnabled: h, changeEditableEnabled: g, theme: _, autoFocus: v, onAutoFocusUsed: y, error: b, showCorrectness: x, language: S } = this.props, { scale: C = {}, range: w = {}, domain: E = {}, size: D = {} } = n || {}, { height: O, width: A } = this.state, j = r && typeof r.rangeRound == "function" && r.rangeRound([0, D.width]), M = r && typeof r.bandwidth == "function" && r.bandwidth(), N = M || C.x && C.x(E.max) / l.length, P = a({
|
|
329
336
|
...w,
|
|
330
337
|
step: w.labelStep
|
|
331
|
-
}),
|
|
332
|
-
return /* @__PURE__ */ p(
|
|
333
|
-
scale:
|
|
338
|
+
}), F = i(_ && _.typography ? _.typography.fontSize : 14, O), I = A > N ? 25 : 0;
|
|
339
|
+
return /* @__PURE__ */ p(T, { children: [o && /* @__PURE__ */ f(e, {
|
|
340
|
+
scale: C.y,
|
|
334
341
|
tickLength: 10,
|
|
335
342
|
tickFormat: (e) => e,
|
|
336
|
-
tickValues:
|
|
343
|
+
tickValues: P,
|
|
337
344
|
tickLabelProps: (e) => ({
|
|
338
345
|
dy: 4,
|
|
339
346
|
dx: -10 - (e.toLocaleString().length || 1) * 5
|
|
340
347
|
})
|
|
341
348
|
}), /* @__PURE__ */ f(t, {
|
|
342
|
-
scale:
|
|
349
|
+
scale: j,
|
|
343
350
|
labelProps: { y: 60 + u },
|
|
344
|
-
top:
|
|
351
|
+
top: C.y && C.y(w.min),
|
|
345
352
|
textLabelProps: () => ({ textAnchor: "middle" }),
|
|
346
353
|
tickFormat: (e) => e,
|
|
347
|
-
tickComponent: (e) => /* @__PURE__ */ f(
|
|
354
|
+
tickComponent: (e) => /* @__PURE__ */ f(k, {
|
|
348
355
|
hiddenLabelRef: this.setHiddenLabelRef,
|
|
349
356
|
categories: l,
|
|
350
357
|
xBand: r,
|
|
351
|
-
bandWidth:
|
|
352
|
-
barWidth:
|
|
353
|
-
rotate:
|
|
358
|
+
bandWidth: M,
|
|
359
|
+
barWidth: N,
|
|
360
|
+
rotate: F || I,
|
|
354
361
|
top: u,
|
|
355
362
|
defineChart: d,
|
|
356
363
|
chartingOptions: m,
|
|
@@ -365,7 +372,8 @@ var O = class extends s.Component {
|
|
|
365
372
|
x: e.x,
|
|
366
373
|
y: e.y,
|
|
367
374
|
formattedValue: e.formattedValue,
|
|
368
|
-
showCorrectness: x
|
|
375
|
+
showCorrectness: x,
|
|
376
|
+
language: S
|
|
369
377
|
}),
|
|
370
378
|
autoFocus: v,
|
|
371
379
|
onAutoFocusUsed: y
|
|
@@ -373,4 +381,4 @@ var O = class extends s.Component {
|
|
|
373
381
|
}
|
|
374
382
|
};
|
|
375
383
|
//#endregion
|
|
376
|
-
export {
|
|
384
|
+
export { A as RawChartAxes, A as default, k as TickComponent };
|
package/dist/chart.js
CHANGED
|
@@ -195,7 +195,8 @@ var { translator: y } = v, b = d("pie-lib:charts:chart"), x = u("div")(() => ({
|
|
|
195
195
|
changeEditableEnabled: E,
|
|
196
196
|
top: Z,
|
|
197
197
|
error: O,
|
|
198
|
-
showCorrectness: N === "linePlot" || N === "dotPlot"
|
|
198
|
+
showCorrectness: N === "linePlot" || N === "dotPlot",
|
|
199
|
+
language: A
|
|
199
200
|
}),
|
|
200
201
|
w ? /* @__PURE__ */ g("foreignObject", {
|
|
201
202
|
x: I,
|
package/dist/key-legend.js
CHANGED
|
@@ -3,9 +3,9 @@ import e from "prop-types";
|
|
|
3
3
|
import { styled as t } from "@mui/material/styles";
|
|
4
4
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
5
|
import { color as i } from "@pie-lib/render-ui";
|
|
6
|
-
import a from "@
|
|
7
|
-
import o from "@mui/icons-material/
|
|
8
|
-
import s from "@
|
|
6
|
+
import a from "@pie-lib/translator";
|
|
7
|
+
import o from "@mui/icons-material/Check";
|
|
8
|
+
import s from "@mui/icons-material/Close";
|
|
9
9
|
//#region src/key-legend.tsx
|
|
10
10
|
var c = t("div")(({ theme: e }) => ({
|
|
11
11
|
backgroundColor: i.defaults.WHITE,
|
|
@@ -22,11 +22,11 @@ var c = t("div")(({ theme: e }) => ({
|
|
|
22
22
|
})), u = t("div")(({ theme: e }) => ({
|
|
23
23
|
fontSize: e.typography.h6.fontSize,
|
|
24
24
|
fontWeight: "700"
|
|
25
|
-
})), d = t("div")(() => ({ marginLeft: "2px" })), f = t(
|
|
25
|
+
})), d = t("div")(() => ({ marginLeft: "2px" })), f = t(o)(({ theme: e }) => ({
|
|
26
26
|
backgroundColor: i.correct(),
|
|
27
27
|
borderRadius: e.spacing(2),
|
|
28
28
|
color: i.defaults.WHITE
|
|
29
|
-
})), p = t(
|
|
29
|
+
})), p = t(s)(({ theme: e }) => ({
|
|
30
30
|
backgroundColor: i.incorrectWithIcon(),
|
|
31
31
|
borderRadius: e.spacing(2),
|
|
32
32
|
color: i.defaults.WHITE
|
|
@@ -35,7 +35,7 @@ var c = t("div")(({ theme: e }) => ({
|
|
|
35
35
|
display: "flex",
|
|
36
36
|
alignItems: "center",
|
|
37
37
|
gap: "12px"
|
|
38
|
-
})), { translator: h } =
|
|
38
|
+
})), { translator: h } = a, g = ({ language: e }) => /* @__PURE__ */ r(c, { children: [
|
|
39
39
|
/* @__PURE__ */ n(u, { children: "Key" }),
|
|
40
40
|
/* @__PURE__ */ r(l, { children: [/* @__PURE__ */ n(p, {}), /* @__PURE__ */ n("div", { children: h.t("charting.keyLegend.incorrectAnswer", { lng: e }) })] }),
|
|
41
41
|
/* @__PURE__ */ r(l, { children: [/* @__PURE__ */ n(f, {}), /* @__PURE__ */ n("div", { children: h.t("charting.keyLegend.correctAnswer", { lng: e }) })] }),
|
package/dist/mark-label.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export declare const MarkLabel: {
|
|
|
42
42
|
isHiddenLabel: PropTypes.Requireable<boolean>;
|
|
43
43
|
limitCharacters: PropTypes.Requireable<boolean>;
|
|
44
44
|
correctnessIndicator: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
45
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
45
46
|
};
|
|
46
47
|
};
|
|
47
48
|
export default MarkLabel;
|
package/dist/mark-label.js
CHANGED
|
@@ -51,22 +51,22 @@ function b(e) {
|
|
|
51
51
|
if (y(e)) return i[0] && i[1] && (r = i[0]), a = `\\(${r}\\frac{${n[0]}}{${n[1]}}\\)`, a;
|
|
52
52
|
}
|
|
53
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, [
|
|
55
|
-
E && e.target.value && e.target.value.length > 20 ||
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
return x && (
|
|
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, ariaLabel: O } = n, [k, A] = c(u.label), [j, M] = c(b(u.label)), [N, P] = c(!1), F = s(null), I = (e) => {
|
|
55
|
+
E && e.target.value && e.target.value.length > 20 || A(e.target.value);
|
|
56
|
+
}, L = () => N === !1 && j !== void 0, R = (e) => {
|
|
57
|
+
M(b(u.label)), P(!1), n.onChange(e.target.value);
|
|
58
|
+
}, z = {};
|
|
59
|
+
return x && (z = {
|
|
60
60
|
width: "unset",
|
|
61
61
|
textAlign: "left"
|
|
62
62
|
}), o(() => {
|
|
63
|
-
|
|
63
|
+
A(u.label);
|
|
64
64
|
}, [u.label]), o(() => {
|
|
65
|
-
let e =
|
|
66
|
-
e &&
|
|
67
|
-
}, [
|
|
65
|
+
let e = F.current;
|
|
66
|
+
e && j && (e.innerHTML = j, h(e));
|
|
67
|
+
}, [k, j]), /* @__PURE__ */ p(g, { children: [D, L() ? /* @__PURE__ */ f(v, {
|
|
68
68
|
ref: (e) => {
|
|
69
|
-
|
|
69
|
+
F.current = e, typeof m == "function" && m(e);
|
|
70
70
|
},
|
|
71
71
|
className: e({
|
|
72
72
|
disabledMarkLabel: d,
|
|
@@ -74,7 +74,7 @@ var x = (n) => {
|
|
|
74
74
|
correct: u.editable && S?.label === "correct",
|
|
75
75
|
incorrect: u.editable && S?.label === "incorrect"
|
|
76
76
|
}),
|
|
77
|
-
onClick: () =>
|
|
77
|
+
onClick: () => P(!0),
|
|
78
78
|
style: {
|
|
79
79
|
minWidth: y,
|
|
80
80
|
position: "fixed",
|
|
@@ -88,7 +88,8 @@ var x = (n) => {
|
|
|
88
88
|
l(e), typeof m == "function" && m(e);
|
|
89
89
|
},
|
|
90
90
|
name: "mark-label-input",
|
|
91
|
-
|
|
91
|
+
"aria-label": O,
|
|
92
|
+
autoFocus: N || C,
|
|
92
93
|
disabled: d,
|
|
93
94
|
inputClassName: e(S && u.editable ? S.label : null, d && "disabledMarkLabel", w && "error"),
|
|
94
95
|
inputStyle: {
|
|
@@ -103,9 +104,9 @@ var x = (n) => {
|
|
|
103
104
|
color: _,
|
|
104
105
|
WebkitTextFillColor: _
|
|
105
106
|
} : {},
|
|
106
|
-
...
|
|
107
|
+
...z
|
|
107
108
|
},
|
|
108
|
-
value:
|
|
109
|
+
value: k,
|
|
109
110
|
style: {
|
|
110
111
|
position: "fixed",
|
|
111
112
|
pointerEvents: "auto",
|
|
@@ -117,8 +118,8 @@ var x = (n) => {
|
|
|
117
118
|
visibility: T ? "hidden" : "unset",
|
|
118
119
|
marginTop: D ? "24px" : "0"
|
|
119
120
|
},
|
|
120
|
-
onChange:
|
|
121
|
-
onBlur:
|
|
121
|
+
onChange: I,
|
|
122
|
+
onBlur: R
|
|
122
123
|
})] });
|
|
123
124
|
};
|
|
124
125
|
x.propTypes = {
|
|
@@ -137,7 +138,8 @@ x.propTypes = {
|
|
|
137
138
|
}),
|
|
138
139
|
isHiddenLabel: l.bool,
|
|
139
140
|
limitCharacters: l.bool,
|
|
140
|
-
correctnessIndicator: l.node
|
|
141
|
+
correctnessIndicator: l.node,
|
|
142
|
+
ariaLabel: l.string
|
|
141
143
|
};
|
|
142
144
|
//#endregion
|
|
143
145
|
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.1-next.
|
|
3
|
+
"version": "8.0.1-next.20261004005223",
|
|
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.1-next.
|
|
16
|
+
"@pie-lib/plot": "5.0.1-next.20261004003105",
|
|
17
17
|
"@pie-lib/render-ui": "8.0.1-next.20261003161149",
|
|
18
|
-
"@pie-lib/translator": "5.0.1-next.
|
|
18
|
+
"@pie-lib/translator": "5.0.1-next.20261004005223",
|
|
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.1-next.
|
|
32
|
+
"@pie-lib/config-ui": "14.0.1-next.20261004003105",
|
|
33
33
|
"@pie-element/shared-math-rendering-mathjax": "0.1.2-next.20261003161149",
|
|
34
34
|
"@pie-element/shared-lodash": "0.1.2-next.20261002215153",
|
|
35
35
|
"clsx": "^2.1.1",
|