@thebuoyant-tsdev/mui-ts-library 3.11.0 → 3.11.3
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 +21 -0
- package/README.md +21 -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/GanttTaskDialog.js +131 -126
- package/dist/components/gantt-chart/hooks/useGanttDrag.js +44 -38
- package/dist/components/gantt-chart/util/gantt-chart.util.d.ts +7 -0
- package/dist/components/gantt-chart/util/gantt-chart.util.js +31 -20
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +222 -206
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.types.d.ts +1 -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.js +197 -186
- 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 +126 -115
- 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
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
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import * as
|
|
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,83 +89,90 @@ function ne({ info: e, labelA: t, labelB: n }) {
|
|
|
89
89
|
] })]
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
let
|
|
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
|
-
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
],
|
|
104
|
-
|
|
105
|
-
let
|
|
106
|
-
let e =
|
|
107
|
-
|
|
108
|
-
let t =
|
|
109
|
-
return
|
|
95
|
+
...fe
|
|
96
|
+
}, pe = [
|
|
97
|
+
k.palette.primary.main,
|
|
98
|
+
k.palette.secondary.main,
|
|
99
|
+
k.palette.error.main,
|
|
100
|
+
k.palette.warning.main,
|
|
101
|
+
k.palette.success.main,
|
|
102
|
+
k.palette.info.main
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
]),
|
|
111
|
+
L,
|
|
112
|
+
y,
|
|
113
|
+
N,
|
|
114
|
+
P,
|
|
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);
|
|
117
124
|
n(() => {
|
|
118
|
-
let e =
|
|
119
|
-
if (
|
|
120
|
-
if (
|
|
121
|
-
|
|
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);
|
|
122
129
|
return;
|
|
123
130
|
}
|
|
124
|
-
|
|
131
|
+
G(e), K(1);
|
|
125
132
|
let t = performance.now(), n = (e) => {
|
|
126
|
-
let r = Math.min(1, (e - t) /
|
|
127
|
-
|
|
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));
|
|
128
135
|
};
|
|
129
|
-
return
|
|
130
|
-
|
|
136
|
+
return U.current = requestAnimationFrame(n), () => {
|
|
137
|
+
U.current != null && cancelAnimationFrame(U.current);
|
|
131
138
|
};
|
|
132
139
|
}, [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
B,
|
|
141
|
+
D,
|
|
142
|
+
R
|
|
136
143
|
]);
|
|
137
|
-
let
|
|
144
|
+
let q = t((e) => e.data.colorConfig?.fill ?? j[e.depth % j.length], [j]), J = t((e) => {
|
|
138
145
|
switch (l) {
|
|
139
146
|
case "LR": return {
|
|
140
147
|
x: e.y,
|
|
141
|
-
y: e.x -
|
|
148
|
+
y: e.x - N * .4
|
|
142
149
|
};
|
|
143
150
|
case "RL": return {
|
|
144
|
-
x:
|
|
145
|
-
y: e.x -
|
|
151
|
+
x: V - e.y,
|
|
152
|
+
y: e.x - N * .4
|
|
146
153
|
};
|
|
147
154
|
case "TB": return {
|
|
148
|
-
x: e.x -
|
|
155
|
+
x: e.x - N * .4,
|
|
149
156
|
y: e.y
|
|
150
157
|
};
|
|
151
158
|
case "BT": return {
|
|
152
|
-
x: e.x -
|
|
153
|
-
y:
|
|
159
|
+
x: e.x - N * .4,
|
|
160
|
+
y: V - e.y
|
|
154
161
|
};
|
|
155
162
|
}
|
|
156
163
|
}, [
|
|
157
164
|
l,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
]),
|
|
161
|
-
let t =
|
|
165
|
+
N,
|
|
166
|
+
V
|
|
167
|
+
]), we = t((e) => {
|
|
168
|
+
let t = J(e.source), n = J(e.target);
|
|
162
169
|
if (l === "LR" || l === "RL") {
|
|
163
170
|
let e = (t.x + n.x) / 2;
|
|
164
171
|
return `M${t.x},${t.y} C${e},${t.y} ${e},${n.y} ${n.x},${n.y}`;
|
|
165
172
|
}
|
|
166
173
|
let r = (t.y + n.y) / 2;
|
|
167
174
|
return `M${t.x},${t.y} C${t.x},${r} ${n.x},${r} ${n.x},${n.y}`;
|
|
168
|
-
}, [
|
|
175
|
+
}, [J, l]), Te = t((e) => ({
|
|
169
176
|
id: e.data.id ?? null,
|
|
170
177
|
name: e.data.name,
|
|
171
178
|
subname: e.data.subname ?? null,
|
|
@@ -176,45 +183,47 @@ function v({ data: s, orientation: l = "LR", width: f = 800, height: v = 500, le
|
|
|
176
183
|
path: e.ancestors().map((e) => e.data.name).reverse(),
|
|
177
184
|
childrenCount: e.children?.length ?? 0,
|
|
178
185
|
data: e.data
|
|
179
|
-
}), []), [
|
|
180
|
-
if (
|
|
181
|
-
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;
|
|
182
189
|
return `${e + (n - i) / 2} ${t + (r - a) / 2} ${i} ${a}`;
|
|
183
|
-
}, [
|
|
190
|
+
}, [Y, X]);
|
|
184
191
|
r(() => {
|
|
185
|
-
let e =
|
|
192
|
+
let e = Oe.current;
|
|
186
193
|
if (!e) return;
|
|
187
194
|
let t = requestAnimationFrame(() => {
|
|
188
195
|
try {
|
|
189
196
|
let t = e.getBBox();
|
|
190
|
-
|
|
197
|
+
Ee(`${t.x - 24} ${t.y - 24} ${t.width + 48} ${t.height + 48}`);
|
|
191
198
|
} catch {
|
|
192
|
-
|
|
199
|
+
Ee(`0 -${g / 2} ${d} ${g}`);
|
|
193
200
|
}
|
|
194
201
|
});
|
|
195
202
|
return () => cancelAnimationFrame(t);
|
|
196
203
|
}, [
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
204
|
+
B,
|
|
205
|
+
d,
|
|
206
|
+
g,
|
|
200
207
|
l
|
|
201
208
|
]);
|
|
202
|
-
let
|
|
203
|
-
if (!
|
|
209
|
+
let Ae = t((e) => {
|
|
210
|
+
if (!S || O || !e.ctrlKey) return;
|
|
204
211
|
e.preventDefault();
|
|
205
212
|
let t = e.deltaY < 0 ? 1.15 : 1 / 1.15;
|
|
206
|
-
|
|
207
|
-
}, [
|
|
208
|
-
|
|
209
|
-
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;
|
|
210
217
|
}, 250);
|
|
211
|
-
},
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
218
|
+
}, Q = () => {
|
|
219
|
+
Z.current &&= (clearTimeout(Z.current), null);
|
|
220
|
+
};
|
|
221
|
+
n(() => () => Q(), []);
|
|
222
|
+
let Me = t(() => {
|
|
223
|
+
I((e) => {
|
|
215
224
|
if (e.length <= 1) return e;
|
|
216
225
|
let t = e.slice(0, -1);
|
|
217
|
-
return
|
|
226
|
+
return w?.({
|
|
218
227
|
focusedNode: {
|
|
219
228
|
id: t[t.length - 1].id ?? null,
|
|
220
229
|
name: t[t.length - 1].name,
|
|
@@ -230,11 +239,11 @@ function v({ data: s, orientation: l = "LR", width: f = 800, height: v = 500, le
|
|
|
230
239
|
isRoot: t.length <= 1
|
|
231
240
|
}), t;
|
|
232
241
|
});
|
|
233
|
-
}, [
|
|
242
|
+
}, [w]);
|
|
234
243
|
r(() => {
|
|
235
|
-
if (!
|
|
244
|
+
if (!S && !C) return;
|
|
236
245
|
let e = (e) => {
|
|
237
|
-
e.key === "Escape" && (
|
|
246
|
+
e.key === "Escape" && (S && De(1), C && (Q(), I([s]), w?.({
|
|
238
247
|
focusedNode: {
|
|
239
248
|
id: s.id ?? null,
|
|
240
249
|
name: s.name,
|
|
@@ -252,68 +261,68 @@ function v({ data: s, orientation: l = "LR", width: f = 800, height: v = 500, le
|
|
|
252
261
|
};
|
|
253
262
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
254
263
|
}, [
|
|
255
|
-
|
|
256
|
-
|
|
264
|
+
S,
|
|
265
|
+
C,
|
|
257
266
|
s,
|
|
258
|
-
|
|
267
|
+
w
|
|
259
268
|
]);
|
|
260
|
-
let
|
|
269
|
+
let Ne = a(null), Pe = a(null), [Fe, Ie] = o(!1), [Le, Re] = o(null), [ze, Be] = o({
|
|
261
270
|
left: 0,
|
|
262
271
|
top: 0
|
|
263
|
-
}), [$,
|
|
264
|
-
if (
|
|
265
|
-
let n =
|
|
266
|
-
if ((t.ctrlKey || t.metaKey) &&
|
|
267
|
-
|
|
268
|
-
|
|
272
|
+
}), [$, Ve] = o(null), He = (e, t) => {
|
|
273
|
+
if (O) return;
|
|
274
|
+
let n = Te(e);
|
|
275
|
+
if ((t.ctrlKey || t.metaKey) && C && e.children) {
|
|
276
|
+
je(() => {
|
|
277
|
+
I((t) => [...t, e.data]), w?.({
|
|
269
278
|
focusedNode: n,
|
|
270
279
|
isRoot: !1
|
|
271
280
|
});
|
|
272
281
|
});
|
|
273
282
|
return;
|
|
274
283
|
}
|
|
275
|
-
if ((t.ctrlKey || t.metaKey) &&
|
|
276
|
-
|
|
284
|
+
if ((t.ctrlKey || t.metaKey) && C) {
|
|
285
|
+
Q(), Me();
|
|
277
286
|
return;
|
|
278
287
|
}
|
|
279
|
-
if (
|
|
280
|
-
let e =
|
|
281
|
-
|
|
288
|
+
if (T) {
|
|
289
|
+
let e = Ne.current?.getBoundingClientRect();
|
|
290
|
+
Be({
|
|
282
291
|
left: e ? t.clientX - e.left : t.clientX,
|
|
283
292
|
top: e ? t.clientY - e.top : t.clientY
|
|
284
|
-
}),
|
|
293
|
+
}), Re(Pe.current), Ve(n), Ie(!0);
|
|
285
294
|
}
|
|
286
|
-
|
|
287
|
-
},
|
|
288
|
-
|
|
289
|
-
},
|
|
295
|
+
de?.(n, t);
|
|
296
|
+
}, Ue = (e, t) => {
|
|
297
|
+
O || !C || (t.ctrlKey || t.metaKey) && (Q(), Me());
|
|
298
|
+
}, We = {
|
|
290
299
|
followCursor: !0,
|
|
291
300
|
enterDelay: 50,
|
|
292
301
|
enterNextDelay: 0,
|
|
293
|
-
disableHoverListener:
|
|
302
|
+
disableHoverListener: O,
|
|
294
303
|
slotProps: { tooltip: { sx: { maxWidth: 240 } } }
|
|
295
|
-
},
|
|
296
|
-
return /* @__PURE__ */
|
|
297
|
-
ref:
|
|
304
|
+
}, Ge = Math.round(v * 1.3);
|
|
305
|
+
return /* @__PURE__ */ p(c, {
|
|
306
|
+
ref: Ne,
|
|
298
307
|
sx: {
|
|
299
308
|
display: "inline-flex",
|
|
300
309
|
position: "relative",
|
|
301
|
-
opacity:
|
|
302
|
-
cursor:
|
|
310
|
+
opacity: O ? .5 : 1,
|
|
311
|
+
cursor: O ? "not-allowed" : "default",
|
|
303
312
|
userSelect: "none"
|
|
304
313
|
},
|
|
305
314
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
ref:
|
|
315
|
+
/* @__PURE__ */ f(c, {
|
|
316
|
+
ref: Pe,
|
|
308
317
|
sx: {
|
|
309
318
|
position: "absolute",
|
|
310
|
-
left:
|
|
311
|
-
top:
|
|
319
|
+
left: ze.left,
|
|
320
|
+
top: ze.top,
|
|
312
321
|
width: 0,
|
|
313
322
|
height: 0
|
|
314
323
|
}
|
|
315
324
|
}),
|
|
316
|
-
|
|
325
|
+
C && F.length > 1 && /* @__PURE__ */ f(c, {
|
|
317
326
|
sx: {
|
|
318
327
|
position: "absolute",
|
|
319
328
|
top: 4,
|
|
@@ -324,7 +333,7 @@ function v({ data: s, orientation: l = "LR", width: f = 800, height: v = 500, le
|
|
|
324
333
|
pointerEvents: "none",
|
|
325
334
|
zIndex: 1
|
|
326
335
|
},
|
|
327
|
-
children: /* @__PURE__ */
|
|
336
|
+
children: /* @__PURE__ */ f(u, {
|
|
328
337
|
variant: "caption",
|
|
329
338
|
sx: {
|
|
330
339
|
bgcolor: "action.hover",
|
|
@@ -334,38 +343,45 @@ function v({ data: s, orientation: l = "LR", width: f = 800, height: v = 500, le
|
|
|
334
343
|
color: "text.secondary",
|
|
335
344
|
fontSize: "0.7rem"
|
|
336
345
|
},
|
|
337
|
-
children:
|
|
346
|
+
children: F.map((e) => e.name).join(" › ")
|
|
338
347
|
})
|
|
339
348
|
}),
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
width:
|
|
342
|
-
height:
|
|
343
|
-
viewBox:
|
|
344
|
-
onWheel:
|
|
349
|
+
/* @__PURE__ */ f("svg", {
|
|
350
|
+
width: d,
|
|
351
|
+
height: g,
|
|
352
|
+
viewBox: ke,
|
|
353
|
+
onWheel: Ae,
|
|
345
354
|
style: {
|
|
346
|
-
fontFamily:
|
|
347
|
-
overflow:
|
|
355
|
+
fontFamily: ge ?? "sans-serif",
|
|
356
|
+
overflow: S && X > 1 ? "hidden" : "visible"
|
|
348
357
|
},
|
|
349
358
|
role: "img",
|
|
350
359
|
"aria-label": s.name,
|
|
351
|
-
children: /* @__PURE__ */
|
|
352
|
-
ref:
|
|
360
|
+
children: /* @__PURE__ */ p("g", {
|
|
361
|
+
ref: Oe,
|
|
353
362
|
children: [
|
|
354
|
-
/* @__PURE__ */
|
|
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", {
|
|
355
371
|
fill: "none",
|
|
356
|
-
stroke:
|
|
357
|
-
strokeOpacity:
|
|
358
|
-
strokeWidth:
|
|
359
|
-
children:
|
|
372
|
+
stroke: me,
|
|
373
|
+
strokeOpacity: le,
|
|
374
|
+
strokeWidth: x,
|
|
375
|
+
children: Se.map((e, t) => /* @__PURE__ */ f("path", { d: we(e) }, `link-${t}`))
|
|
360
376
|
}),
|
|
361
|
-
|
|
362
|
-
let n =
|
|
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, {
|
|
363
379
|
sx: {
|
|
364
380
|
py: .5,
|
|
365
381
|
minWidth: 140
|
|
366
382
|
},
|
|
367
383
|
children: [
|
|
368
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ f(u, {
|
|
369
385
|
variant: "caption",
|
|
370
386
|
sx: {
|
|
371
387
|
fontWeight: "bold",
|
|
@@ -374,7 +390,7 @@ function v({ data: s, orientation: l = "LR", width: f = 800, height: v = 500, le
|
|
|
374
390
|
},
|
|
375
391
|
children: e.data.name
|
|
376
392
|
}),
|
|
377
|
-
e.data.subname && /* @__PURE__ */
|
|
393
|
+
e.data.subname && /* @__PURE__ */ f(u, {
|
|
378
394
|
variant: "caption",
|
|
379
395
|
sx: {
|
|
380
396
|
display: "block",
|
|
@@ -382,54 +398,54 @@ function v({ data: s, orientation: l = "LR", width: f = 800, height: v = 500, le
|
|
|
382
398
|
},
|
|
383
399
|
children: e.data.subname
|
|
384
400
|
}),
|
|
385
|
-
(i.specialValueA != null || i.specialValueB != null || e.children) && /* @__PURE__ */
|
|
401
|
+
(i.specialValueA != null || i.specialValueB != null || e.children) && /* @__PURE__ */ p(c, {
|
|
386
402
|
sx: {
|
|
387
403
|
mt: .75,
|
|
388
404
|
borderTop: "1px solid rgba(255,255,255,0.2)",
|
|
389
405
|
pt: .75
|
|
390
406
|
},
|
|
391
407
|
children: [
|
|
392
|
-
i.specialValueA != null && /* @__PURE__ */
|
|
408
|
+
i.specialValueA != null && /* @__PURE__ */ p(c, {
|
|
393
409
|
sx: {
|
|
394
410
|
display: "flex",
|
|
395
411
|
justifyContent: "space-between",
|
|
396
412
|
gap: 2
|
|
397
413
|
},
|
|
398
|
-
children: [/* @__PURE__ */
|
|
414
|
+
children: [/* @__PURE__ */ f(u, {
|
|
399
415
|
variant: "caption",
|
|
400
416
|
sx: { opacity: .6 },
|
|
401
|
-
children:
|
|
402
|
-
}), /* @__PURE__ */
|
|
417
|
+
children: A.specialValueA ?? "A"
|
|
418
|
+
}), /* @__PURE__ */ f(u, {
|
|
403
419
|
variant: "caption",
|
|
404
420
|
children: String(i.specialValueA)
|
|
405
421
|
})]
|
|
406
422
|
}),
|
|
407
|
-
i.specialValueB != null && /* @__PURE__ */
|
|
423
|
+
i.specialValueB != null && /* @__PURE__ */ p(c, {
|
|
408
424
|
sx: {
|
|
409
425
|
display: "flex",
|
|
410
426
|
justifyContent: "space-between",
|
|
411
427
|
gap: 2
|
|
412
428
|
},
|
|
413
|
-
children: [/* @__PURE__ */
|
|
429
|
+
children: [/* @__PURE__ */ f(u, {
|
|
414
430
|
variant: "caption",
|
|
415
431
|
sx: { opacity: .6 },
|
|
416
|
-
children:
|
|
417
|
-
}), /* @__PURE__ */
|
|
432
|
+
children: A.specialValueB ?? "B"
|
|
433
|
+
}), /* @__PURE__ */ f(u, {
|
|
418
434
|
variant: "caption",
|
|
419
435
|
children: String(i.specialValueB)
|
|
420
436
|
})]
|
|
421
437
|
}),
|
|
422
|
-
e.children && /* @__PURE__ */
|
|
438
|
+
e.children && /* @__PURE__ */ p(c, {
|
|
423
439
|
sx: {
|
|
424
440
|
display: "flex",
|
|
425
441
|
justifyContent: "space-between",
|
|
426
442
|
gap: 2
|
|
427
443
|
},
|
|
428
|
-
children: [/* @__PURE__ */
|
|
444
|
+
children: [/* @__PURE__ */ f(u, {
|
|
429
445
|
variant: "caption",
|
|
430
446
|
sx: { opacity: .6 },
|
|
431
447
|
children: "Reports"
|
|
432
|
-
}), /* @__PURE__ */
|
|
448
|
+
}), /* @__PURE__ */ f(u, {
|
|
433
449
|
variant: "caption",
|
|
434
450
|
children: e.children.length
|
|
435
451
|
})]
|
|
@@ -438,42 +454,42 @@ function v({ data: s, orientation: l = "LR", width: f = 800, height: v = 500, le
|
|
|
438
454
|
})
|
|
439
455
|
]
|
|
440
456
|
});
|
|
441
|
-
return /* @__PURE__ */
|
|
442
|
-
...
|
|
443
|
-
title:
|
|
444
|
-
children: /* @__PURE__ */
|
|
457
|
+
return /* @__PURE__ */ f(te, {
|
|
458
|
+
...We,
|
|
459
|
+
title: m,
|
|
460
|
+
children: /* @__PURE__ */ p("g", {
|
|
445
461
|
transform: `translate(${n.x},${n.y})`,
|
|
446
|
-
onClick: (t) =>
|
|
447
|
-
onDoubleClick: (t) =>
|
|
448
|
-
style: { cursor:
|
|
462
|
+
onClick: (t) => He(e, t),
|
|
463
|
+
onDoubleClick: (t) => Ue(e, t),
|
|
464
|
+
style: { cursor: O ? "not-allowed" : "pointer" },
|
|
449
465
|
children: [
|
|
450
|
-
/* @__PURE__ */
|
|
451
|
-
r:
|
|
466
|
+
/* @__PURE__ */ f("circle", {
|
|
467
|
+
r: v + 8,
|
|
452
468
|
fill: "transparent"
|
|
453
469
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
-
r:
|
|
470
|
+
/* @__PURE__ */ f("circle", {
|
|
471
|
+
r: v + 2,
|
|
456
472
|
fill: r,
|
|
457
473
|
fillOpacity: .15
|
|
458
474
|
}),
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
-
r:
|
|
475
|
+
/* @__PURE__ */ f("circle", {
|
|
476
|
+
r: v,
|
|
461
477
|
fill: r
|
|
462
478
|
}),
|
|
463
|
-
|
|
479
|
+
ce && /* @__PURE__ */ f(re, {
|
|
464
480
|
path: a,
|
|
465
|
-
size:
|
|
481
|
+
size: Ge
|
|
466
482
|
}),
|
|
467
|
-
|
|
468
|
-
x:
|
|
469
|
-
y:
|
|
483
|
+
ae && /* @__PURE__ */ f("text", {
|
|
484
|
+
x: ee,
|
|
485
|
+
y: ne,
|
|
470
486
|
dy: "0.35em",
|
|
471
|
-
textAnchor:
|
|
472
|
-
fontSize:
|
|
487
|
+
textAnchor: d,
|
|
488
|
+
fontSize: oe,
|
|
473
489
|
fontWeight: e.children ? "bold" : "normal",
|
|
474
|
-
fill: e.data.colorConfig?.textColor ??
|
|
490
|
+
fill: e.data.colorConfig?.textColor ?? M,
|
|
475
491
|
paintOrder: "stroke",
|
|
476
|
-
stroke:
|
|
492
|
+
stroke: he,
|
|
477
493
|
strokeWidth: 3,
|
|
478
494
|
pointerEvents: "none",
|
|
479
495
|
children: e.data.name
|
|
@@ -482,45 +498,45 @@ function v({ data: s, orientation: l = "LR", width: f = 800, height: v = 500, le
|
|
|
482
498
|
})
|
|
483
499
|
}, `node-${t}`);
|
|
484
500
|
}),
|
|
485
|
-
|
|
501
|
+
W && ((e, t) => /* @__PURE__ */ p("g", {
|
|
486
502
|
"data-testid": "drill-ghost-layer",
|
|
487
503
|
opacity: t,
|
|
488
504
|
pointerEvents: "none",
|
|
489
|
-
children: [/* @__PURE__ */
|
|
505
|
+
children: [/* @__PURE__ */ f("g", {
|
|
490
506
|
fill: "none",
|
|
491
|
-
stroke:
|
|
492
|
-
strokeOpacity:
|
|
493
|
-
strokeWidth:
|
|
494
|
-
children: e.links().map((e, t) => /* @__PURE__ */
|
|
495
|
-
}), /* @__PURE__ */
|
|
496
|
-
let n =
|
|
497
|
-
return /* @__PURE__ */
|
|
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", {
|
|
498
514
|
transform: `translate(${n.x},${n.y})`,
|
|
499
515
|
children: [
|
|
500
|
-
/* @__PURE__ */
|
|
501
|
-
r:
|
|
502
|
-
fill:
|
|
516
|
+
/* @__PURE__ */ f("circle", {
|
|
517
|
+
r: v + 2,
|
|
518
|
+
fill: q(e),
|
|
503
519
|
fillOpacity: .15
|
|
504
520
|
}),
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
-
r:
|
|
507
|
-
fill:
|
|
521
|
+
/* @__PURE__ */ f("circle", {
|
|
522
|
+
r: v,
|
|
523
|
+
fill: q(e)
|
|
508
524
|
}),
|
|
509
|
-
|
|
510
|
-
path: e.children ?
|
|
511
|
-
size:
|
|
525
|
+
ce && /* @__PURE__ */ f(re, {
|
|
526
|
+
path: e.children ? h.folder : h.person,
|
|
527
|
+
size: Ge
|
|
512
528
|
})
|
|
513
529
|
]
|
|
514
530
|
}, `ghost-node-${t}`);
|
|
515
531
|
}) })]
|
|
516
|
-
}))(
|
|
532
|
+
}))(W, Ce)
|
|
517
533
|
]
|
|
518
534
|
})
|
|
519
535
|
}),
|
|
520
|
-
|
|
521
|
-
open:
|
|
522
|
-
anchorEl:
|
|
523
|
-
onClose: () =>
|
|
536
|
+
T && /* @__PURE__ */ f(ee, {
|
|
537
|
+
open: Fe,
|
|
538
|
+
anchorEl: Le,
|
|
539
|
+
onClose: () => Ie(!1),
|
|
524
540
|
anchorOrigin: {
|
|
525
541
|
vertical: "top",
|
|
526
542
|
horizontal: "right"
|
|
@@ -530,15 +546,15 @@ function v({ data: s, orientation: l = "LR", width: f = 800, height: v = 500, le
|
|
|
530
546
|
horizontal: "left"
|
|
531
547
|
},
|
|
532
548
|
slotProps: { paper: { elevation: 4 } },
|
|
533
|
-
children: $ && (
|
|
549
|
+
children: $ && (E ? E($) : /* @__PURE__ */ f(ie, {
|
|
534
550
|
info: $,
|
|
535
|
-
labelA:
|
|
536
|
-
labelB:
|
|
551
|
+
labelA: A.specialValueA ?? "Value A",
|
|
552
|
+
labelB: A.specialValueB ?? "Value B"
|
|
537
553
|
}))
|
|
538
554
|
})
|
|
539
555
|
]
|
|
540
556
|
});
|
|
541
557
|
}
|
|
542
|
-
|
|
558
|
+
g.displayName = "HorizontalTreeChart";
|
|
543
559
|
//#endregion
|
|
544
|
-
export {
|
|
560
|
+
export { g as HorizontalTreeChart };
|