@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.
Files changed (32) hide show
  1. package/README.de.md +93 -0
  2. package/README.md +93 -0
  3. package/dist/components/chord-chart/ChordChart.d.ts +1 -1
  4. package/dist/components/chord-chart/ChordChart.js +155 -137
  5. package/dist/components/chord-chart/ChordChart.types.d.ts +1 -1
  6. package/dist/components/circle-packing-chart/CirclePackingChart.d.ts +1 -1
  7. package/dist/components/circle-packing-chart/CirclePackingChart.js +134 -121
  8. package/dist/components/gantt-chart/hooks/useGanttDrag.js +44 -38
  9. package/dist/components/horizontal-tree-chart/HorizontalTreeChart.d.ts +1 -1
  10. package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +319 -247
  11. package/dist/components/horizontal-tree-chart/HorizontalTreeChart.types.d.ts +3 -1
  12. package/dist/components/json-editor/JsonEditorContent.js +134 -119
  13. package/dist/components/json-editor/JsonEditorToolbar.js +3 -3
  14. package/dist/components/password-strength-meter/PasswordStrengthMeter.js +131 -130
  15. package/dist/components/radial-tree-chart/RadialTreeChart.d.ts +1 -1
  16. package/dist/components/radial-tree-chart/RadialTreeChart.js +207 -146
  17. package/dist/components/radial-tree-chart/RadialTreeChart.types.d.ts +2 -0
  18. package/dist/components/rich-text-editor/RichTextEditor.js +1 -1
  19. package/dist/components/rich-text-editor/RichTextEditorMarkdownDialog.js +40 -39
  20. package/dist/components/shared/useTimedFlag.d.ts +6 -0
  21. package/dist/components/shared/useTimedFlag.js +14 -0
  22. package/dist/components/sql-editor/SqlEditorHistoryMenu.js +1 -1
  23. package/dist/components/sql-editor/useSqlQueryHistory.js +14 -12
  24. package/dist/components/sql-editor/util/sqlQueryHistory.util.d.ts +1 -0
  25. package/dist/components/sql-editor/util/sqlQueryHistory.util.js +21 -13
  26. package/dist/components/sunburst-chart/SunburstChart.d.ts +1 -1
  27. package/dist/components/sunburst-chart/SunburstChart.js +193 -150
  28. package/dist/components/sunburst-chart/SunburstChart.types.d.ts +2 -0
  29. package/dist/components/tag-selection/TagSelectionAutocomplete.js +7 -5
  30. package/dist/index.cjs +2 -2
  31. package/dist/index.js +7 -7
  32. 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, useLayoutEffect as n, useMemo as r, useRef as i, useState as a } from "react";
3
- import { Avatar as o, Box as s, Divider as c, Popover as l, Tooltip as ee, Typography as u, useTheme as d } from "@mui/material";
4
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
5
- import * as h from "d3";
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 g = {
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 te({ path: e, size: t }) {
11
+ function re({ path: e, size: t }) {
12
12
  let n = t / 2;
13
- return /* @__PURE__ */ p("g", {
13
+ return /* @__PURE__ */ f("g", {
14
14
  transform: `translate(${-n},${-n})`,
15
15
  pointerEvents: "none",
16
- children: /* @__PURE__ */ p("svg", {
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__ */ p("path", {
21
+ children: /* @__PURE__ */ f("path", {
22
22
  d: e,
23
23
  fill: "white"
24
24
  })
25
25
  })
26
26
  });
27
27
  }
28
- function _({ info: e, labelA: t, labelB: n }) {
29
- return /* @__PURE__ */ m(s, {
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__ */ m(s, {
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__ */ p(o, {
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__ */ m(s, { children: [/* @__PURE__ */ p(u, {
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__ */ p(u, {
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__ */ m(f, { children: [
59
- /* @__PURE__ */ p(c, { sx: { mb: 1.5 } }),
60
- e.specialValueA != null && /* @__PURE__ */ m(s, {
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__ */ p(u, {
66
+ children: [/* @__PURE__ */ f(u, {
67
67
  variant: "caption",
68
68
  color: "text.secondary",
69
69
  children: t
70
- }), /* @__PURE__ */ p(u, {
70
+ }), /* @__PURE__ */ f(u, {
71
71
  variant: "caption",
72
72
  children: String(e.specialValueA)
73
73
  })]
74
74
  }),
75
- e.specialValueB != null && /* @__PURE__ */ m(s, {
75
+ e.specialValueB != null && /* @__PURE__ */ p(c, {
76
76
  sx: {
77
77
  display: "flex",
78
78
  justifyContent: "space-between"
79
79
  },
80
- children: [/* @__PURE__ */ p(u, {
80
+ children: [/* @__PURE__ */ f(u, {
81
81
  variant: "caption",
82
82
  color: "text.secondary",
83
83
  children: n
84
- }), /* @__PURE__ */ p(u, {
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 v({ data: o, orientation: c = "LR", width: f = 800, height: v = 500, levelSpacing: y = 200, nodeRadius: b = 10, sortBy: x = "name", showLabels: ne = !0, labelFontSize: re = 12, labelColor: ie, showIcons: ae = !0, chartColors: S, linkStrokeOpacity: oe = 1, linkStrokeWidth: se = 1.5, linkColor: ce, zoomable: C = !1, drillable: w = !1, onFocusChange: T, showNodePopover: E = !1, renderNodePopoverContent: D, onNodeClick: le, disabled: O = !1, translation: ue }) {
93
- let k = d(), A = {
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
- ...ue
96
- }, de = [
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 = S && S.length > 0 ? S : de, fe = ie || k.palette.text.primary, pe = ce || k.palette.text.secondary, me = k.palette.background.paper, he = k.typography.fontFamily, M = c === "TB" || c === "BT", N = M ? v : f, P = M ? f : v, [F, I] = a([o]), L = F[F.length - 1], [ge, _e] = a(o);
104
- ge !== o && (_e(o), I([o]));
105
- let R = r(() => {
106
- let e = h.hierarchy(L);
107
- x === "value" ? (e.sum((e) => e.value ?? 0), e.sort((e, t) => (t.value ?? 0) - (e.value ?? 0))) : e.sort((e, t) => h.ascending(String(e.data.name), String(t.data.name)));
108
- let t = h.max(e.descendants(), (e) => e.depth) ?? 1;
109
- return h.tree().size([N * .8, Math.min(t * y, P * .85)])(e);
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
- x,
112
+ y,
113
113
  N,
114
114
  P,
115
- y
116
- ]), ve = R.descendants(), ye = R.links(), be = t((e) => e.data.colorConfig?.fill ?? j[e.depth % j.length], [j]), z = t((e) => {
117
- switch (c) {
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: P * .85 - e.y,
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: P * .85 - e.y
160
+ y: V - e.y
133
161
  };
134
162
  }
135
163
  }, [
136
- c,
164
+ l,
137
165
  N,
138
- P
139
- ]), xe = t((e) => {
140
- let t = z(e.source), n = z(e.target);
141
- if (c === "LR" || c === "RL") {
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
- }, [z, c]), B = t((e) => ({
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
- }), []), [V, H] = a(`0 -${v / 2} ${f} ${v}`), [U, W] = a(1), G = i(null), Se = r(() => {
159
- if (U === 1) return V;
160
- let [e, t, n, r] = V.split(" ").map(Number), i = n / U, a = r / U;
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
- }, [V, U]);
163
- n(() => {
164
- let e = G.current;
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
- H(`${t.x - 24} ${t.y - 24} ${t.width + 48} ${t.height + 48}`);
197
+ Ee(`${t.x - 24} ${t.y - 24} ${t.width + 48} ${t.height + 48}`);
170
198
  } catch {
171
- H(`0 -${v / 2} ${f} ${v}`);
199
+ Ee(`0 -${g / 2} ${d} ${g}`);
172
200
  }
173
201
  });
174
202
  return () => cancelAnimationFrame(t);
175
203
  }, [
176
- R,
177
- f,
178
- v,
179
- c
204
+ B,
205
+ d,
206
+ g,
207
+ l
180
208
  ]);
181
- let Ce = t((e) => {
182
- if (!C || O || !e.ctrlKey) return;
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
- W((e) => Math.max(.25, Math.min(8, e * t)));
186
- }, [C, O]), K = i(null), we = (e) => {
187
- K.current &&= (clearTimeout(K.current), null), K.current = setTimeout(() => {
188
- e(), K.current = null;
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
- }, q = () => {
191
- K.current &&= (clearTimeout(K.current), null);
192
- }, J = t(() => {
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 T?.({
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
- }, [T]);
213
- n(() => {
214
- if (!C && !w) return;
242
+ }, [w]);
243
+ r(() => {
244
+ if (!S && !C) return;
215
245
  let e = (e) => {
216
- e.key === "Escape" && (C && W(1), w && (I([o]), T?.({
246
+ e.key === "Escape" && (S && De(1), C && (Q(), I([s]), w?.({
217
247
  focusedNode: {
218
- id: o.id ?? null,
219
- name: o.name,
220
- subname: o.subname ?? null,
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: [o.name],
226
- childrenCount: o.children?.length ?? 0,
227
- data: o
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
- w,
236
- o,
237
- T
266
+ s,
267
+ w
238
268
  ]);
239
- let Y = i(null), X = i(null), [Te, Z] = a(!1), [Ee, De] = a(null), [Q, Oe] = a({
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
- }), [$, ke] = a(null), Ae = (e, t) => {
272
+ }), [$, Ve] = o(null), He = (e, t) => {
243
273
  if (O) return;
244
- let n = B(e);
245
- if ((t.ctrlKey || t.metaKey) && w && e.children) {
246
- we(() => {
247
- I((t) => [...t, e.data]), T?.({
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) && w) {
255
- q(), J();
284
+ if ((t.ctrlKey || t.metaKey) && C) {
285
+ Q(), Me();
256
286
  return;
257
287
  }
258
- if (E) {
259
- let e = Y.current?.getBoundingClientRect();
260
- Oe({
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
- }), De(X.current), ke(n), Z(!0);
293
+ }), Re(Pe.current), Ve(n), Ie(!0);
264
294
  }
265
- le?.(n, t);
266
- }, je = (e, t) => {
267
- O || !w || (t.ctrlKey || t.metaKey) && (q(), J());
268
- }, Me = {
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
- }, Ne = Math.round(b * 1.3);
275
- return /* @__PURE__ */ m(s, {
276
- ref: Y,
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__ */ p(s, {
286
- ref: X,
315
+ /* @__PURE__ */ f(c, {
316
+ ref: Pe,
287
317
  sx: {
288
318
  position: "absolute",
289
- left: Q.left,
290
- top: Q.top,
319
+ left: ze.left,
320
+ top: ze.top,
291
321
  width: 0,
292
322
  height: 0
293
323
  }
294
324
  }),
295
- w && F.length > 1 && /* @__PURE__ */ p(s, {
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__ */ p(u, {
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__ */ p("svg", {
320
- width: f,
321
- height: v,
322
- viewBox: Se,
323
- onWheel: Ce,
349
+ /* @__PURE__ */ f("svg", {
350
+ width: d,
351
+ height: g,
352
+ viewBox: ke,
353
+ onWheel: Ae,
324
354
  style: {
325
- fontFamily: he ?? "sans-serif",
326
- overflow: C && U > 1 ? "hidden" : "visible"
355
+ fontFamily: ge ?? "sans-serif",
356
+ overflow: S && X > 1 ? "hidden" : "visible"
327
357
  },
328
358
  role: "img",
329
- "aria-label": o.name,
330
- children: /* @__PURE__ */ m("g", {
331
- ref: G,
332
- children: [/* @__PURE__ */ p("g", {
333
- fill: "none",
334
- stroke: pe,
335
- strokeOpacity: oe,
336
- strokeWidth: se,
337
- children: ye.map((e, t) => /* @__PURE__ */ p("path", { d: xe(e) }, `link-${t}`))
338
- }), ve.map((e, t) => {
339
- let n = z(e), r = be(e), i = B(e), a = e.children ? g.folder : g.person, o = c === "LR", l = c === "RL", d = o ? b + 6 : l ? -(b + 6) : 0, f = !o && !l ? c === "TB" ? b + 16 : -(b + 6) : 0, h = o ? "start" : l ? "end" : "middle", _ = /* @__PURE__ */ m(s, {
340
- sx: {
341
- py: .5,
342
- minWidth: 140
343
- },
344
- children: [
345
- /* @__PURE__ */ p(u, {
346
- variant: "caption",
347
- sx: {
348
- fontWeight: "bold",
349
- display: "block",
350
- fontSize: "0.8rem"
351
- },
352
- children: e.data.name
353
- }),
354
- e.data.subname && /* @__PURE__ */ p(u, {
355
- variant: "caption",
356
- sx: {
357
- display: "block",
358
- opacity: .85
359
- },
360
- children: e.data.subname
361
- }),
362
- (i.specialValueA != null || i.specialValueB != null || e.children) && /* @__PURE__ */ m(s, {
363
- sx: {
364
- mt: .75,
365
- borderTop: "1px solid rgba(255,255,255,0.2)",
366
- pt: .75
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
- i.specialValueA != null && /* @__PURE__ */ m(s, {
370
- sx: {
371
- display: "flex",
372
- justifyContent: "space-between",
373
- gap: 2
374
- },
375
- children: [/* @__PURE__ */ p(u, {
376
- variant: "caption",
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
- i.specialValueB != null && /* @__PURE__ */ m(s, {
385
- sx: {
386
- display: "flex",
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
- e.children && /* @__PURE__ */ m(s, {
400
- sx: {
401
- display: "flex",
402
- justifyContent: "space-between",
403
- gap: 2
404
- },
405
- children: [/* @__PURE__ */ p(u, {
406
- variant: "caption",
407
- sx: { opacity: .6 },
408
- children: "Reports"
409
- }), /* @__PURE__ */ p(u, {
410
- variant: "caption",
411
- children: e.children.length
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
- return /* @__PURE__ */ p(ee, {
419
- ...Me,
420
- title: _,
421
- children: /* @__PURE__ */ m("g", {
422
- transform: `translate(${n.x},${n.y})`,
423
- onClick: (t) => Ae(e, t),
424
- onDoubleClick: (t) => je(e, t),
425
- style: { cursor: O ? "not-allowed" : "pointer" },
426
- children: [
427
- /* @__PURE__ */ p("circle", {
428
- r: b + 8,
429
- fill: "transparent"
430
- }),
431
- /* @__PURE__ */ p("circle", {
432
- r: b + 2,
433
- fill: r,
434
- fillOpacity: .15
435
- }),
436
- /* @__PURE__ */ p("circle", {
437
- r: b,
438
- fill: r
439
- }),
440
- ae && /* @__PURE__ */ p(te, {
441
- path: a,
442
- size: Ne
443
- }),
444
- ne && /* @__PURE__ */ p("text", {
445
- x: d,
446
- y: f,
447
- dy: "0.35em",
448
- textAnchor: h,
449
- fontSize: re,
450
- fontWeight: e.children ? "bold" : "normal",
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
- E && /* @__PURE__ */ p(l, {
465
- open: Te,
466
- anchorEl: Ee,
467
- onClose: () => Z(!1),
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: $ && (D ? D($) : /* @__PURE__ */ p(_, {
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
- v.displayName = "HorizontalTreeChart";
558
+ g.displayName = "HorizontalTreeChart";
487
559
  //#endregion
488
- export { v as HorizontalTreeChart };
560
+ export { g as HorizontalTreeChart };