@thebuoyant-tsdev/mui-ts-library 3.11.0 → 3.11.3
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.
- package/README.de.md +21 -0
- package/README.md +21 -0
- package/dist/components/chord-chart/ChordChart.d.ts +1 -1
- package/dist/components/chord-chart/ChordChart.js +155 -137
- package/dist/components/chord-chart/ChordChart.types.d.ts +1 -1
- package/dist/components/circle-packing-chart/CirclePackingChart.d.ts +1 -1
- package/dist/components/circle-packing-chart/CirclePackingChart.js +134 -121
- package/dist/components/gantt-chart/GanttTaskDialog.js +131 -126
- package/dist/components/gantt-chart/hooks/useGanttDrag.js +44 -38
- package/dist/components/gantt-chart/util/gantt-chart.util.d.ts +7 -0
- package/dist/components/gantt-chart/util/gantt-chart.util.js +31 -20
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +222 -206
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.types.d.ts +1 -1
- package/dist/components/json-editor/JsonEditorContent.js +134 -119
- package/dist/components/json-editor/JsonEditorToolbar.js +3 -3
- package/dist/components/password-strength-meter/PasswordStrengthMeter.js +131 -130
- package/dist/components/radial-tree-chart/RadialTreeChart.js +197 -186
- package/dist/components/rich-text-editor/RichTextEditor.js +1 -1
- package/dist/components/rich-text-editor/RichTextEditorMarkdownDialog.js +40 -39
- package/dist/components/shared/useTimedFlag.d.ts +6 -0
- package/dist/components/shared/useTimedFlag.js +14 -0
- package/dist/components/sql-editor/SqlEditorHistoryMenu.js +1 -1
- package/dist/components/sql-editor/useSqlQueryHistory.js +14 -12
- package/dist/components/sql-editor/util/sqlQueryHistory.util.d.ts +1 -0
- package/dist/components/sql-editor/util/sqlQueryHistory.util.js +21 -13
- package/dist/components/sunburst-chart/SunburstChart.d.ts +1 -1
- package/dist/components/sunburst-chart/SunburstChart.js +126 -115
- package/dist/components/tag-selection/TagSelectionAutocomplete.js +7 -5
- package/dist/index.cjs +2 -2
- package/dist/index.js +7 -7
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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
|
|
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
|
|
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(
|
|
19
|
+
return /* @__PURE__ */ d(s, {
|
|
19
20
|
sx: { py: .25 },
|
|
20
21
|
children: [
|
|
21
|
-
/* @__PURE__ */ u(
|
|
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(
|
|
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(
|
|
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:
|
|
50
|
-
let E =
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
}, [
|
|
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
|
-
],
|
|
62
|
-
let e = f.hierarchy(
|
|
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,
|
|
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
|
-
|
|
76
|
-
|
|
79
|
+
l,
|
|
80
|
+
F,
|
|
77
81
|
v
|
|
78
|
-
]), [
|
|
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) *
|
|
82
|
-
}), [
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
let e =
|
|
86
|
-
|
|
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
|
|
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
|
|
93
|
-
},
|
|
94
|
-
let t = p / (
|
|
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 -
|
|
97
|
-
x1: Math.max(0, Math.min(p, (e.x1 -
|
|
98
|
-
y0: Math.max(0, e.y0 -
|
|
99
|
-
y1: Math.max(0, e.y1 -
|
|
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
|
-
}, [
|
|
102
|
-
|
|
103
|
-
let e =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
126
|
-
let t = (e.x0 + e.x1) / 2 * 180 / Math.PI, n =
|
|
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
|
-
},
|
|
129
|
-
let t = e.ancestors().reverse(), n = e.value ?? 0, r =
|
|
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
|
-
}, [
|
|
142
|
-
|
|
143
|
-
focusNode:
|
|
144
|
-
isRoot: e ===
|
|
145
|
+
}, [L]), J = t((e) => {
|
|
146
|
+
B(e), S && S({
|
|
147
|
+
focusNode: q(e),
|
|
148
|
+
isRoot: e === L
|
|
145
149
|
});
|
|
146
150
|
}, [
|
|
147
|
-
|
|
148
|
-
|
|
151
|
+
L,
|
|
152
|
+
q,
|
|
149
153
|
S
|
|
150
154
|
]);
|
|
151
|
-
|
|
152
|
-
let e =
|
|
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
|
-
|
|
161
|
+
A(`${t.x - 8} ${t.y - 8} ${t.width + 16} ${t.height + 16}`);
|
|
158
162
|
} catch {
|
|
159
|
-
|
|
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
|
|
172
|
-
|
|
173
|
-
e(),
|
|
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
|
-
},
|
|
176
|
-
|
|
179
|
+
}, X = () => {
|
|
180
|
+
Y.current &&= (clearTimeout(Y.current), null);
|
|
177
181
|
};
|
|
178
|
-
|
|
182
|
+
r(() => {
|
|
179
183
|
if (T) return;
|
|
180
184
|
let e = (e) => {
|
|
181
|
-
e.key === "Escape" && (
|
|
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
|
-
|
|
187
|
-
|
|
190
|
+
L,
|
|
191
|
+
J
|
|
188
192
|
]);
|
|
189
|
-
let
|
|
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
|
-
|
|
194
|
-
}, [C, T]),
|
|
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 =
|
|
200
|
+
let t = Z[Number(e.currentTarget.getAttribute("data-idx"))];
|
|
197
201
|
if (t) {
|
|
198
202
|
if (e.ctrlKey || e.metaKey) {
|
|
199
|
-
t.children &&
|
|
203
|
+
t.children && ye(() => J(t));
|
|
200
204
|
return;
|
|
201
205
|
}
|
|
202
|
-
x?.(
|
|
206
|
+
x?.(q(t), e);
|
|
203
207
|
}
|
|
204
|
-
},
|
|
205
|
-
T || (e.ctrlKey || e.metaKey) && (
|
|
206
|
-
},
|
|
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
|
-
|
|
213
|
+
X(), J(z.parent ?? L);
|
|
210
214
|
return;
|
|
211
215
|
}
|
|
212
|
-
x?.(
|
|
216
|
+
x?.(q(z.parent ?? L), e);
|
|
213
217
|
}
|
|
214
|
-
},
|
|
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
|
-
},
|
|
221
|
-
return /* @__PURE__ */ u(
|
|
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:
|
|
232
|
-
onWheel:
|
|
235
|
+
viewBox: ce,
|
|
236
|
+
onWheel: be,
|
|
233
237
|
style: {
|
|
234
|
-
fontFamily:
|
|
235
|
-
overflow: C &&
|
|
238
|
+
fontFamily: we ?? "sans-serif",
|
|
239
|
+
overflow: C && j > 1 ? "hidden" : "visible"
|
|
236
240
|
},
|
|
237
241
|
role: "img",
|
|
238
|
-
"aria-label":
|
|
242
|
+
"aria-label": l.name,
|
|
239
243
|
children: /* @__PURE__ */ d("g", {
|
|
240
|
-
ref:
|
|
244
|
+
ref: O,
|
|
241
245
|
children: [
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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:
|
|
260
|
+
r: P,
|
|
250
261
|
fill: "transparent",
|
|
251
262
|
pointerEvents: T ? "none" : "auto",
|
|
252
|
-
onClick:
|
|
263
|
+
onClick: Q,
|
|
253
264
|
style: { cursor: T ? "not-allowed" : "pointer" }
|
|
254
265
|
})
|
|
255
266
|
}),
|
|
256
|
-
/* @__PURE__ */ u("g", { children:
|
|
257
|
-
let n =
|
|
258
|
-
return /* @__PURE__ */ u(
|
|
259
|
-
|
|
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(
|
|
272
|
+
title: r ? /* @__PURE__ */ u(ne, {
|
|
262
273
|
node: e,
|
|
263
|
-
valueDecimalCount:
|
|
264
|
-
valueDecimalSep:
|
|
265
|
-
valueThousandsSep:
|
|
274
|
+
valueDecimalCount: re,
|
|
275
|
+
valueDecimalSep: ie,
|
|
276
|
+
valueThousandsSep: ae
|
|
266
277
|
}) : "",
|
|
267
278
|
children: /* @__PURE__ */ u("path", {
|
|
268
279
|
"data-idx": t,
|
|
269
|
-
d:
|
|
270
|
-
fill:
|
|
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:
|
|
278
|
-
onDoubleClick:
|
|
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:
|
|
287
|
-
if (!
|
|
288
|
-
let n =
|
|
289
|
-
if (!
|
|
290
|
-
let 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:
|
|
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(
|
|
300
|
-
|
|
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:
|
|
308
|
-
style: { cursor:
|
|
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:
|
|
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:
|
|
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 ||
|
|
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:
|
|
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:
|
|
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, {
|