@thebuoyant-tsdev/mui-ts-library 3.29.1 → 3.30.0
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/README.de.md +59 -1
- package/README.md +59 -1
- package/dist/components/chord-chart/ChordChart.js +112 -112
- package/dist/components/circle-packing-chart/CirclePackingChart.js +135 -135
- package/dist/components/color-picker/ColorPicker.js +217 -217
- package/dist/components/color-picker/PopoverColorPicker.js +7 -7
- package/dist/components/date-range-picker/DateRangePicker.js +9 -9
- package/dist/components/gantt-chart/GanttChart.js +18 -18
- package/dist/components/gantt-chart/GanttTaskDialog.js +43 -43
- package/dist/components/gantt-chart/GanttTaskPanel.js +128 -128
- package/dist/components/gantt-chart/GanttTimeline.js +16 -16
- package/dist/components/gantt-chart/GanttToolbar.js +24 -24
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +244 -244
- package/dist/components/json-editor/JsonEditor.js +9 -9
- package/dist/components/json-editor/JsonEditorContent.js +54 -54
- package/dist/components/json-editor/JsonEditorToolbar.js +12 -12
- package/dist/components/kanban-board/KanbanBoard.d.ts +2 -0
- package/dist/components/kanban-board/KanbanBoard.js +129 -0
- package/dist/components/kanban-board/KanbanBoard.types.d.ts +84 -0
- package/dist/components/kanban-board/KanbanBoard.types.js +19 -0
- package/dist/components/kanban-board/KanbanBoardCard.d.ts +13 -0
- package/dist/components/kanban-board/KanbanBoardCard.js +104 -0
- package/dist/components/kanban-board/KanbanBoardCardDialog.d.ts +23 -0
- package/dist/components/kanban-board/KanbanBoardCardDialog.js +120 -0
- package/dist/components/kanban-board/KanbanBoardColumn.d.ts +14 -0
- package/dist/components/kanban-board/KanbanBoardColumn.js +129 -0
- package/dist/components/kanban-board/kanbanBoardClasses.d.ts +47 -0
- package/dist/components/kanban-board/kanbanBoardClasses.js +18 -0
- package/dist/components/password-strength-meter/PasswordStrengthMeter.js +27 -27
- package/dist/components/radial-stacked-bar-chart/RadialStackedBarChart.js +48 -48
- package/dist/components/radial-tree-chart/RadialTreeChart.js +173 -173
- package/dist/components/rich-text-editor/RichTextEditor.js +32 -32
- package/dist/components/rich-text-editor/RichTextEditorColorPicker.js +20 -20
- package/dist/components/rich-text-editor/RichTextEditorEmojiPicker.js +12 -12
- package/dist/components/rich-text-editor/RichTextEditorImageDialog.js +11 -11
- package/dist/components/rich-text-editor/RichTextEditorLinkDialog.js +11 -11
- package/dist/components/rich-text-editor/RichTextEditorMarkdownDialog.js +14 -14
- package/dist/components/rich-text-editor/RichTextEditorMentionList.js +14 -14
- package/dist/components/rich-text-editor/RichTextEditorTableMenu.js +28 -28
- package/dist/components/rich-text-editor/RichTextEditorToolbar.js +35 -35
- package/dist/components/sql-editor/SqlEditor.js +24 -24
- package/dist/components/sql-editor/SqlEditorContent.js +16 -16
- package/dist/components/sql-editor/SqlEditorHistoryMenu.js +15 -15
- package/dist/components/sql-editor/SqlEditorToolbar.js +21 -21
- package/dist/components/sunburst-chart/SunburstChart.js +126 -126
- package/dist/components/tag-selection/TagSelection.js +18 -18
- package/dist/components/tag-selection/TagSelectionAutocomplete.js +120 -120
- package/dist/components/tag-selection/TagSelectionSelectedTags.js +10 -10
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +38 -35
- package/package.json +9 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ToolbarButton as e } from "../shared/ToolbarButton.js";
|
|
2
2
|
import { SqlEditorHistoryMenu as t } from "./SqlEditorHistoryMenu.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Box as n, Divider as r } from "@mui/material";
|
|
4
|
+
import { useState as i } from "react";
|
|
5
5
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
-
import
|
|
7
|
-
import u from "@
|
|
8
|
-
import d from "@mui/icons-material/
|
|
9
|
-
import f from "@mui/icons-material/
|
|
6
|
+
import c from "@mui/icons-material/Delete";
|
|
7
|
+
import { redo as l, undo as u } from "@codemirror/commands";
|
|
8
|
+
import d from "@mui/icons-material/ContentCopy";
|
|
9
|
+
import f from "@mui/icons-material/Check";
|
|
10
10
|
import p from "@mui/icons-material/Undo";
|
|
11
11
|
import m from "@mui/icons-material/Redo";
|
|
12
12
|
import h from "@mui/icons-material/AutoFixHigh";
|
|
@@ -21,7 +21,7 @@ var v = {
|
|
|
21
21
|
mssql: "tsql"
|
|
22
22
|
};
|
|
23
23
|
function y({ editorView: y, toolbarConfig: b, translation: x, dialect: S, disabled: C, onExecute: w, queryHistory: T = [], onSelectHistoryEntry: E, onClearHistory: D }) {
|
|
24
|
-
let [O, k] =
|
|
24
|
+
let [O, k] = i(!1), A = C || !y;
|
|
25
25
|
function j() {
|
|
26
26
|
let e = y?.state.doc.toString() ?? "";
|
|
27
27
|
navigator.clipboard.writeText(e).then(() => {
|
|
@@ -38,11 +38,11 @@ function y({ editorView: y, toolbarConfig: b, translation: x, dialect: S, disabl
|
|
|
38
38
|
}
|
|
39
39
|
function N() {
|
|
40
40
|
let e = y;
|
|
41
|
-
e && (
|
|
41
|
+
e && (u(e), e.focus());
|
|
42
42
|
}
|
|
43
43
|
function P() {
|
|
44
44
|
let e = y;
|
|
45
|
-
e && (
|
|
45
|
+
e && (l(e), e.focus());
|
|
46
46
|
}
|
|
47
47
|
function F() {
|
|
48
48
|
let e = y;
|
|
@@ -63,7 +63,7 @@ function y({ editorView: y, toolbarConfig: b, translation: x, dialect: S, disabl
|
|
|
63
63
|
!e || !w || w(e.state.doc.toString());
|
|
64
64
|
}
|
|
65
65
|
let L = b.showFormat, R = b.showCopy || b.showClear, z = b.showUndoRedo, B = b.showExecute && !!w, V = b.showHistory && !!w && !!E && !!D;
|
|
66
|
-
return /* @__PURE__ */ s(
|
|
66
|
+
return /* @__PURE__ */ s(n, {
|
|
67
67
|
sx: {
|
|
68
68
|
display: "flex",
|
|
69
69
|
flexWrap: "wrap",
|
|
@@ -75,7 +75,7 @@ function y({ editorView: y, toolbarConfig: b, translation: x, dialect: S, disabl
|
|
|
75
75
|
role: "toolbar",
|
|
76
76
|
"aria-label": "SQL editor actions",
|
|
77
77
|
children: [
|
|
78
|
-
L && /* @__PURE__ */ o(
|
|
78
|
+
L && /* @__PURE__ */ o(n, {
|
|
79
79
|
sx: {
|
|
80
80
|
display: "flex",
|
|
81
81
|
gap: .25
|
|
@@ -87,37 +87,37 @@ function y({ editorView: y, toolbarConfig: b, translation: x, dialect: S, disabl
|
|
|
87
87
|
disabled: A
|
|
88
88
|
})
|
|
89
89
|
}),
|
|
90
|
-
L && (R || z) && /* @__PURE__ */ o(
|
|
90
|
+
L && (R || z) && /* @__PURE__ */ o(r, {
|
|
91
91
|
orientation: "vertical",
|
|
92
92
|
flexItem: !0,
|
|
93
93
|
sx: { mx: .5 }
|
|
94
94
|
}),
|
|
95
|
-
R && /* @__PURE__ */ s(
|
|
95
|
+
R && /* @__PURE__ */ s(n, {
|
|
96
96
|
sx: {
|
|
97
97
|
display: "flex",
|
|
98
98
|
gap: .25
|
|
99
99
|
},
|
|
100
100
|
children: [b.showCopy && /* @__PURE__ */ o(e, {
|
|
101
101
|
label: O ? x.copySuccess : x.copy,
|
|
102
|
-
icon: O ? /* @__PURE__ */ o(
|
|
102
|
+
icon: O ? /* @__PURE__ */ o(f, {
|
|
103
103
|
fontSize: "small",
|
|
104
104
|
color: "success"
|
|
105
|
-
}) : /* @__PURE__ */ o(
|
|
105
|
+
}) : /* @__PURE__ */ o(d, { fontSize: "small" }),
|
|
106
106
|
onClick: j,
|
|
107
107
|
disabled: A
|
|
108
108
|
}), b.showClear && /* @__PURE__ */ o(e, {
|
|
109
109
|
label: x.clear,
|
|
110
|
-
icon: /* @__PURE__ */ o(
|
|
110
|
+
icon: /* @__PURE__ */ o(c, { fontSize: "small" }),
|
|
111
111
|
onClick: M,
|
|
112
112
|
disabled: A
|
|
113
113
|
})]
|
|
114
114
|
}),
|
|
115
|
-
R && z && /* @__PURE__ */ o(
|
|
115
|
+
R && z && /* @__PURE__ */ o(r, {
|
|
116
116
|
orientation: "vertical",
|
|
117
117
|
flexItem: !0,
|
|
118
118
|
sx: { mx: .5 }
|
|
119
119
|
}),
|
|
120
|
-
z && /* @__PURE__ */ s(
|
|
120
|
+
z && /* @__PURE__ */ s(n, {
|
|
121
121
|
sx: {
|
|
122
122
|
display: "flex",
|
|
123
123
|
gap: .25
|
|
@@ -134,7 +134,7 @@ function y({ editorView: y, toolbarConfig: b, translation: x, dialect: S, disabl
|
|
|
134
134
|
disabled: A
|
|
135
135
|
})]
|
|
136
136
|
}),
|
|
137
|
-
V && /* @__PURE__ */ s(a, { children: [(R || z) && /* @__PURE__ */ o(
|
|
137
|
+
V && /* @__PURE__ */ s(a, { children: [(R || z) && /* @__PURE__ */ o(r, {
|
|
138
138
|
orientation: "vertical",
|
|
139
139
|
flexItem: !0,
|
|
140
140
|
sx: { mx: .5 }
|
|
@@ -145,7 +145,7 @@ function y({ editorView: y, toolbarConfig: b, translation: x, dialect: S, disabl
|
|
|
145
145
|
translation: x,
|
|
146
146
|
disabled: C
|
|
147
147
|
})] }),
|
|
148
|
-
B && /* @__PURE__ */ s(a, { children: [(R || z || V) && /* @__PURE__ */ o(
|
|
148
|
+
B && /* @__PURE__ */ s(a, { children: [(R || z || V) && /* @__PURE__ */ o(r, {
|
|
149
149
|
orientation: "vertical",
|
|
150
150
|
flexItem: !0,
|
|
151
151
|
sx: { mx: .5 }
|
|
@@ -155,7 +155,7 @@ function y({ editorView: y, toolbarConfig: b, translation: x, dialect: S, disabl
|
|
|
155
155
|
onClick: I,
|
|
156
156
|
disabled: A
|
|
157
157
|
})] }),
|
|
158
|
-
!L && !R && !z && !V && !B && /* @__PURE__ */ o(
|
|
158
|
+
!L && !R && !z && !V && !B && /* @__PURE__ */ o(n, { sx: { height: 32 } })
|
|
159
159
|
]
|
|
160
160
|
});
|
|
161
161
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_SUNBURST_CHART_TRANSLATION as e } from "./SunburstChart.types.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { jsx as
|
|
2
|
+
import { Box as t, Tooltip as n, Typography as r, useTheme as i } from "@mui/material";
|
|
3
|
+
import { useCallback as a, useEffect as o, useLayoutEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
4
|
+
import { jsx as d, jsxs as ee } from "react/jsx-runtime";
|
|
5
5
|
import * as f from "d3";
|
|
6
6
|
//#region src/components/sunburst-chart/SunburstChart.tsx
|
|
7
7
|
var p = 2 * Math.PI, m = 11, h = m * .5, g = 5;
|
|
@@ -14,12 +14,12 @@ function te(e, t) {
|
|
|
14
14
|
let n = Math.floor(t / h);
|
|
15
15
|
return n <= 0 ? "" : e.length <= n ? e : n < g ? "" : e.slice(0, n - 1) + "…";
|
|
16
16
|
}
|
|
17
|
-
function ne({ node: e, valueDecimalCount:
|
|
18
|
-
let
|
|
19
|
-
return /* @__PURE__ */
|
|
17
|
+
function ne({ node: e, valueDecimalCount: n, valueDecimalSep: i, valueThousandsSep: a, valueFormatter: o }) {
|
|
18
|
+
let s = (e.value ?? 0) > 0, c = e.ancestors().map((e) => e.data.name).reverse().join(" › ");
|
|
19
|
+
return /* @__PURE__ */ ee(t, {
|
|
20
20
|
sx: { py: .25 },
|
|
21
21
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ d(r, {
|
|
23
23
|
variant: "caption",
|
|
24
24
|
sx: {
|
|
25
25
|
fontWeight: "bold",
|
|
@@ -27,87 +27,87 @@ function ne({ node: e, valueDecimalCount: t, valueDecimalSep: n, valueThousandsS
|
|
|
27
27
|
},
|
|
28
28
|
children: e.data.name
|
|
29
29
|
}),
|
|
30
|
-
|
|
30
|
+
s && /* @__PURE__ */ d(r, {
|
|
31
31
|
variant: "caption",
|
|
32
32
|
sx: {
|
|
33
33
|
display: "block",
|
|
34
34
|
opacity: .85
|
|
35
35
|
},
|
|
36
|
-
children: ((e) =>
|
|
36
|
+
children: ((e) => o ? o(e) : _(e, n, i, a))(e.value ?? 0)
|
|
37
37
|
}),
|
|
38
|
-
e.depth > 0 && /* @__PURE__ */
|
|
38
|
+
e.depth > 0 && /* @__PURE__ */ d(r, {
|
|
39
39
|
variant: "caption",
|
|
40
40
|
sx: {
|
|
41
41
|
display: "block",
|
|
42
42
|
opacity: .65,
|
|
43
43
|
mt: .25
|
|
44
44
|
},
|
|
45
|
-
children:
|
|
45
|
+
children: c
|
|
46
46
|
})
|
|
47
47
|
]
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
function v({ data:
|
|
51
|
-
let D =
|
|
50
|
+
function v({ data: r, size: h = 500, showSegmentLabels: g = !0, innerRadius: _ = 0, sortBy: v = "value", chartColors: y, showRootLabel: b = !0, onSegmentClick: x, onSegmentHover: S, onZoomChange: C, valueDecimalCount: re = 0, valueDecimalSeparator: ie = ".", valueThousandsSeparator: ae = ",", valueFormatter: oe, zoomable: w = !1, duration: T = 750, disabled: E = !1, translation: se }) {
|
|
51
|
+
let D = i(), ce = {
|
|
52
52
|
...e,
|
|
53
53
|
...se
|
|
54
|
-
}, O = !
|
|
54
|
+
}, O = !r.children?.length && !r.value, k = l(null), [A, j] = u(`-${h / 2} -${h / 2} ${h} ${h}`), [M, le] = u(1), ue = c(() => {
|
|
55
55
|
if (M === 1) return A;
|
|
56
56
|
let [e, t, n, r] = A.split(" ").map(Number), i = n / M, a = r / M;
|
|
57
57
|
return `${e + (n - i) / 2} ${t + (r - a) / 2} ${i} ${a}`;
|
|
58
|
-
}, [A, M]),
|
|
58
|
+
}, [A, M]), N = h / 2, P = Math.max(0, Math.min(_, Math.max(0, N - 1))), F = Math.max(1, N - P), de = [
|
|
59
59
|
D.palette.primary.main,
|
|
60
60
|
D.palette.secondary.main,
|
|
61
61
|
D.palette.error.main,
|
|
62
62
|
D.palette.warning.main,
|
|
63
63
|
D.palette.success.main,
|
|
64
64
|
D.palette.info.main
|
|
65
|
-
],
|
|
66
|
-
let e = f.hierarchy(
|
|
65
|
+
], I = y && y.length > 0 ? y : de, { root: L, ringThickness: R } = c(() => {
|
|
66
|
+
let e = f.hierarchy(r).sum((e) => e.value ?? 0);
|
|
67
67
|
v === "value" ? e.sort((e, t) => (t.value ?? 0) - (e.value ?? 0)) : e.sort((e, t) => String(e.data.name).localeCompare(String(t.data.name), void 0, {
|
|
68
68
|
numeric: !0,
|
|
69
69
|
sensitivity: "base"
|
|
70
70
|
}));
|
|
71
|
-
let t = f.partition().size([p,
|
|
71
|
+
let t = f.partition().size([p, F])(e), n = f.max(t.descendants(), (e) => e.depth) ?? 0, i = n > 0 ? F / n : F;
|
|
72
72
|
return n > 0 && t.descendants().forEach((e) => {
|
|
73
|
-
e.depth === 0 ? (e.y0 = 0, e.y1 = 0) : (e.y0 = (e.depth - 1) *
|
|
73
|
+
e.depth === 0 ? (e.y0 = 0, e.y1 = 0) : (e.y0 = (e.depth - 1) * i, e.y1 = e.depth * i);
|
|
74
74
|
}), {
|
|
75
75
|
root: t,
|
|
76
|
-
ringThickness:
|
|
76
|
+
ringThickness: i
|
|
77
77
|
};
|
|
78
78
|
}, [
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
r,
|
|
80
|
+
F,
|
|
81
81
|
v
|
|
82
|
-
]), [
|
|
82
|
+
]), [z, B] = u(L), [fe, pe] = u(L), V = (e) => ({
|
|
83
83
|
x0: e.x0,
|
|
84
84
|
x1: e.x1,
|
|
85
|
-
yShift: e.depth === 0 ? 0 : (e.depth - 1) *
|
|
86
|
-
}), [
|
|
87
|
-
if (
|
|
88
|
-
|
|
89
|
-
let e =
|
|
90
|
-
|
|
85
|
+
yShift: e.depth === 0 ? 0 : (e.depth - 1) * R
|
|
86
|
+
}), [H, U] = u(() => V(L)), W = l(H);
|
|
87
|
+
if (fe !== L) {
|
|
88
|
+
pe(L), B(L);
|
|
89
|
+
let e = V(L);
|
|
90
|
+
W.current = e, U(e);
|
|
91
91
|
}
|
|
92
|
-
let
|
|
92
|
+
let G = c(() => L.children?.map((e) => e.data.name) ?? [L.data.name], [L]), me = c(() => f.scaleOrdinal().domain(G).range(I), [I, G]), he = (e) => {
|
|
93
93
|
if (e.data.colorConfig?.fill) return e.data.colorConfig.fill;
|
|
94
94
|
let t = e;
|
|
95
95
|
for (; t.depth > 1;) t = t.parent;
|
|
96
|
-
return
|
|
97
|
-
},
|
|
98
|
-
let t = p / (
|
|
96
|
+
return me(t.data.name);
|
|
97
|
+
}, ge = c(() => f.arc().startAngle((e) => e.x0).endAngle((e) => e.x1).padAngle((e) => Math.min((e.x1 - e.x0) / 2, .005)).padRadius(N / 2).innerRadius((e) => P + e.y0).outerRadius((e) => P + e.y1 - 1), [N, P]), K = a((e) => {
|
|
98
|
+
let t = p / (H.x1 - H.x0);
|
|
99
99
|
return {
|
|
100
|
-
x0: Math.max(0, Math.min(p, (e.x0 -
|
|
101
|
-
x1: Math.max(0, Math.min(p, (e.x1 -
|
|
102
|
-
y0: Math.max(0, e.y0 -
|
|
103
|
-
y1: Math.max(0, e.y1 -
|
|
100
|
+
x0: Math.max(0, Math.min(p, (e.x0 - H.x0) * t)),
|
|
101
|
+
x1: Math.max(0, Math.min(p, (e.x1 - H.x0) * t)),
|
|
102
|
+
y0: Math.max(0, e.y0 - H.yShift),
|
|
103
|
+
y1: Math.max(0, e.y1 - H.yShift)
|
|
104
104
|
};
|
|
105
|
-
}, [
|
|
106
|
-
|
|
107
|
-
let e =
|
|
105
|
+
}, [H]);
|
|
106
|
+
o(() => {
|
|
107
|
+
let e = V(z), t = W.current;
|
|
108
108
|
if (t.x0 === e.x0 && t.x1 === e.x1 && t.yShift === e.yShift) return;
|
|
109
109
|
if (T <= 0) {
|
|
110
|
-
|
|
110
|
+
W.current = e, U(e);
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
let n = null, r = f.interpolateNumber(t.x0, e.x0), i = f.interpolateNumber(t.x1, e.x1), a = f.interpolateNumber(t.yShift, e.yShift), o = performance.now(), s = (e) => {
|
|
@@ -116,21 +116,21 @@ function v({ data: l, size: h = 500, showSegmentLabels: g = !0, innerRadius: _ =
|
|
|
116
116
|
x1: i(c),
|
|
117
117
|
yShift: a(c)
|
|
118
118
|
};
|
|
119
|
-
|
|
119
|
+
W.current = l, U(l), n = t < 1 ? requestAnimationFrame(s) : null;
|
|
120
120
|
};
|
|
121
121
|
return n = requestAnimationFrame(s), () => {
|
|
122
122
|
n != null && cancelAnimationFrame(n);
|
|
123
123
|
};
|
|
124
124
|
}, [
|
|
125
|
-
B,
|
|
126
125
|
z,
|
|
126
|
+
R,
|
|
127
127
|
T
|
|
128
128
|
]);
|
|
129
|
-
let
|
|
130
|
-
let t = (e.x0 + e.x1) / 2 * 180 / Math.PI, n =
|
|
129
|
+
let _e = (e) => e.x1 > e.x0 && e.y1 > e.y0, ve = (e) => (P + (e.y0 + e.y1) / 2) * (e.x1 - e.x0) > 12, ye = (e) => {
|
|
130
|
+
let t = (e.x0 + e.x1) / 2 * 180 / Math.PI, n = P + (e.y0 + e.y1) / 2, r = t < 180 ? 0 : 180;
|
|
131
131
|
return `rotate(${t - 90}) translate(${n},0) rotate(${r})`;
|
|
132
|
-
},
|
|
133
|
-
let t = e.ancestors().reverse(), n = e.value ?? 0, r =
|
|
132
|
+
}, be = a((e) => e.ancestors().includes(z), [z]), q = a((e) => {
|
|
133
|
+
let t = e.ancestors().reverse(), n = e.value ?? 0, r = L.value ?? 0;
|
|
134
134
|
return {
|
|
135
135
|
id: e.data.id,
|
|
136
136
|
name: e.data.name,
|
|
@@ -142,17 +142,17 @@ function v({ data: l, size: h = 500, showSegmentLabels: g = !0, innerRadius: _ =
|
|
|
142
142
|
childrenCount: e.children?.length ?? 0,
|
|
143
143
|
data: e.data
|
|
144
144
|
};
|
|
145
|
-
}, [
|
|
146
|
-
|
|
147
|
-
focusNode:
|
|
148
|
-
isRoot: e ===
|
|
145
|
+
}, [L]), J = a((e) => {
|
|
146
|
+
B(e), C && C({
|
|
147
|
+
focusNode: q(e),
|
|
148
|
+
isRoot: e === L
|
|
149
149
|
});
|
|
150
150
|
}, [
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
L,
|
|
152
|
+
q,
|
|
153
153
|
C
|
|
154
154
|
]);
|
|
155
|
-
|
|
155
|
+
s(() => {
|
|
156
156
|
let e = k.current;
|
|
157
157
|
if (!e) return;
|
|
158
158
|
let t = requestAnimationFrame(() => {
|
|
@@ -166,177 +166,177 @@ function v({ data: l, size: h = 500, showSegmentLabels: g = !0, innerRadius: _ =
|
|
|
166
166
|
return () => cancelAnimationFrame(t);
|
|
167
167
|
}, [
|
|
168
168
|
h,
|
|
169
|
-
|
|
170
|
-
B,
|
|
171
|
-
F,
|
|
169
|
+
L,
|
|
172
170
|
z,
|
|
171
|
+
P,
|
|
172
|
+
R,
|
|
173
173
|
b
|
|
174
174
|
]);
|
|
175
|
-
let
|
|
176
|
-
|
|
177
|
-
e(),
|
|
175
|
+
let Y = l(null), xe = (e) => {
|
|
176
|
+
Y.current &&= (clearTimeout(Y.current), null), Y.current = setTimeout(() => {
|
|
177
|
+
e(), Y.current = null;
|
|
178
178
|
}, 250);
|
|
179
|
-
},
|
|
180
|
-
|
|
179
|
+
}, X = () => {
|
|
180
|
+
Y.current &&= (clearTimeout(Y.current), null);
|
|
181
181
|
};
|
|
182
|
-
|
|
182
|
+
s(() => {
|
|
183
183
|
if (E) return;
|
|
184
184
|
let e = (e) => {
|
|
185
|
-
e.key === "Escape" && (
|
|
185
|
+
e.key === "Escape" && (X(), J(L), le(1));
|
|
186
186
|
};
|
|
187
187
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
188
188
|
}, [
|
|
189
189
|
E,
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
L,
|
|
191
|
+
J
|
|
192
192
|
]);
|
|
193
|
-
let
|
|
193
|
+
let Se = a((e) => {
|
|
194
194
|
if (!w || E || !e.ctrlKey) return;
|
|
195
195
|
e.preventDefault();
|
|
196
196
|
let t = e.deltaY < 0 ? 1.15 : 1 / 1.15;
|
|
197
|
-
|
|
198
|
-
}, [w, E]),
|
|
197
|
+
le((e) => Math.max(.25, Math.min(8, e * t)));
|
|
198
|
+
}, [w, E]), Z = L.descendants().filter((e) => e.depth > 0), Ce = (e) => {
|
|
199
199
|
if (E) return;
|
|
200
|
-
let t =
|
|
200
|
+
let t = Z[Number(e.currentTarget.getAttribute("data-idx"))];
|
|
201
201
|
if (t) {
|
|
202
202
|
if (e.ctrlKey || e.metaKey) {
|
|
203
|
-
t.children &&
|
|
203
|
+
t.children && xe(() => J(t));
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
|
-
x?.(
|
|
206
|
+
x?.(q(t), e);
|
|
207
207
|
}
|
|
208
|
-
}, Ce = (e) => {
|
|
209
|
-
E || (e.ctrlKey || e.metaKey) && (Z(), Y(B.parent ?? R));
|
|
210
208
|
}, we = (e) => {
|
|
209
|
+
E || (e.ctrlKey || e.metaKey) && (X(), J(z.parent ?? L));
|
|
210
|
+
}, Te = (e) => {
|
|
211
211
|
if (!E) {
|
|
212
212
|
if (e.ctrlKey || e.metaKey) {
|
|
213
|
-
|
|
213
|
+
X(), J(z.parent ?? L);
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
|
-
x?.(
|
|
216
|
+
x?.(q(z.parent ?? L), e);
|
|
217
217
|
}
|
|
218
|
-
},
|
|
218
|
+
}, Q = {
|
|
219
219
|
followCursor: !0,
|
|
220
220
|
enterDelay: 50,
|
|
221
221
|
enterNextDelay: 0,
|
|
222
222
|
disableHoverListener: E,
|
|
223
223
|
slotProps: { tooltip: { sx: { maxWidth: 260 } } }
|
|
224
|
-
},
|
|
225
|
-
return /* @__PURE__ */
|
|
224
|
+
}, $ = D.palette.text.primary, Ee = D.typography.fontFamily;
|
|
225
|
+
return /* @__PURE__ */ d(t, {
|
|
226
226
|
sx: {
|
|
227
227
|
display: "inline-flex",
|
|
228
228
|
opacity: E ? .5 : 1,
|
|
229
229
|
cursor: E ? "not-allowed" : "default",
|
|
230
230
|
userSelect: "none"
|
|
231
231
|
},
|
|
232
|
-
children: /* @__PURE__ */
|
|
232
|
+
children: /* @__PURE__ */ d("svg", {
|
|
233
233
|
width: h,
|
|
234
234
|
height: h,
|
|
235
|
-
viewBox:
|
|
236
|
-
onWheel:
|
|
235
|
+
viewBox: ue,
|
|
236
|
+
onWheel: Se,
|
|
237
237
|
style: {
|
|
238
238
|
fontFamily: Ee ?? "sans-serif",
|
|
239
239
|
overflow: w && M > 1 ? "hidden" : "visible"
|
|
240
240
|
},
|
|
241
241
|
role: "img",
|
|
242
|
-
"aria-label":
|
|
243
|
-
children: /* @__PURE__ */
|
|
242
|
+
"aria-label": r.name,
|
|
243
|
+
children: /* @__PURE__ */ ee("g", {
|
|
244
244
|
ref: k,
|
|
245
245
|
children: [
|
|
246
|
-
O && /* @__PURE__ */
|
|
246
|
+
O && /* @__PURE__ */ d("text", {
|
|
247
247
|
textAnchor: "middle",
|
|
248
248
|
dy: "0.35em",
|
|
249
249
|
fontSize: 13,
|
|
250
250
|
fill: D.palette.text.secondary,
|
|
251
251
|
children: ce.noData
|
|
252
252
|
}),
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
title:
|
|
253
|
+
P > 0 && /* @__PURE__ */ d(n, {
|
|
254
|
+
...Q,
|
|
255
|
+
title: z.data.name,
|
|
256
256
|
placement: "top",
|
|
257
|
-
children: /* @__PURE__ */
|
|
257
|
+
children: /* @__PURE__ */ d("circle", {
|
|
258
258
|
cx: 0,
|
|
259
259
|
cy: 0,
|
|
260
|
-
r:
|
|
260
|
+
r: P,
|
|
261
261
|
fill: "transparent",
|
|
262
262
|
pointerEvents: E ? "none" : "auto",
|
|
263
|
-
onClick:
|
|
263
|
+
onClick: Te,
|
|
264
264
|
style: { cursor: E ? "not-allowed" : "pointer" },
|
|
265
265
|
onMouseEnter: (e) => {
|
|
266
|
-
E || S?.(
|
|
266
|
+
E || S?.(q(z.parent ?? L), e);
|
|
267
267
|
},
|
|
268
268
|
onMouseLeave: (e) => {
|
|
269
269
|
S?.(null, e);
|
|
270
270
|
}
|
|
271
271
|
})
|
|
272
272
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
let
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
-
|
|
273
|
+
/* @__PURE__ */ d("g", { children: Z.map((e, t) => {
|
|
274
|
+
let r = K(e), i = _e(r), a = !!e.children;
|
|
275
|
+
return /* @__PURE__ */ d(n, {
|
|
276
|
+
...Q,
|
|
277
277
|
placement: "top",
|
|
278
|
-
title:
|
|
278
|
+
title: i ? /* @__PURE__ */ d(ne, {
|
|
279
279
|
node: e,
|
|
280
280
|
valueDecimalCount: re,
|
|
281
281
|
valueDecimalSep: ie,
|
|
282
282
|
valueThousandsSep: ae,
|
|
283
283
|
valueFormatter: oe
|
|
284
284
|
}) : "",
|
|
285
|
-
children: /* @__PURE__ */
|
|
285
|
+
children: /* @__PURE__ */ d("path", {
|
|
286
286
|
"data-idx": t,
|
|
287
|
-
d:
|
|
288
|
-
fill:
|
|
289
|
-
fillOpacity:
|
|
287
|
+
d: ge(r) || "",
|
|
288
|
+
fill: he(e),
|
|
289
|
+
fillOpacity: i ? a ? .75 : .5 : 0,
|
|
290
290
|
style: {
|
|
291
|
-
pointerEvents:
|
|
292
|
-
cursor:
|
|
291
|
+
pointerEvents: i && !E ? "auto" : "none",
|
|
292
|
+
cursor: a && !E ? "pointer" : "default",
|
|
293
293
|
transition: "fill-opacity 0.15s"
|
|
294
294
|
},
|
|
295
|
-
onClick:
|
|
296
|
-
onDoubleClick:
|
|
295
|
+
onClick: Ce,
|
|
296
|
+
onDoubleClick: we,
|
|
297
297
|
onMouseEnter: (e) => {
|
|
298
|
-
if (E || !
|
|
299
|
-
let t =
|
|
300
|
-
t && S?.(
|
|
298
|
+
if (E || !i) return;
|
|
299
|
+
let t = Z[Number(e.currentTarget.getAttribute("data-idx"))];
|
|
300
|
+
t && S?.(q(t), e);
|
|
301
301
|
},
|
|
302
302
|
onMouseLeave: (e) => {
|
|
303
|
-
|
|
303
|
+
i && S?.(null, e);
|
|
304
304
|
}
|
|
305
305
|
})
|
|
306
306
|
}, `tt-${e.data.id}-${t}`);
|
|
307
307
|
}) }),
|
|
308
|
-
g && /* @__PURE__ */
|
|
308
|
+
g && /* @__PURE__ */ d("g", {
|
|
309
309
|
pointerEvents: "none",
|
|
310
310
|
textAnchor: "middle",
|
|
311
|
-
fill:
|
|
312
|
-
children:
|
|
313
|
-
if (!
|
|
314
|
-
let n =
|
|
315
|
-
if (!
|
|
316
|
-
let r = (
|
|
317
|
-
return i ? /* @__PURE__ */
|
|
318
|
-
transform:
|
|
311
|
+
fill: $,
|
|
312
|
+
children: Z.map((e, t) => {
|
|
313
|
+
if (!be(e)) return null;
|
|
314
|
+
let n = K(e);
|
|
315
|
+
if (!ve(n)) return null;
|
|
316
|
+
let r = (P + (n.y0 + n.y1) / 2) * (n.x1 - n.x0) * .88, i = te(e.data.name, r);
|
|
317
|
+
return i ? /* @__PURE__ */ d("text", {
|
|
318
|
+
transform: ye(n),
|
|
319
319
|
dy: "0.35em",
|
|
320
320
|
fontSize: m,
|
|
321
321
|
children: i
|
|
322
322
|
}, `lbl-${e.data.id}-${t}`) : null;
|
|
323
323
|
})
|
|
324
324
|
}),
|
|
325
|
-
b && !O && /* @__PURE__ */
|
|
326
|
-
|
|
325
|
+
b && !O && /* @__PURE__ */ d(n, {
|
|
326
|
+
...Q,
|
|
327
327
|
placement: "top",
|
|
328
328
|
title: "",
|
|
329
|
-
children: /* @__PURE__ */
|
|
329
|
+
children: /* @__PURE__ */ d("g", {
|
|
330
330
|
textAnchor: "middle",
|
|
331
|
-
fill:
|
|
331
|
+
fill: $,
|
|
332
332
|
pointerEvents: E ? "none" : "auto",
|
|
333
|
-
onClick:
|
|
334
|
-
style: { cursor:
|
|
335
|
-
children: /* @__PURE__ */
|
|
333
|
+
onClick: Te,
|
|
334
|
+
style: { cursor: z !== L && !E ? "pointer" : "default" },
|
|
335
|
+
children: /* @__PURE__ */ d("text", {
|
|
336
336
|
fontSize: 13,
|
|
337
337
|
dy: "0.35em",
|
|
338
338
|
fontWeight: "bold",
|
|
339
|
-
children:
|
|
339
|
+
children: z.data.name
|
|
340
340
|
})
|
|
341
341
|
})
|
|
342
342
|
})
|