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