@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,24 +1,25 @@
1
- import { useCallback as e, useLayoutEffect as t, useMemo as n, useRef as r, useState as i } from "react";
2
- import { Box as a, Tooltip as o, Typography as s, useTheme as c } from "@mui/material";
3
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
4
- import * as d from "d3";
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";
5
+ import * as f from "d3";
5
6
  //#region src/components/sunburst-chart/SunburstChart.tsx
6
- var f = 2 * Math.PI, p = 11, m = p * .5, h = 5;
7
- function g(e, t = 0, n = ".", r = ",") {
7
+ var p = 2 * Math.PI, m = 11, h = m * .5, g = 5;
8
+ function _(e, t = 0, n = ".", r = ",") {
8
9
  if (e == null || !isFinite(e)) return "0";
9
10
  let [i, a] = e.toFixed(Math.max(0, t)).split("."), o = i.replace(/\B(?=(\d{3})+(?!\d))/g, r);
10
11
  return a ? `${o}${n}${a}` : o;
11
12
  }
12
- function ee(e, t) {
13
- let n = Math.floor(t / m);
14
- return n <= 0 ? "" : e.length <= n ? e : n < h ? "" : e.slice(0, n - 1) + "…";
13
+ function te(e, t) {
14
+ let n = Math.floor(t / h);
15
+ return n <= 0 ? "" : e.length <= n ? e : n < g ? "" : e.slice(0, n - 1) + "…";
15
16
  }
16
- function te({ node: e, valueDecimalCount: t, valueDecimalSep: n, valueThousandsSep: r }) {
17
- let i = (e.value ?? 0) > 0, o = e.ancestors().map((e) => e.data.name).reverse().join(" › ");
18
- return /* @__PURE__ */ u(a, {
17
+ function ne({ node: e, valueDecimalCount: t, valueDecimalSep: n, valueThousandsSep: r }) {
18
+ let i = (e.value ?? 0) > 0, a = e.ancestors().map((e) => e.data.name).reverse().join(" › ");
19
+ return /* @__PURE__ */ d(s, {
19
20
  sx: { py: .25 },
20
21
  children: [
21
- /* @__PURE__ */ l(s, {
22
+ /* @__PURE__ */ u(l, {
22
23
  variant: "caption",
23
24
  sx: {
24
25
  fontWeight: "bold",
@@ -26,45 +27,48 @@ function te({ node: e, valueDecimalCount: t, valueDecimalSep: n, valueThousandsS
26
27
  },
27
28
  children: e.data.name
28
29
  }),
29
- i && /* @__PURE__ */ l(s, {
30
+ i && /* @__PURE__ */ u(l, {
30
31
  variant: "caption",
31
32
  sx: {
32
33
  display: "block",
33
34
  opacity: .85
34
35
  },
35
- children: g(e.value ?? 0, t, n, r)
36
+ children: _(e.value ?? 0, t, n, r)
36
37
  }),
37
- e.depth > 0 && /* @__PURE__ */ l(s, {
38
+ e.depth > 0 && /* @__PURE__ */ u(l, {
38
39
  variant: "caption",
39
40
  sx: {
40
41
  display: "block",
41
42
  opacity: .65,
42
43
  mt: .25
43
44
  },
44
- children: o
45
+ children: a
45
46
  })
46
47
  ]
47
48
  });
48
49
  }
49
- function _({ data: s, size: m = 500, showSegmentLabels: h = !0, innerRadius: g = 0, sortBy: _ = "value", chartColors: v, showRootLabel: y = !0, onSegmentClick: b, onZoomChange: x, valueDecimalCount: ne = 0, valueDecimalSeparator: re = ".", valueThousandsSeparator: S = ",", zoomable: C = !1, disabled: w = !1 }) {
50
- let T = c(), E = r(null), [D, O] = i(`-${m / 2} -${m / 2} ${m} ${m}`), [k, A] = i(1), ie = n(() => {
51
- if (k === 1) return D;
52
- let [e, t, n, r] = D.split(" ").map(Number), i = n / k, a = r / k;
50
+ function v({ data: l, size: h = 500, showSegmentLabels: g = !0, innerRadius: _ = 0, sortBy: v = "value", chartColors: y, showRootLabel: b = !0, onSegmentClick: x, onZoomChange: S, valueDecimalCount: re = 0, valueDecimalSeparator: ie = ".", valueThousandsSeparator: ae = ",", zoomable: C = !1, duration: w = 750, disabled: T = !1, translation: oe }) {
51
+ let E = ee(), se = {
52
+ ...e,
53
+ ...oe
54
+ }, D = !l.children?.length && !l.value, O = a(null), [k, A] = o(`-${h / 2} -${h / 2} ${h} ${h}`), [j, M] = o(1), ce = i(() => {
55
+ if (j === 1) return k;
56
+ let [e, t, n, r] = k.split(" ").map(Number), i = n / j, a = r / j;
53
57
  return `${e + (n - i) / 2} ${t + (r - a) / 2} ${i} ${a}`;
54
- }, [D, k]), j = m / 2, M = Math.max(0, Math.min(g, Math.max(0, j - 1))), N = Math.max(1, j - M), ae = [
55
- T.palette.primary.main,
56
- T.palette.secondary.main,
57
- T.palette.error.main,
58
- T.palette.warning.main,
59
- T.palette.success.main,
60
- T.palette.info.main
61
- ], P = v && v.length > 0 ? v : ae, { root: F, ringThickness: I } = n(() => {
62
- let e = d.hierarchy(s).sum((e) => e.value ?? 0);
63
- _ === "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, {
58
+ }, [k, j]), N = h / 2, P = Math.max(0, Math.min(_, Math.max(0, N - 1))), F = Math.max(1, N - P), le = [
59
+ E.palette.primary.main,
60
+ E.palette.secondary.main,
61
+ E.palette.error.main,
62
+ E.palette.warning.main,
63
+ E.palette.success.main,
64
+ E.palette.info.main
65
+ ], I = y && y.length > 0 ? y : le, { root: L, ringThickness: R } = i(() => {
66
+ let e = f.hierarchy(l).sum((e) => e.value ?? 0);
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, {
64
68
  numeric: !0,
65
69
  sensitivity: "base"
66
70
  }));
67
- let t = d.partition().size([f, N])(e), n = d.max(t.descendants(), (e) => e.depth) ?? 0, r = n > 0 ? N / n : N;
71
+ let t = f.partition().size([p, F])(e), n = f.max(t.descendants(), (e) => e.depth) ?? 0, r = n > 0 ? F / n : F;
68
72
  return n > 0 && t.descendants().forEach((e) => {
69
73
  e.depth === 0 ? (e.y0 = 0, e.y1 = 0) : (e.y0 = (e.depth - 1) * r, e.y1 = e.depth * r);
70
74
  }), {
@@ -72,29 +76,61 @@ function _({ data: s, size: m = 500, showSegmentLabels: h = !0, innerRadius: g =
72
76
  ringThickness: r
73
77
  };
74
78
  }, [
75
- s,
76
- N,
77
- _
78
- ]), [L, R] = i(F), [z, oe] = i(F);
79
- z !== F && (oe(F), R(F));
80
- let B = n(() => F.children?.map((e) => e.data.name) ?? [F.data.name], [F]), se = n(() => d.scaleOrdinal().domain(B).range(P), [P, B]), V = (e) => {
79
+ l,
80
+ F,
81
+ v
82
+ ]), [z, B] = o(L), [ue, de] = o(L), V = (e) => ({
83
+ x0: e.x0,
84
+ x1: e.x1,
85
+ yShift: e.depth === 0 ? 0 : (e.depth - 1) * R
86
+ }), [H, U] = o(() => V(L)), W = a(H);
87
+ if (ue !== L) {
88
+ de(L), B(L);
89
+ let e = V(L);
90
+ W.current = e, U(e);
91
+ }
92
+ let G = i(() => L.children?.map((e) => e.data.name) ?? [L.data.name], [L]), fe = i(() => f.scaleOrdinal().domain(G).range(I), [I, G]), pe = (e) => {
81
93
  if (e.data.colorConfig?.fill) return e.data.colorConfig.fill;
82
94
  let t = e;
83
95
  for (; t.depth > 1;) t = t.parent;
84
- return se(t.data.name);
85
- }, H = n(() => d.arc().startAngle((e) => e.x0).endAngle((e) => e.x1).padAngle((e) => Math.min((e.x1 - e.x0) / 2, .005)).padRadius(j / 2).innerRadius((e) => M + e.y0).outerRadius((e) => M + e.y1 - 1), [j, M]), U = e((e) => {
86
- let t = f / (L.x1 - L.x0), n = Math.max(0, Math.min(f, (e.x0 - L.x0) * t)), r = Math.max(0, Math.min(f, (e.x1 - L.x0) * t)), i = L.depth === 0 ? 0 : (L.depth - 1) * I;
96
+ return fe(t.data.name);
97
+ }, me = i(() => 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 = t((e) => {
98
+ let t = p / (H.x1 - H.x0);
87
99
  return {
88
- x0: n,
89
- x1: r,
90
- y0: Math.max(0, e.y0 - i),
91
- y1: Math.max(0, e.y1 - i)
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
+ };
105
+ }, [H]);
106
+ n(() => {
107
+ let e = V(z), t = W.current;
108
+ if (t.x0 === e.x0 && t.x1 === e.x1 && t.yShift === e.yShift) return;
109
+ if (w <= 0) {
110
+ W.current = e, U(e);
111
+ return;
112
+ }
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) => {
114
+ let t = Math.min(1, (e - o) / w), c = f.easeCubic(t), l = {
115
+ x0: r(c),
116
+ x1: i(c),
117
+ yShift: a(c)
118
+ };
119
+ W.current = l, U(l), n = t < 1 ? requestAnimationFrame(s) : null;
120
+ };
121
+ return n = requestAnimationFrame(s), () => {
122
+ n != null && cancelAnimationFrame(n);
92
123
  };
93
- }, [L, I]), W = (e) => e.x1 > e.x0 && e.y1 > e.y0, G = (e) => (M + (e.y0 + e.y1) / 2) * (e.x1 - e.x0) > 12, ce = (e) => {
94
- let t = (e.x0 + e.x1) / 2 * 180 / Math.PI, n = M + (e.y0 + e.y1) / 2, r = t < 180 ? 0 : 180;
124
+ }, [
125
+ z,
126
+ R,
127
+ w
128
+ ]);
129
+ let he = (e) => e.x1 > e.x0 && e.y1 > e.y0, ge = (e) => (P + (e.y0 + e.y1) / 2) * (e.x1 - e.x0) > 12, _e = (e) => {
130
+ let t = (e.x0 + e.x1) / 2 * 180 / Math.PI, n = P + (e.y0 + e.y1) / 2, r = t < 180 ? 0 : 180;
95
131
  return `rotate(${t - 90}) translate(${n},0) rotate(${r})`;
96
- }, le = e((e) => e.ancestors().includes(L), [L]), K = e((e) => {
97
- let t = e.ancestors().reverse(), n = e.value ?? 0, r = F.value ?? 0;
132
+ }, ve = t((e) => e.ancestors().includes(z), [z]), q = t((e) => {
133
+ let t = e.ancestors().reverse(), n = e.value ?? 0, r = L.value ?? 0;
98
134
  return {
99
135
  id: e.data.id,
100
136
  name: e.data.name,
@@ -106,179 +142,186 @@ function _({ data: s, size: m = 500, showSegmentLabels: h = !0, innerRadius: g =
106
142
  childrenCount: e.children?.length ?? 0,
107
143
  data: e.data
108
144
  };
109
- }, [F]), q = e((e) => {
110
- R(e), x && x({
111
- focusNode: K(e),
112
- isRoot: e === F
145
+ }, [L]), J = t((e) => {
146
+ B(e), S && S({
147
+ focusNode: q(e),
148
+ isRoot: e === L
113
149
  });
114
150
  }, [
115
- F,
116
- K,
117
- x
151
+ L,
152
+ q,
153
+ S
118
154
  ]);
119
- t(() => {
120
- let e = E.current;
155
+ r(() => {
156
+ let e = O.current;
121
157
  if (!e) return;
122
158
  let t = requestAnimationFrame(() => {
123
159
  try {
124
160
  let t = e.getBBox();
125
- O(`${t.x - 8} ${t.y - 8} ${t.width + 16} ${t.height + 16}`);
161
+ A(`${t.x - 8} ${t.y - 8} ${t.width + 16} ${t.height + 16}`);
126
162
  } catch {
127
- O(`-${m / 2} -${m / 2} ${m} ${m}`);
163
+ A(`-${h / 2} -${h / 2} ${h} ${h}`);
128
164
  }
129
165
  });
130
166
  return () => cancelAnimationFrame(t);
131
167
  }, [
132
- m,
133
- F,
168
+ h,
134
169
  L,
135
- M,
136
- I,
137
- y
170
+ z,
171
+ P,
172
+ R,
173
+ b
138
174
  ]);
139
- let J = r(null), ue = (e) => {
140
- J.current &&= (clearTimeout(J.current), null), J.current = setTimeout(() => {
141
- e(), J.current = null;
175
+ let Y = a(null), ye = (e) => {
176
+ Y.current &&= (clearTimeout(Y.current), null), Y.current = setTimeout(() => {
177
+ e(), Y.current = null;
142
178
  }, 250);
143
- }, Y = () => {
144
- J.current &&= (clearTimeout(J.current), null);
179
+ }, X = () => {
180
+ Y.current &&= (clearTimeout(Y.current), null);
145
181
  };
146
- t(() => {
147
- if (w) return;
182
+ r(() => {
183
+ if (T) return;
148
184
  let e = (e) => {
149
- e.key === "Escape" && (Y(), q(F), A(1));
185
+ e.key === "Escape" && (X(), J(L), M(1));
150
186
  };
151
187
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
152
188
  }, [
153
- w,
154
- F,
155
- q
189
+ T,
190
+ L,
191
+ J
156
192
  ]);
157
- let de = e((e) => {
158
- if (!C || w || !e.ctrlKey) return;
193
+ let be = t((e) => {
194
+ if (!C || T || !e.ctrlKey) return;
159
195
  e.preventDefault();
160
196
  let t = e.deltaY < 0 ? 1.15 : 1 / 1.15;
161
- A((e) => Math.max(.25, Math.min(8, e * t)));
162
- }, [C, w]), X = F.descendants().filter((e) => e.depth > 0), fe = (e) => {
163
- if (w) return;
164
- let t = X[Number(e.currentTarget.getAttribute("data-idx"))];
197
+ M((e) => Math.max(.25, Math.min(8, e * t)));
198
+ }, [C, T]), Z = L.descendants().filter((e) => e.depth > 0), xe = (e) => {
199
+ if (T) return;
200
+ let t = Z[Number(e.currentTarget.getAttribute("data-idx"))];
165
201
  if (t) {
166
202
  if (e.ctrlKey || e.metaKey) {
167
- t.children && ue(() => q(t));
203
+ t.children && ye(() => J(t));
168
204
  return;
169
205
  }
170
- b?.(K(t), e);
206
+ x?.(q(t), e);
171
207
  }
172
- }, pe = (e) => {
173
- w || (e.ctrlKey || e.metaKey) && (Y(), q(L.parent ?? F));
174
- }, Z = (e) => {
175
- if (!w) {
208
+ }, Se = (e) => {
209
+ T || (e.ctrlKey || e.metaKey) && (X(), J(z.parent ?? L));
210
+ }, Q = (e) => {
211
+ if (!T) {
176
212
  if (e.ctrlKey || e.metaKey) {
177
- Y(), q(L.parent ?? F);
213
+ X(), J(z.parent ?? L);
178
214
  return;
179
215
  }
180
- b?.(K(L.parent ?? F), e);
216
+ x?.(q(z.parent ?? L), e);
181
217
  }
182
- }, Q = {
218
+ }, $ = {
183
219
  followCursor: !0,
184
220
  enterDelay: 50,
185
221
  enterNextDelay: 0,
186
- disableHoverListener: w,
222
+ disableHoverListener: T,
187
223
  slotProps: { tooltip: { sx: { maxWidth: 260 } } }
188
- }, $ = T.palette.text.primary, me = T.typography.fontFamily;
189
- return /* @__PURE__ */ l(a, {
224
+ }, Ce = E.palette.text.primary, we = E.typography.fontFamily;
225
+ return /* @__PURE__ */ u(s, {
190
226
  sx: {
191
227
  display: "inline-flex",
192
- opacity: w ? .5 : 1,
193
- cursor: w ? "not-allowed" : "default",
228
+ opacity: T ? .5 : 1,
229
+ cursor: T ? "not-allowed" : "default",
194
230
  userSelect: "none"
195
231
  },
196
- children: /* @__PURE__ */ l("svg", {
197
- width: m,
198
- height: m,
199
- viewBox: ie,
200
- onWheel: de,
232
+ children: /* @__PURE__ */ u("svg", {
233
+ width: h,
234
+ height: h,
235
+ viewBox: ce,
236
+ onWheel: be,
201
237
  style: {
202
- fontFamily: me ?? "sans-serif",
203
- overflow: C && k > 1 ? "hidden" : "visible"
238
+ fontFamily: we ?? "sans-serif",
239
+ overflow: C && j > 1 ? "hidden" : "visible"
204
240
  },
205
241
  role: "img",
206
- "aria-label": s.name,
207
- children: /* @__PURE__ */ u("g", {
208
- ref: E,
242
+ "aria-label": l.name,
243
+ children: /* @__PURE__ */ d("g", {
244
+ ref: O,
209
245
  children: [
210
- M > 0 && /* @__PURE__ */ l(o, {
211
- ...Q,
212
- title: L.data.name,
246
+ D && /* @__PURE__ */ u("text", {
247
+ textAnchor: "middle",
248
+ dy: "0.35em",
249
+ fontSize: 13,
250
+ fill: E.palette.text.secondary,
251
+ children: se.noData
252
+ }),
253
+ P > 0 && /* @__PURE__ */ u(c, {
254
+ ...$,
255
+ title: z.data.name,
213
256
  placement: "top",
214
- children: /* @__PURE__ */ l("circle", {
257
+ children: /* @__PURE__ */ u("circle", {
215
258
  cx: 0,
216
259
  cy: 0,
217
- r: M,
260
+ r: P,
218
261
  fill: "transparent",
219
- pointerEvents: w ? "none" : "auto",
220
- onClick: Z,
221
- style: { cursor: w ? "not-allowed" : "pointer" }
262
+ pointerEvents: T ? "none" : "auto",
263
+ onClick: Q,
264
+ style: { cursor: T ? "not-allowed" : "pointer" }
222
265
  })
223
266
  }),
224
- /* @__PURE__ */ l("g", { children: X.map((e, t) => {
225
- let n = U(e), r = W(n), i = !!e.children;
226
- return /* @__PURE__ */ l(o, {
227
- ...Q,
267
+ /* @__PURE__ */ u("g", { children: Z.map((e, t) => {
268
+ let n = K(e), r = he(n), i = !!e.children;
269
+ return /* @__PURE__ */ u(c, {
270
+ ...$,
228
271
  placement: "top",
229
- title: r ? /* @__PURE__ */ l(te, {
272
+ title: r ? /* @__PURE__ */ u(ne, {
230
273
  node: e,
231
- valueDecimalCount: ne,
232
- valueDecimalSep: re,
233
- valueThousandsSep: S
274
+ valueDecimalCount: re,
275
+ valueDecimalSep: ie,
276
+ valueThousandsSep: ae
234
277
  }) : "",
235
- children: /* @__PURE__ */ l("path", {
278
+ children: /* @__PURE__ */ u("path", {
236
279
  "data-idx": t,
237
- d: H(n) || "",
238
- fill: V(e),
280
+ d: me(n) || "",
281
+ fill: pe(e),
239
282
  fillOpacity: r ? i ? .75 : .5 : 0,
240
283
  style: {
241
- pointerEvents: r && !w ? "auto" : "none",
242
- cursor: i && !w ? "pointer" : "default",
284
+ pointerEvents: r && !T ? "auto" : "none",
285
+ cursor: i && !T ? "pointer" : "default",
243
286
  transition: "fill-opacity 0.15s"
244
287
  },
245
- onClick: fe,
246
- onDoubleClick: pe
288
+ onClick: xe,
289
+ onDoubleClick: Se
247
290
  })
248
291
  }, `tt-${e.data.id}-${t}`);
249
292
  }) }),
250
- h && /* @__PURE__ */ l("g", {
293
+ g && /* @__PURE__ */ u("g", {
251
294
  pointerEvents: "none",
252
295
  textAnchor: "middle",
253
- fill: $,
254
- children: X.map((e, t) => {
255
- if (!le(e)) return null;
256
- let n = U(e);
257
- if (!G(n)) return null;
258
- let r = (M + (n.y0 + n.y1) / 2) * (n.x1 - n.x0) * .88, i = ee(e.data.name, r);
259
- return i ? /* @__PURE__ */ l("text", {
260
- transform: ce(n),
296
+ fill: Ce,
297
+ children: Z.map((e, t) => {
298
+ if (!ve(e)) return null;
299
+ let n = K(e);
300
+ if (!ge(n)) return null;
301
+ let r = (P + (n.y0 + n.y1) / 2) * (n.x1 - n.x0) * .88, i = te(e.data.name, r);
302
+ return i ? /* @__PURE__ */ u("text", {
303
+ transform: _e(n),
261
304
  dy: "0.35em",
262
- fontSize: p,
305
+ fontSize: m,
263
306
  children: i
264
307
  }, `lbl-${e.data.id}-${t}`) : null;
265
308
  })
266
309
  }),
267
- y && /* @__PURE__ */ l(o, {
268
- ...Q,
310
+ b && !D && /* @__PURE__ */ u(c, {
311
+ ...$,
269
312
  placement: "top",
270
313
  title: "",
271
- children: /* @__PURE__ */ l("g", {
314
+ children: /* @__PURE__ */ u("g", {
272
315
  textAnchor: "middle",
273
- fill: $,
274
- pointerEvents: w ? "none" : "auto",
275
- onClick: Z,
276
- style: { cursor: L !== F && !w ? "pointer" : "default" },
277
- children: /* @__PURE__ */ l("text", {
316
+ fill: Ce,
317
+ pointerEvents: T ? "none" : "auto",
318
+ onClick: Q,
319
+ style: { cursor: z !== L && !T ? "pointer" : "default" },
320
+ children: /* @__PURE__ */ u("text", {
278
321
  fontSize: 13,
279
322
  dy: "0.35em",
280
323
  fontWeight: "bold",
281
- children: L.data.name
324
+ children: z.data.name
282
325
  })
283
326
  })
284
327
  })
@@ -287,6 +330,6 @@ function _({ data: s, size: m = 500, showSegmentLabels: h = !0, innerRadius: g =
287
330
  })
288
331
  });
289
332
  }
290
- _.displayName = "SunburstChart";
333
+ v.displayName = "SunburstChart";
291
334
  //#endregion
292
- export { _ as SunburstChart };
335
+ export { v as SunburstChart };
@@ -66,6 +66,8 @@ export type SunburstChartProps = {
66
66
  valueThousandsSeparator?: string;
67
67
  /** Enable Ctrl+Scroll zoom — content outside `size` is clipped (default: false) */
68
68
  zoomable?: boolean;
69
+ /** Drill-down/out transition duration in ms — set to 0 to disable animation (default: 750) */
70
+ duration?: number;
69
71
  /** Disables all interactions (default: false) */
70
72
  disabled?: boolean;
71
73
  /** Override any translation string */
@@ -104,8 +104,9 @@ function v({ value: e, onChange: t, disabled: r = !1 }) {
104
104
  } }) } }
105
105
  });
106
106
  }
107
- function y({ availableTags: y, searchValue: b, translation: x, onSearchChange: S, onTagSelect: re, onTagCreate: C, inputSize: w = "medium", chipSize: T = "medium", disabled: E = !1, loading: ie = !1, isMaxReached: D = !1, allowCreate: O = !1, listboxMaxHeight: k }) {
108
- let [A, j] = e("default"), [M, N] = e(null), [P, F] = e(null), [I, L] = e(!0), [R, z] = e(!1), [B, V] = e(!1), [H, U] = e("#1976d2"), [W, G] = e("#ffffff"), K = E || D, q = M !== null, J = y.filter((e) => e.label.toLowerCase().includes(b.trim().toLowerCase())), Y = O && b.trim() !== "" && J.length === 0, ae = B && !Y, X = q ? I ? h(M) : P ?? "#000000" : void 0, Z = () => {
107
+ function y({ availableTags: y, searchValue: b, translation: x, onSearchChange: S, onTagSelect: re, onTagCreate: C, inputSize: w = "medium", chipSize: T = "medium", disabled: E = !1, loading: D = !1, isMaxReached: O = !1, allowCreate: ie = !1, listboxMaxHeight: k }) {
108
+ let [A, j] = e("default"), [M, N] = e(null), [P, F] = e(null), [I, L] = e(!0), [R, z] = e(!1), [B, V] = e(!1), [H, U] = e("#1976d2"), [W, G] = e("#ffffff"), K = E || O, q = M !== null, J = y.filter((e) => e.label.toLowerCase().includes(b.trim().toLowerCase())), Y = ie && b.trim() !== "" && J.length === 0, ae = B && !Y, X = q ? I ? h(M) : P ?? "#000000" : void 0, Z = () => {
109
+ if (K) return;
109
110
  let e = b.trim(), t = e.toLowerCase().replace(/\s+/g, "-");
110
111
  C?.(q && M ? {
111
112
  id: t,
@@ -149,7 +150,7 @@ function y({ availableTags: y, searchValue: b, translation: x, onSearchChange: S
149
150
  onClose: () => V(!1),
150
151
  size: w,
151
152
  disabled: K,
152
- loading: ie,
153
+ loading: D,
153
154
  getOptionLabel: (e) => e.label,
154
155
  inputValue: b,
155
156
  onInputChange: (e, t) => S(t),
@@ -170,9 +171,9 @@ function y({ availableTags: y, searchValue: b, translation: x, onSearchChange: S
170
171
  ...e,
171
172
  label: x.autoCompleteLabel,
172
173
  placeholder: x.placeholder,
173
- helperText: D && !E ? x.maxTagsReachedText : void 0,
174
+ helperText: O && !E ? x.maxTagsReachedText : void 0,
174
175
  onKeyDown: (e) => {
175
- Y && e.key === "Enter" && (e.preventDefault(), Z());
176
+ Y && !K && e.key === "Enter" && (e.preventDefault(), Z());
176
177
  },
177
178
  slotProps: {
178
179
  ...e.slotProps,
@@ -183,6 +184,7 @@ function y({ availableTags: y, searchValue: b, translation: x, onSearchChange: S
183
184
  sx: { color: "success.main" },
184
185
  onMouseDown: $,
185
186
  onClick: Z,
187
+ disabled: K,
186
188
  "aria-label": x.confirmCreateLabel,
187
189
  children: /* @__PURE__ */ u(te, { fontSize: "small" })
188
190
  }), /* @__PURE__ */ u(i, {