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