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