@thebuoyant-tsdev/mui-ts-library 3.9.1 → 3.11.2
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 +93 -0
- package/README.md +93 -0
- package/dist/components/chord-chart/ChordChart.d.ts +1 -1
- package/dist/components/chord-chart/ChordChart.js +155 -137
- package/dist/components/chord-chart/ChordChart.types.d.ts +1 -1
- package/dist/components/circle-packing-chart/CirclePackingChart.d.ts +1 -1
- package/dist/components/circle-packing-chart/CirclePackingChart.js +134 -121
- package/dist/components/gantt-chart/hooks/useGanttDrag.js +44 -38
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.d.ts +1 -1
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +319 -247
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.types.d.ts +3 -1
- package/dist/components/json-editor/JsonEditorContent.js +134 -119
- package/dist/components/json-editor/JsonEditorToolbar.js +3 -3
- package/dist/components/password-strength-meter/PasswordStrengthMeter.js +131 -130
- package/dist/components/radial-tree-chart/RadialTreeChart.d.ts +1 -1
- package/dist/components/radial-tree-chart/RadialTreeChart.js +207 -146
- package/dist/components/radial-tree-chart/RadialTreeChart.types.d.ts +2 -0
- package/dist/components/rich-text-editor/RichTextEditor.js +1 -1
- package/dist/components/rich-text-editor/RichTextEditorMarkdownDialog.js +40 -39
- package/dist/components/shared/useTimedFlag.d.ts +6 -0
- package/dist/components/shared/useTimedFlag.js +14 -0
- package/dist/components/sql-editor/SqlEditorHistoryMenu.js +1 -1
- package/dist/components/sql-editor/useSqlQueryHistory.js +14 -12
- package/dist/components/sql-editor/util/sqlQueryHistory.util.d.ts +1 -0
- package/dist/components/sql-editor/util/sqlQueryHistory.util.js +21 -13
- package/dist/components/sunburst-chart/SunburstChart.d.ts +1 -1
- package/dist/components/sunburst-chart/SunburstChart.js +193 -150
- package/dist/components/sunburst-chart/SunburstChart.types.d.ts +2 -0
- package/dist/components/tag-selection/TagSelectionAutocomplete.js +7 -5
- package/dist/index.cjs +2 -2
- package/dist/index.js +7 -7
- package/package.json +1 -1
|
@@ -1,87 +1,87 @@
|
|
|
1
1
|
import { DEFAULT_HORIZONTAL_TREE_TRANSLATION as e } from "./HorizontalTreeChart.types.js";
|
|
2
|
-
import { useCallback as t,
|
|
3
|
-
import { Avatar as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import * as
|
|
2
|
+
import { useCallback as t, useEffect as n, useLayoutEffect as r, useMemo as i, useRef as a, useState as o } from "react";
|
|
3
|
+
import { Avatar as s, Box as c, Divider as l, Popover as ee, Tooltip as te, Typography as u, useTheme as ne } from "@mui/material";
|
|
4
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
5
|
+
import * as m from "d3";
|
|
6
6
|
//#region src/components/horizontal-tree-chart/HorizontalTreeChart.tsx
|
|
7
|
-
var
|
|
7
|
+
var h = {
|
|
8
8
|
folder: "M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z",
|
|
9
9
|
person: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
|
|
10
10
|
};
|
|
11
|
-
function
|
|
11
|
+
function re({ path: e, size: t }) {
|
|
12
12
|
let n = t / 2;
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ f("g", {
|
|
14
14
|
transform: `translate(${-n},${-n})`,
|
|
15
15
|
pointerEvents: "none",
|
|
16
|
-
children: /* @__PURE__ */
|
|
16
|
+
children: /* @__PURE__ */ f("svg", {
|
|
17
17
|
width: t,
|
|
18
18
|
height: t,
|
|
19
19
|
viewBox: "0 0 24 24",
|
|
20
20
|
overflow: "visible",
|
|
21
|
-
children: /* @__PURE__ */
|
|
21
|
+
children: /* @__PURE__ */ f("path", {
|
|
22
22
|
d: e,
|
|
23
23
|
fill: "white"
|
|
24
24
|
})
|
|
25
25
|
})
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return /* @__PURE__ */
|
|
28
|
+
function ie({ info: e, labelA: t, labelB: n }) {
|
|
29
|
+
return /* @__PURE__ */ p(c, {
|
|
30
30
|
sx: {
|
|
31
31
|
p: 2,
|
|
32
32
|
minWidth: 200,
|
|
33
33
|
maxWidth: 280
|
|
34
34
|
},
|
|
35
|
-
children: [/* @__PURE__ */
|
|
35
|
+
children: [/* @__PURE__ */ p(c, {
|
|
36
36
|
sx: {
|
|
37
37
|
display: "flex",
|
|
38
38
|
alignItems: "center",
|
|
39
39
|
gap: 1.5,
|
|
40
40
|
mb: 1.5
|
|
41
41
|
},
|
|
42
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ f(s, {
|
|
43
43
|
sx: {
|
|
44
44
|
bgcolor: "primary.main",
|
|
45
45
|
width: 40,
|
|
46
46
|
height: 40
|
|
47
47
|
},
|
|
48
48
|
children: e.name.charAt(0).toUpperCase()
|
|
49
|
-
}), /* @__PURE__ */
|
|
49
|
+
}), /* @__PURE__ */ p(c, { children: [/* @__PURE__ */ f(u, {
|
|
50
50
|
variant: "body2",
|
|
51
51
|
sx: { fontWeight: "bold" },
|
|
52
52
|
children: e.name
|
|
53
|
-
}), e.subname && /* @__PURE__ */
|
|
53
|
+
}), e.subname && /* @__PURE__ */ f(u, {
|
|
54
54
|
variant: "caption",
|
|
55
55
|
color: "text.secondary",
|
|
56
56
|
children: e.subname
|
|
57
57
|
})] })]
|
|
58
|
-
}), (e.specialValueA != null || e.specialValueB != null) && /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
e.specialValueA != null && /* @__PURE__ */
|
|
58
|
+
}), (e.specialValueA != null || e.specialValueB != null) && /* @__PURE__ */ p(d, { children: [
|
|
59
|
+
/* @__PURE__ */ f(l, { sx: { mb: 1.5 } }),
|
|
60
|
+
e.specialValueA != null && /* @__PURE__ */ p(c, {
|
|
61
61
|
sx: {
|
|
62
62
|
display: "flex",
|
|
63
63
|
justifyContent: "space-between",
|
|
64
64
|
mb: .5
|
|
65
65
|
},
|
|
66
|
-
children: [/* @__PURE__ */
|
|
66
|
+
children: [/* @__PURE__ */ f(u, {
|
|
67
67
|
variant: "caption",
|
|
68
68
|
color: "text.secondary",
|
|
69
69
|
children: t
|
|
70
|
-
}), /* @__PURE__ */
|
|
70
|
+
}), /* @__PURE__ */ f(u, {
|
|
71
71
|
variant: "caption",
|
|
72
72
|
children: String(e.specialValueA)
|
|
73
73
|
})]
|
|
74
74
|
}),
|
|
75
|
-
e.specialValueB != null && /* @__PURE__ */
|
|
75
|
+
e.specialValueB != null && /* @__PURE__ */ p(c, {
|
|
76
76
|
sx: {
|
|
77
77
|
display: "flex",
|
|
78
78
|
justifyContent: "space-between"
|
|
79
79
|
},
|
|
80
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ f(u, {
|
|
81
81
|
variant: "caption",
|
|
82
82
|
color: "text.secondary",
|
|
83
83
|
children: n
|
|
84
|
-
}), /* @__PURE__ */
|
|
84
|
+
}), /* @__PURE__ */ f(u, {
|
|
85
85
|
variant: "caption",
|
|
86
86
|
children: String(e.specialValueB)
|
|
87
87
|
})]
|
|
@@ -89,38 +89,66 @@ function _({ info: e, labelA: t, labelB: n }) {
|
|
|
89
89
|
] })]
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
let k =
|
|
92
|
+
function g({ data: s, orientation: l = "LR", width: d = 800, height: g = 500, levelSpacing: _ = 200, nodeRadius: v = 10, sortBy: y = "name", showLabels: ae = !0, labelFontSize: oe = 12, labelColor: se, showIcons: ce = !0, chartColors: b, linkStrokeOpacity: le = 1, linkStrokeWidth: x = 1.5, linkColor: ue, zoomable: S = !1, drillable: C = !1, onFocusChange: w, showNodePopover: T = !1, renderNodePopoverContent: E, onNodeClick: de, duration: D = 750, disabled: O = !1, translation: fe }) {
|
|
93
|
+
let k = ne(), A = {
|
|
94
94
|
...e,
|
|
95
|
-
...
|
|
96
|
-
},
|
|
95
|
+
...fe
|
|
96
|
+
}, pe = [
|
|
97
97
|
k.palette.primary.main,
|
|
98
98
|
k.palette.secondary.main,
|
|
99
99
|
k.palette.error.main,
|
|
100
100
|
k.palette.warning.main,
|
|
101
101
|
k.palette.success.main,
|
|
102
102
|
k.palette.info.main
|
|
103
|
-
], j =
|
|
104
|
-
|
|
105
|
-
let
|
|
106
|
-
let e =
|
|
107
|
-
|
|
108
|
-
let t =
|
|
109
|
-
return
|
|
103
|
+
], j = b && b.length > 0 ? b : pe, M = se || k.palette.text.primary, me = ue || k.palette.text.secondary, he = k.palette.background.paper, ge = k.typography.fontFamily, _e = !s.children?.length && !s.value, ve = l === "TB" || l === "BT", N = ve ? g : d, P = ve ? d : g, [F, I] = o([s]), L = F[F.length - 1], [ye, be] = o(s), [R, z] = o(!1);
|
|
104
|
+
ye !== s && (be(s), I([s]), z(!0));
|
|
105
|
+
let B = i(() => {
|
|
106
|
+
let e = m.hierarchy(L);
|
|
107
|
+
y === "value" ? (e.sum((e) => e.value ?? 0), e.sort((e, t) => (t.value ?? 0) - (e.value ?? 0))) : e.sort((e, t) => m.ascending(String(e.data.name), String(t.data.name)));
|
|
108
|
+
let t = m.max(e.descendants(), (e) => e.depth) ?? 1;
|
|
109
|
+
return m.tree().size([N * .8, Math.min(t * _, P * .85)])(e);
|
|
110
110
|
}, [
|
|
111
111
|
L,
|
|
112
|
-
|
|
112
|
+
y,
|
|
113
113
|
N,
|
|
114
114
|
P,
|
|
115
|
-
|
|
116
|
-
]),
|
|
117
|
-
|
|
115
|
+
_
|
|
116
|
+
]), V = i(() => {
|
|
117
|
+
let e = m.max(m.hierarchy(L).descendants(), (e) => e.depth) ?? 1;
|
|
118
|
+
return Math.min(e * _, P * .85);
|
|
119
|
+
}, [
|
|
120
|
+
L,
|
|
121
|
+
_,
|
|
122
|
+
P
|
|
123
|
+
]), xe = B.descendants(), Se = B.links(), H = a(B), U = a(null), [W, G] = o(null), [Ce, K] = o(0);
|
|
124
|
+
n(() => {
|
|
125
|
+
let e = H.current;
|
|
126
|
+
if (H.current = B, e === B) return;
|
|
127
|
+
if (U.current != null && (cancelAnimationFrame(U.current), U.current = null), R || D <= 0) {
|
|
128
|
+
z(!1), G(null);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
G(e), K(1);
|
|
132
|
+
let t = performance.now(), n = (e) => {
|
|
133
|
+
let r = Math.min(1, (e - t) / D);
|
|
134
|
+
K(1 - m.easeCubic(r)), r < 1 ? U.current = requestAnimationFrame(n) : (U.current = null, G(null));
|
|
135
|
+
};
|
|
136
|
+
return U.current = requestAnimationFrame(n), () => {
|
|
137
|
+
U.current != null && cancelAnimationFrame(U.current);
|
|
138
|
+
};
|
|
139
|
+
}, [
|
|
140
|
+
B,
|
|
141
|
+
D,
|
|
142
|
+
R
|
|
143
|
+
]);
|
|
144
|
+
let q = t((e) => e.data.colorConfig?.fill ?? j[e.depth % j.length], [j]), J = t((e) => {
|
|
145
|
+
switch (l) {
|
|
118
146
|
case "LR": return {
|
|
119
147
|
x: e.y,
|
|
120
148
|
y: e.x - N * .4
|
|
121
149
|
};
|
|
122
150
|
case "RL": return {
|
|
123
|
-
x:
|
|
151
|
+
x: V - e.y,
|
|
124
152
|
y: e.x - N * .4
|
|
125
153
|
};
|
|
126
154
|
case "TB": return {
|
|
@@ -129,22 +157,22 @@ function v({ data: o, orientation: c = "LR", width: f = 800, height: v = 500, le
|
|
|
129
157
|
};
|
|
130
158
|
case "BT": return {
|
|
131
159
|
x: e.x - N * .4,
|
|
132
|
-
y:
|
|
160
|
+
y: V - e.y
|
|
133
161
|
};
|
|
134
162
|
}
|
|
135
163
|
}, [
|
|
136
|
-
|
|
164
|
+
l,
|
|
137
165
|
N,
|
|
138
|
-
|
|
139
|
-
]),
|
|
140
|
-
let t =
|
|
141
|
-
if (
|
|
166
|
+
V
|
|
167
|
+
]), we = t((e) => {
|
|
168
|
+
let t = J(e.source), n = J(e.target);
|
|
169
|
+
if (l === "LR" || l === "RL") {
|
|
142
170
|
let e = (t.x + n.x) / 2;
|
|
143
171
|
return `M${t.x},${t.y} C${e},${t.y} ${e},${n.y} ${n.x},${n.y}`;
|
|
144
172
|
}
|
|
145
173
|
let r = (t.y + n.y) / 2;
|
|
146
174
|
return `M${t.x},${t.y} C${t.x},${r} ${n.x},${r} ${n.x},${n.y}`;
|
|
147
|
-
}, [
|
|
175
|
+
}, [J, l]), Te = t((e) => ({
|
|
148
176
|
id: e.data.id ?? null,
|
|
149
177
|
name: e.data.name,
|
|
150
178
|
subname: e.data.subname ?? null,
|
|
@@ -155,45 +183,47 @@ function v({ data: o, orientation: c = "LR", width: f = 800, height: v = 500, le
|
|
|
155
183
|
path: e.ancestors().map((e) => e.data.name).reverse(),
|
|
156
184
|
childrenCount: e.children?.length ?? 0,
|
|
157
185
|
data: e.data
|
|
158
|
-
}), []), [
|
|
159
|
-
if (
|
|
160
|
-
let [e, t, n, r] =
|
|
186
|
+
}), []), [Y, Ee] = o(`0 -${g / 2} ${d} ${g}`), [X, De] = o(1), Oe = a(null), ke = i(() => {
|
|
187
|
+
if (X === 1) return Y;
|
|
188
|
+
let [e, t, n, r] = Y.split(" ").map(Number), i = n / X, a = r / X;
|
|
161
189
|
return `${e + (n - i) / 2} ${t + (r - a) / 2} ${i} ${a}`;
|
|
162
|
-
}, [
|
|
163
|
-
|
|
164
|
-
let e =
|
|
190
|
+
}, [Y, X]);
|
|
191
|
+
r(() => {
|
|
192
|
+
let e = Oe.current;
|
|
165
193
|
if (!e) return;
|
|
166
194
|
let t = requestAnimationFrame(() => {
|
|
167
195
|
try {
|
|
168
196
|
let t = e.getBBox();
|
|
169
|
-
|
|
197
|
+
Ee(`${t.x - 24} ${t.y - 24} ${t.width + 48} ${t.height + 48}`);
|
|
170
198
|
} catch {
|
|
171
|
-
|
|
199
|
+
Ee(`0 -${g / 2} ${d} ${g}`);
|
|
172
200
|
}
|
|
173
201
|
});
|
|
174
202
|
return () => cancelAnimationFrame(t);
|
|
175
203
|
}, [
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
204
|
+
B,
|
|
205
|
+
d,
|
|
206
|
+
g,
|
|
207
|
+
l
|
|
180
208
|
]);
|
|
181
|
-
let
|
|
182
|
-
if (!
|
|
209
|
+
let Ae = t((e) => {
|
|
210
|
+
if (!S || O || !e.ctrlKey) return;
|
|
183
211
|
e.preventDefault();
|
|
184
212
|
let t = e.deltaY < 0 ? 1.15 : 1 / 1.15;
|
|
185
|
-
|
|
186
|
-
}, [
|
|
187
|
-
|
|
188
|
-
e(),
|
|
213
|
+
De((e) => Math.max(.25, Math.min(8, e * t)));
|
|
214
|
+
}, [S, O]), Z = a(null), je = (e) => {
|
|
215
|
+
Z.current &&= (clearTimeout(Z.current), null), Z.current = setTimeout(() => {
|
|
216
|
+
e(), Z.current = null;
|
|
189
217
|
}, 250);
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
}
|
|
218
|
+
}, Q = () => {
|
|
219
|
+
Z.current &&= (clearTimeout(Z.current), null);
|
|
220
|
+
};
|
|
221
|
+
n(() => () => Q(), []);
|
|
222
|
+
let Me = t(() => {
|
|
193
223
|
I((e) => {
|
|
194
224
|
if (e.length <= 1) return e;
|
|
195
225
|
let t = e.slice(0, -1);
|
|
196
|
-
return
|
|
226
|
+
return w?.({
|
|
197
227
|
focusedNode: {
|
|
198
228
|
id: t[t.length - 1].id ?? null,
|
|
199
229
|
name: t[t.length - 1].name,
|
|
@@ -209,71 +239,71 @@ function v({ data: o, orientation: c = "LR", width: f = 800, height: v = 500, le
|
|
|
209
239
|
isRoot: t.length <= 1
|
|
210
240
|
}), t;
|
|
211
241
|
});
|
|
212
|
-
}, [
|
|
213
|
-
|
|
214
|
-
if (!
|
|
242
|
+
}, [w]);
|
|
243
|
+
r(() => {
|
|
244
|
+
if (!S && !C) return;
|
|
215
245
|
let e = (e) => {
|
|
216
|
-
e.key === "Escape" && (
|
|
246
|
+
e.key === "Escape" && (S && De(1), C && (Q(), I([s]), w?.({
|
|
217
247
|
focusedNode: {
|
|
218
|
-
id:
|
|
219
|
-
name:
|
|
220
|
-
subname:
|
|
248
|
+
id: s.id ?? null,
|
|
249
|
+
name: s.name,
|
|
250
|
+
subname: s.subname ?? null,
|
|
221
251
|
value: null,
|
|
222
252
|
specialValueA: null,
|
|
223
253
|
specialValueB: null,
|
|
224
254
|
depth: 0,
|
|
225
|
-
path: [
|
|
226
|
-
childrenCount:
|
|
227
|
-
data:
|
|
255
|
+
path: [s.name],
|
|
256
|
+
childrenCount: s.children?.length ?? 0,
|
|
257
|
+
data: s
|
|
228
258
|
},
|
|
229
259
|
isRoot: !0
|
|
230
260
|
})));
|
|
231
261
|
};
|
|
232
262
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
233
263
|
}, [
|
|
264
|
+
S,
|
|
234
265
|
C,
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
T
|
|
266
|
+
s,
|
|
267
|
+
w
|
|
238
268
|
]);
|
|
239
|
-
let
|
|
269
|
+
let Ne = a(null), Pe = a(null), [Fe, Ie] = o(!1), [Le, Re] = o(null), [ze, Be] = o({
|
|
240
270
|
left: 0,
|
|
241
271
|
top: 0
|
|
242
|
-
}), [$,
|
|
272
|
+
}), [$, Ve] = o(null), He = (e, t) => {
|
|
243
273
|
if (O) return;
|
|
244
|
-
let n =
|
|
245
|
-
if ((t.ctrlKey || t.metaKey) &&
|
|
246
|
-
|
|
247
|
-
I((t) => [...t, e.data]),
|
|
274
|
+
let n = Te(e);
|
|
275
|
+
if ((t.ctrlKey || t.metaKey) && C && e.children) {
|
|
276
|
+
je(() => {
|
|
277
|
+
I((t) => [...t, e.data]), w?.({
|
|
248
278
|
focusedNode: n,
|
|
249
279
|
isRoot: !1
|
|
250
280
|
});
|
|
251
281
|
});
|
|
252
282
|
return;
|
|
253
283
|
}
|
|
254
|
-
if ((t.ctrlKey || t.metaKey) &&
|
|
255
|
-
|
|
284
|
+
if ((t.ctrlKey || t.metaKey) && C) {
|
|
285
|
+
Q(), Me();
|
|
256
286
|
return;
|
|
257
287
|
}
|
|
258
|
-
if (
|
|
259
|
-
let e =
|
|
260
|
-
|
|
288
|
+
if (T) {
|
|
289
|
+
let e = Ne.current?.getBoundingClientRect();
|
|
290
|
+
Be({
|
|
261
291
|
left: e ? t.clientX - e.left : t.clientX,
|
|
262
292
|
top: e ? t.clientY - e.top : t.clientY
|
|
263
|
-
}),
|
|
293
|
+
}), Re(Pe.current), Ve(n), Ie(!0);
|
|
264
294
|
}
|
|
265
|
-
|
|
266
|
-
},
|
|
267
|
-
O || !
|
|
268
|
-
},
|
|
295
|
+
de?.(n, t);
|
|
296
|
+
}, Ue = (e, t) => {
|
|
297
|
+
O || !C || (t.ctrlKey || t.metaKey) && (Q(), Me());
|
|
298
|
+
}, We = {
|
|
269
299
|
followCursor: !0,
|
|
270
300
|
enterDelay: 50,
|
|
271
301
|
enterNextDelay: 0,
|
|
272
302
|
disableHoverListener: O,
|
|
273
303
|
slotProps: { tooltip: { sx: { maxWidth: 240 } } }
|
|
274
|
-
},
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
-
ref:
|
|
304
|
+
}, Ge = Math.round(v * 1.3);
|
|
305
|
+
return /* @__PURE__ */ p(c, {
|
|
306
|
+
ref: Ne,
|
|
277
307
|
sx: {
|
|
278
308
|
display: "inline-flex",
|
|
279
309
|
position: "relative",
|
|
@@ -282,17 +312,17 @@ function v({ data: o, orientation: c = "LR", width: f = 800, height: v = 500, le
|
|
|
282
312
|
userSelect: "none"
|
|
283
313
|
},
|
|
284
314
|
children: [
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
ref:
|
|
315
|
+
/* @__PURE__ */ f(c, {
|
|
316
|
+
ref: Pe,
|
|
287
317
|
sx: {
|
|
288
318
|
position: "absolute",
|
|
289
|
-
left:
|
|
290
|
-
top:
|
|
319
|
+
left: ze.left,
|
|
320
|
+
top: ze.top,
|
|
291
321
|
width: 0,
|
|
292
322
|
height: 0
|
|
293
323
|
}
|
|
294
324
|
}),
|
|
295
|
-
|
|
325
|
+
C && F.length > 1 && /* @__PURE__ */ f(c, {
|
|
296
326
|
sx: {
|
|
297
327
|
position: "absolute",
|
|
298
328
|
top: 4,
|
|
@@ -303,7 +333,7 @@ function v({ data: o, orientation: c = "LR", width: f = 800, height: v = 500, le
|
|
|
303
333
|
pointerEvents: "none",
|
|
304
334
|
zIndex: 1
|
|
305
335
|
},
|
|
306
|
-
children: /* @__PURE__ */
|
|
336
|
+
children: /* @__PURE__ */ f(u, {
|
|
307
337
|
variant: "caption",
|
|
308
338
|
sx: {
|
|
309
339
|
bgcolor: "action.hover",
|
|
@@ -316,155 +346,197 @@ function v({ data: o, orientation: c = "LR", width: f = 800, height: v = 500, le
|
|
|
316
346
|
children: F.map((e) => e.name).join(" › ")
|
|
317
347
|
})
|
|
318
348
|
}),
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
width:
|
|
321
|
-
height:
|
|
322
|
-
viewBox:
|
|
323
|
-
onWheel:
|
|
349
|
+
/* @__PURE__ */ f("svg", {
|
|
350
|
+
width: d,
|
|
351
|
+
height: g,
|
|
352
|
+
viewBox: ke,
|
|
353
|
+
onWheel: Ae,
|
|
324
354
|
style: {
|
|
325
|
-
fontFamily:
|
|
326
|
-
overflow:
|
|
355
|
+
fontFamily: ge ?? "sans-serif",
|
|
356
|
+
overflow: S && X > 1 ? "hidden" : "visible"
|
|
327
357
|
},
|
|
328
358
|
role: "img",
|
|
329
|
-
"aria-label":
|
|
330
|
-
children: /* @__PURE__ */
|
|
331
|
-
ref:
|
|
332
|
-
children: [
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
359
|
+
"aria-label": s.name,
|
|
360
|
+
children: /* @__PURE__ */ p("g", {
|
|
361
|
+
ref: Oe,
|
|
362
|
+
children: [
|
|
363
|
+
_e && /* @__PURE__ */ f("text", {
|
|
364
|
+
textAnchor: "middle",
|
|
365
|
+
dy: "0.35em",
|
|
366
|
+
fontSize: 13,
|
|
367
|
+
fill: M,
|
|
368
|
+
children: A.noData
|
|
369
|
+
}),
|
|
370
|
+
/* @__PURE__ */ f("g", {
|
|
371
|
+
fill: "none",
|
|
372
|
+
stroke: me,
|
|
373
|
+
strokeOpacity: le,
|
|
374
|
+
strokeWidth: x,
|
|
375
|
+
children: Se.map((e, t) => /* @__PURE__ */ f("path", { d: we(e) }, `link-${t}`))
|
|
376
|
+
}),
|
|
377
|
+
xe.map((e, t) => {
|
|
378
|
+
let n = J(e), r = q(e), i = Te(e), a = e.children ? h.folder : h.person, o = l === "LR", s = l === "RL", ee = o ? v + 6 : s ? -(v + 6) : 0, ne = !o && !s ? l === "TB" ? v + 16 : -(v + 6) : 0, d = o ? "start" : s ? "end" : "middle", m = /* @__PURE__ */ p(c, {
|
|
379
|
+
sx: {
|
|
380
|
+
py: .5,
|
|
381
|
+
minWidth: 140
|
|
382
|
+
},
|
|
383
|
+
children: [
|
|
384
|
+
/* @__PURE__ */ f(u, {
|
|
385
|
+
variant: "caption",
|
|
386
|
+
sx: {
|
|
387
|
+
fontWeight: "bold",
|
|
388
|
+
display: "block",
|
|
389
|
+
fontSize: "0.8rem"
|
|
390
|
+
},
|
|
391
|
+
children: e.data.name
|
|
392
|
+
}),
|
|
393
|
+
e.data.subname && /* @__PURE__ */ f(u, {
|
|
394
|
+
variant: "caption",
|
|
395
|
+
sx: {
|
|
396
|
+
display: "block",
|
|
397
|
+
opacity: .85
|
|
398
|
+
},
|
|
399
|
+
children: e.data.subname
|
|
400
|
+
}),
|
|
401
|
+
(i.specialValueA != null || i.specialValueB != null || e.children) && /* @__PURE__ */ p(c, {
|
|
402
|
+
sx: {
|
|
403
|
+
mt: .75,
|
|
404
|
+
borderTop: "1px solid rgba(255,255,255,0.2)",
|
|
405
|
+
pt: .75
|
|
406
|
+
},
|
|
407
|
+
children: [
|
|
408
|
+
i.specialValueA != null && /* @__PURE__ */ p(c, {
|
|
409
|
+
sx: {
|
|
410
|
+
display: "flex",
|
|
411
|
+
justifyContent: "space-between",
|
|
412
|
+
gap: 2
|
|
413
|
+
},
|
|
414
|
+
children: [/* @__PURE__ */ f(u, {
|
|
415
|
+
variant: "caption",
|
|
416
|
+
sx: { opacity: .6 },
|
|
417
|
+
children: A.specialValueA ?? "A"
|
|
418
|
+
}), /* @__PURE__ */ f(u, {
|
|
419
|
+
variant: "caption",
|
|
420
|
+
children: String(i.specialValueA)
|
|
421
|
+
})]
|
|
422
|
+
}),
|
|
423
|
+
i.specialValueB != null && /* @__PURE__ */ p(c, {
|
|
424
|
+
sx: {
|
|
425
|
+
display: "flex",
|
|
426
|
+
justifyContent: "space-between",
|
|
427
|
+
gap: 2
|
|
428
|
+
},
|
|
429
|
+
children: [/* @__PURE__ */ f(u, {
|
|
430
|
+
variant: "caption",
|
|
431
|
+
sx: { opacity: .6 },
|
|
432
|
+
children: A.specialValueB ?? "B"
|
|
433
|
+
}), /* @__PURE__ */ f(u, {
|
|
434
|
+
variant: "caption",
|
|
435
|
+
children: String(i.specialValueB)
|
|
436
|
+
})]
|
|
437
|
+
}),
|
|
438
|
+
e.children && /* @__PURE__ */ p(c, {
|
|
439
|
+
sx: {
|
|
440
|
+
display: "flex",
|
|
441
|
+
justifyContent: "space-between",
|
|
442
|
+
gap: 2
|
|
443
|
+
},
|
|
444
|
+
children: [/* @__PURE__ */ f(u, {
|
|
445
|
+
variant: "caption",
|
|
446
|
+
sx: { opacity: .6 },
|
|
447
|
+
children: "Reports"
|
|
448
|
+
}), /* @__PURE__ */ f(u, {
|
|
449
|
+
variant: "caption",
|
|
450
|
+
children: e.children.length
|
|
451
|
+
})]
|
|
452
|
+
})
|
|
453
|
+
]
|
|
454
|
+
})
|
|
455
|
+
]
|
|
456
|
+
});
|
|
457
|
+
return /* @__PURE__ */ f(te, {
|
|
458
|
+
...We,
|
|
459
|
+
title: m,
|
|
460
|
+
children: /* @__PURE__ */ p("g", {
|
|
461
|
+
transform: `translate(${n.x},${n.y})`,
|
|
462
|
+
onClick: (t) => He(e, t),
|
|
463
|
+
onDoubleClick: (t) => Ue(e, t),
|
|
464
|
+
style: { cursor: O ? "not-allowed" : "pointer" },
|
|
368
465
|
children: [
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
sx: { opacity: .6 },
|
|
378
|
-
children: A.specialValueA ?? "A"
|
|
379
|
-
}), /* @__PURE__ */ p(u, {
|
|
380
|
-
variant: "caption",
|
|
381
|
-
children: String(i.specialValueA)
|
|
382
|
-
})]
|
|
466
|
+
/* @__PURE__ */ f("circle", {
|
|
467
|
+
r: v + 8,
|
|
468
|
+
fill: "transparent"
|
|
469
|
+
}),
|
|
470
|
+
/* @__PURE__ */ f("circle", {
|
|
471
|
+
r: v + 2,
|
|
472
|
+
fill: r,
|
|
473
|
+
fillOpacity: .15
|
|
383
474
|
}),
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
justifyContent: "space-between",
|
|
388
|
-
gap: 2
|
|
389
|
-
},
|
|
390
|
-
children: [/* @__PURE__ */ p(u, {
|
|
391
|
-
variant: "caption",
|
|
392
|
-
sx: { opacity: .6 },
|
|
393
|
-
children: A.specialValueB ?? "B"
|
|
394
|
-
}), /* @__PURE__ */ p(u, {
|
|
395
|
-
variant: "caption",
|
|
396
|
-
children: String(i.specialValueB)
|
|
397
|
-
})]
|
|
475
|
+
/* @__PURE__ */ f("circle", {
|
|
476
|
+
r: v,
|
|
477
|
+
fill: r
|
|
398
478
|
}),
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
479
|
+
ce && /* @__PURE__ */ f(re, {
|
|
480
|
+
path: a,
|
|
481
|
+
size: Ge
|
|
482
|
+
}),
|
|
483
|
+
ae && /* @__PURE__ */ f("text", {
|
|
484
|
+
x: ee,
|
|
485
|
+
y: ne,
|
|
486
|
+
dy: "0.35em",
|
|
487
|
+
textAnchor: d,
|
|
488
|
+
fontSize: oe,
|
|
489
|
+
fontWeight: e.children ? "bold" : "normal",
|
|
490
|
+
fill: e.data.colorConfig?.textColor ?? M,
|
|
491
|
+
paintOrder: "stroke",
|
|
492
|
+
stroke: he,
|
|
493
|
+
strokeWidth: 3,
|
|
494
|
+
pointerEvents: "none",
|
|
495
|
+
children: e.data.name
|
|
413
496
|
})
|
|
414
497
|
]
|
|
415
498
|
})
|
|
416
|
-
|
|
417
|
-
})
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
fill: e.data.colorConfig?.textColor ?? fe,
|
|
452
|
-
paintOrder: "stroke",
|
|
453
|
-
stroke: me,
|
|
454
|
-
strokeWidth: 3,
|
|
455
|
-
pointerEvents: "none",
|
|
456
|
-
children: e.data.name
|
|
457
|
-
})
|
|
458
|
-
]
|
|
459
|
-
})
|
|
460
|
-
}, `node-${t}`);
|
|
461
|
-
})]
|
|
499
|
+
}, `node-${t}`);
|
|
500
|
+
}),
|
|
501
|
+
W && ((e, t) => /* @__PURE__ */ p("g", {
|
|
502
|
+
"data-testid": "drill-ghost-layer",
|
|
503
|
+
opacity: t,
|
|
504
|
+
pointerEvents: "none",
|
|
505
|
+
children: [/* @__PURE__ */ f("g", {
|
|
506
|
+
fill: "none",
|
|
507
|
+
stroke: me,
|
|
508
|
+
strokeOpacity: le,
|
|
509
|
+
strokeWidth: x,
|
|
510
|
+
children: e.links().map((e, t) => /* @__PURE__ */ f("path", { d: we(e) }, `ghost-link-${t}`))
|
|
511
|
+
}), /* @__PURE__ */ f("g", { children: e.descendants().map((e, t) => {
|
|
512
|
+
let n = J(e);
|
|
513
|
+
return /* @__PURE__ */ p("g", {
|
|
514
|
+
transform: `translate(${n.x},${n.y})`,
|
|
515
|
+
children: [
|
|
516
|
+
/* @__PURE__ */ f("circle", {
|
|
517
|
+
r: v + 2,
|
|
518
|
+
fill: q(e),
|
|
519
|
+
fillOpacity: .15
|
|
520
|
+
}),
|
|
521
|
+
/* @__PURE__ */ f("circle", {
|
|
522
|
+
r: v,
|
|
523
|
+
fill: q(e)
|
|
524
|
+
}),
|
|
525
|
+
ce && /* @__PURE__ */ f(re, {
|
|
526
|
+
path: e.children ? h.folder : h.person,
|
|
527
|
+
size: Ge
|
|
528
|
+
})
|
|
529
|
+
]
|
|
530
|
+
}, `ghost-node-${t}`);
|
|
531
|
+
}) })]
|
|
532
|
+
}))(W, Ce)
|
|
533
|
+
]
|
|
462
534
|
})
|
|
463
535
|
}),
|
|
464
|
-
|
|
465
|
-
open:
|
|
466
|
-
anchorEl:
|
|
467
|
-
onClose: () =>
|
|
536
|
+
T && /* @__PURE__ */ f(ee, {
|
|
537
|
+
open: Fe,
|
|
538
|
+
anchorEl: Le,
|
|
539
|
+
onClose: () => Ie(!1),
|
|
468
540
|
anchorOrigin: {
|
|
469
541
|
vertical: "top",
|
|
470
542
|
horizontal: "right"
|
|
@@ -474,7 +546,7 @@ function v({ data: o, orientation: c = "LR", width: f = 800, height: v = 500, le
|
|
|
474
546
|
horizontal: "left"
|
|
475
547
|
},
|
|
476
548
|
slotProps: { paper: { elevation: 4 } },
|
|
477
|
-
children: $ && (
|
|
549
|
+
children: $ && (E ? E($) : /* @__PURE__ */ f(ie, {
|
|
478
550
|
info: $,
|
|
479
551
|
labelA: A.specialValueA ?? "Value A",
|
|
480
552
|
labelB: A.specialValueB ?? "Value B"
|
|
@@ -483,6 +555,6 @@ function v({ data: o, orientation: c = "LR", width: f = 800, height: v = 500, le
|
|
|
483
555
|
]
|
|
484
556
|
});
|
|
485
557
|
}
|
|
486
|
-
|
|
558
|
+
g.displayName = "HorizontalTreeChart";
|
|
487
559
|
//#endregion
|
|
488
|
-
export {
|
|
560
|
+
export { g as HorizontalTreeChart };
|