@thebuoyant-tsdev/mui-ts-library 3.29.1 → 3.30.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.
- package/README.de.md +59 -1
- package/README.md +59 -1
- package/dist/components/chord-chart/ChordChart.js +112 -112
- package/dist/components/circle-packing-chart/CirclePackingChart.js +135 -135
- package/dist/components/color-picker/ColorPicker.js +217 -217
- package/dist/components/color-picker/PopoverColorPicker.js +7 -7
- package/dist/components/date-range-picker/DateRangePicker.js +9 -9
- package/dist/components/gantt-chart/GanttChart.js +18 -18
- package/dist/components/gantt-chart/GanttTaskDialog.js +43 -43
- package/dist/components/gantt-chart/GanttTaskPanel.js +128 -128
- package/dist/components/gantt-chart/GanttTimeline.js +16 -16
- package/dist/components/gantt-chart/GanttToolbar.js +24 -24
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +244 -244
- package/dist/components/json-editor/JsonEditor.js +9 -9
- package/dist/components/json-editor/JsonEditorContent.js +54 -54
- package/dist/components/json-editor/JsonEditorToolbar.js +12 -12
- package/dist/components/kanban-board/KanbanBoard.d.ts +2 -0
- package/dist/components/kanban-board/KanbanBoard.js +129 -0
- package/dist/components/kanban-board/KanbanBoard.types.d.ts +84 -0
- package/dist/components/kanban-board/KanbanBoard.types.js +19 -0
- package/dist/components/kanban-board/KanbanBoardCard.d.ts +13 -0
- package/dist/components/kanban-board/KanbanBoardCard.js +104 -0
- package/dist/components/kanban-board/KanbanBoardCardDialog.d.ts +23 -0
- package/dist/components/kanban-board/KanbanBoardCardDialog.js +120 -0
- package/dist/components/kanban-board/KanbanBoardColumn.d.ts +14 -0
- package/dist/components/kanban-board/KanbanBoardColumn.js +129 -0
- package/dist/components/kanban-board/kanbanBoardClasses.d.ts +47 -0
- package/dist/components/kanban-board/kanbanBoardClasses.js +18 -0
- package/dist/components/password-strength-meter/PasswordStrengthMeter.js +27 -27
- package/dist/components/radial-stacked-bar-chart/RadialStackedBarChart.js +48 -48
- package/dist/components/radial-tree-chart/RadialTreeChart.js +173 -173
- package/dist/components/rich-text-editor/RichTextEditor.js +32 -32
- package/dist/components/rich-text-editor/RichTextEditorColorPicker.js +20 -20
- package/dist/components/rich-text-editor/RichTextEditorEmojiPicker.js +12 -12
- package/dist/components/rich-text-editor/RichTextEditorImageDialog.js +11 -11
- package/dist/components/rich-text-editor/RichTextEditorLinkDialog.js +11 -11
- package/dist/components/rich-text-editor/RichTextEditorMarkdownDialog.js +14 -14
- package/dist/components/rich-text-editor/RichTextEditorMentionList.js +14 -14
- package/dist/components/rich-text-editor/RichTextEditorTableMenu.js +28 -28
- package/dist/components/rich-text-editor/RichTextEditorToolbar.js +35 -35
- package/dist/components/sql-editor/SqlEditor.js +24 -24
- package/dist/components/sql-editor/SqlEditorContent.js +16 -16
- package/dist/components/sql-editor/SqlEditorHistoryMenu.js +15 -15
- package/dist/components/sql-editor/SqlEditorToolbar.js +21 -21
- package/dist/components/sunburst-chart/SunburstChart.js +126 -126
- package/dist/components/tag-selection/TagSelection.js +18 -18
- package/dist/components/tag-selection/TagSelectionAutocomplete.js +120 -120
- package/dist/components/tag-selection/TagSelectionSelectedTags.js +10 -10
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +38 -35
- package/package.json +9 -2
|
@@ -1,87 +1,87 @@
|
|
|
1
1
|
import { DEFAULT_HORIZONTAL_TREE_TRANSLATION as e } from "./HorizontalTreeChart.types.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import * as
|
|
2
|
+
import { Avatar as t, Box as n, Divider as r, Popover as i, Tooltip as a, Typography as o, useTheme as s } from "@mui/material";
|
|
3
|
+
import { useCallback as c, useEffect as l, useLayoutEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
4
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
5
|
+
import * as _ from "d3";
|
|
6
6
|
//#region src/components/horizontal-tree-chart/HorizontalTreeChart.tsx
|
|
7
|
-
var
|
|
7
|
+
var v = {
|
|
8
8
|
folder: "M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z",
|
|
9
9
|
person: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
|
|
10
10
|
};
|
|
11
|
-
function
|
|
11
|
+
function y({ path: e, size: t }) {
|
|
12
12
|
let n = t / 2;
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ h("g", {
|
|
14
14
|
transform: `translate(${-n},${-n})`,
|
|
15
15
|
pointerEvents: "none",
|
|
16
|
-
children: /* @__PURE__ */
|
|
16
|
+
children: /* @__PURE__ */ h("svg", {
|
|
17
17
|
width: t,
|
|
18
18
|
height: t,
|
|
19
19
|
viewBox: "0 0 24 24",
|
|
20
20
|
overflow: "visible",
|
|
21
|
-
children: /* @__PURE__ */
|
|
21
|
+
children: /* @__PURE__ */ h("path", {
|
|
22
22
|
d: e,
|
|
23
23
|
fill: "white"
|
|
24
24
|
})
|
|
25
25
|
})
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return /* @__PURE__ */
|
|
28
|
+
function ee({ info: e, labelA: i, labelB: a }) {
|
|
29
|
+
return /* @__PURE__ */ g(n, {
|
|
30
30
|
sx: {
|
|
31
31
|
p: 2,
|
|
32
32
|
minWidth: 200,
|
|
33
33
|
maxWidth: 280
|
|
34
34
|
},
|
|
35
|
-
children: [/* @__PURE__ */
|
|
35
|
+
children: [/* @__PURE__ */ g(n, {
|
|
36
36
|
sx: {
|
|
37
37
|
display: "flex",
|
|
38
38
|
alignItems: "center",
|
|
39
39
|
gap: 1.5,
|
|
40
40
|
mb: 1.5
|
|
41
41
|
},
|
|
42
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ h(t, {
|
|
43
43
|
sx: {
|
|
44
44
|
bgcolor: "primary.main",
|
|
45
45
|
width: 40,
|
|
46
46
|
height: 40
|
|
47
47
|
},
|
|
48
48
|
children: e.name.charAt(0).toUpperCase()
|
|
49
|
-
}), /* @__PURE__ */
|
|
49
|
+
}), /* @__PURE__ */ g(n, { children: [/* @__PURE__ */ h(o, {
|
|
50
50
|
variant: "body2",
|
|
51
51
|
sx: { fontWeight: "bold" },
|
|
52
52
|
children: e.name
|
|
53
|
-
}), e.subname && /* @__PURE__ */
|
|
53
|
+
}), e.subname && /* @__PURE__ */ h(o, {
|
|
54
54
|
variant: "caption",
|
|
55
55
|
color: "text.secondary",
|
|
56
56
|
children: e.subname
|
|
57
57
|
})] })]
|
|
58
|
-
}), (e.specialValueA != null || e.specialValueB != null) && /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
e.specialValueA != null && /* @__PURE__ */
|
|
58
|
+
}), (e.specialValueA != null || e.specialValueB != null) && /* @__PURE__ */ g(m, { children: [
|
|
59
|
+
/* @__PURE__ */ h(r, { sx: { mb: 1.5 } }),
|
|
60
|
+
e.specialValueA != null && /* @__PURE__ */ g(n, {
|
|
61
61
|
sx: {
|
|
62
62
|
display: "flex",
|
|
63
63
|
justifyContent: "space-between",
|
|
64
64
|
mb: .5
|
|
65
65
|
},
|
|
66
|
-
children: [/* @__PURE__ */
|
|
66
|
+
children: [/* @__PURE__ */ h(o, {
|
|
67
67
|
variant: "caption",
|
|
68
68
|
color: "text.secondary",
|
|
69
|
-
children:
|
|
70
|
-
}), /* @__PURE__ */
|
|
69
|
+
children: i
|
|
70
|
+
}), /* @__PURE__ */ h(o, {
|
|
71
71
|
variant: "caption",
|
|
72
72
|
children: String(e.specialValueA)
|
|
73
73
|
})]
|
|
74
74
|
}),
|
|
75
|
-
e.specialValueB != null && /* @__PURE__ */
|
|
75
|
+
e.specialValueB != null && /* @__PURE__ */ g(n, {
|
|
76
76
|
sx: {
|
|
77
77
|
display: "flex",
|
|
78
78
|
justifyContent: "space-between"
|
|
79
79
|
},
|
|
80
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ h(o, {
|
|
81
81
|
variant: "caption",
|
|
82
82
|
color: "text.secondary",
|
|
83
|
-
children:
|
|
84
|
-
}), /* @__PURE__ */
|
|
83
|
+
children: a
|
|
84
|
+
}), /* @__PURE__ */ h(o, {
|
|
85
85
|
variant: "caption",
|
|
86
86
|
children: String(e.specialValueB)
|
|
87
87
|
})]
|
|
@@ -89,90 +89,90 @@ function re({ info: e, labelA: t, labelB: n }) {
|
|
|
89
89
|
] })]
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
let
|
|
92
|
+
function b({ data: t, orientation: r = "LR", width: m = 800, height: b = 500, levelSpacing: x = 200, nodeRadius: S = 10, sortBy: C = "name", showLabels: te = !0, labelFontSize: ne = 12, labelColor: re, showIcons: ie = !0, chartColors: w, linkStrokeOpacity: ae = 1, linkStrokeWidth: T = 1.5, linkColor: oe, zoomable: E = !1, drillable: D = !1, onFocusChange: O, showNodePopover: k = !1, renderNodePopoverContent: se, onNodeClick: ce, onNodeHover: le, duration: A = 750, disabled: j = !1, translation: ue }) {
|
|
93
|
+
let M = s(), N = {
|
|
94
94
|
...e,
|
|
95
|
-
...
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
],
|
|
104
|
-
|
|
105
|
-
let
|
|
106
|
-
let e =
|
|
107
|
-
|
|
108
|
-
let t =
|
|
109
|
-
return
|
|
95
|
+
...ue
|
|
96
|
+
}, de = [
|
|
97
|
+
M.palette.primary.main,
|
|
98
|
+
M.palette.secondary.main,
|
|
99
|
+
M.palette.error.main,
|
|
100
|
+
M.palette.warning.main,
|
|
101
|
+
M.palette.success.main,
|
|
102
|
+
M.palette.info.main
|
|
103
|
+
], P = w && w.length > 0 ? w : de, fe = re || M.palette.text.primary, pe = oe || M.palette.text.secondary, me = M.palette.background.paper, he = M.typography.fontFamily, ge = !t.children?.length && !t.value, F = r === "TB" || r === "BT", I = F ? b : m, L = F ? m : b, [R, z] = p([t]), B = R[R.length - 1], [_e, ve] = p(t), [ye, be] = p(!1);
|
|
104
|
+
_e !== t && (ve(t), z([t]), be(!0));
|
|
105
|
+
let V = d(() => {
|
|
106
|
+
let e = _.hierarchy(B);
|
|
107
|
+
C === "value" ? (e.sum((e) => e.value ?? 0), e.sort((e, t) => (t.value ?? 0) - (e.value ?? 0))) : e.sort((e, t) => _.ascending(String(e.data.name), String(t.data.name)));
|
|
108
|
+
let t = _.max(e.descendants(), (e) => e.depth) ?? 1;
|
|
109
|
+
return _.tree().size([I * .8, Math.min(t * x, L * .85)])(e);
|
|
110
110
|
}, [
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
F,
|
|
111
|
+
B,
|
|
112
|
+
C,
|
|
114
113
|
I,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
L,
|
|
115
|
+
x
|
|
116
|
+
]), H = d(() => {
|
|
117
|
+
let e = _.max(_.hierarchy(B).descendants(), (e) => e.depth) ?? 1;
|
|
118
|
+
return Math.min(e * x, L * .85);
|
|
119
119
|
}, [
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
]),
|
|
124
|
-
|
|
125
|
-
let e =
|
|
126
|
-
if (
|
|
127
|
-
if (
|
|
128
|
-
|
|
120
|
+
B,
|
|
121
|
+
x,
|
|
122
|
+
L
|
|
123
|
+
]), xe = V.descendants(), Se = V.links(), Ce = f(V), U = f(null), [we, W] = p(null), [Te, Ee] = p(0);
|
|
124
|
+
l(() => {
|
|
125
|
+
let e = Ce.current;
|
|
126
|
+
if (Ce.current = V, e === V) return;
|
|
127
|
+
if (U.current != null && (cancelAnimationFrame(U.current), U.current = null), ye || A <= 0) {
|
|
128
|
+
be(!1), W(null);
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
|
|
131
|
+
W(e), Ee(1);
|
|
132
132
|
let t = performance.now(), n = (e) => {
|
|
133
|
-
let r = Math.min(1, (e - t) /
|
|
134
|
-
|
|
133
|
+
let r = Math.min(1, (e - t) / A);
|
|
134
|
+
Ee(1 - _.easeCubic(r)), r < 1 ? U.current = requestAnimationFrame(n) : (U.current = null, W(null));
|
|
135
135
|
};
|
|
136
|
-
return
|
|
137
|
-
|
|
136
|
+
return U.current = requestAnimationFrame(n), () => {
|
|
137
|
+
U.current != null && cancelAnimationFrame(U.current);
|
|
138
138
|
};
|
|
139
139
|
}, [
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
V,
|
|
141
|
+
A,
|
|
142
|
+
ye
|
|
143
143
|
]);
|
|
144
|
-
let
|
|
145
|
-
switch (
|
|
144
|
+
let G = c((e) => e.data.colorConfig?.fill ?? P[e.depth % P.length], [P]), K = c((e) => {
|
|
145
|
+
switch (r) {
|
|
146
146
|
case "LR": return {
|
|
147
147
|
x: e.y,
|
|
148
|
-
y: e.x -
|
|
148
|
+
y: e.x - I * .4
|
|
149
149
|
};
|
|
150
150
|
case "RL": return {
|
|
151
|
-
x:
|
|
152
|
-
y: e.x -
|
|
151
|
+
x: H - e.y,
|
|
152
|
+
y: e.x - I * .4
|
|
153
153
|
};
|
|
154
154
|
case "TB": return {
|
|
155
|
-
x: e.x -
|
|
155
|
+
x: e.x - I * .4,
|
|
156
156
|
y: e.y
|
|
157
157
|
};
|
|
158
158
|
case "BT": return {
|
|
159
|
-
x: e.x -
|
|
160
|
-
y:
|
|
159
|
+
x: e.x - I * .4,
|
|
160
|
+
y: H - e.y
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
163
|
}, [
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
]),
|
|
168
|
-
let t =
|
|
169
|
-
if (
|
|
164
|
+
r,
|
|
165
|
+
I,
|
|
166
|
+
H
|
|
167
|
+
]), De = c((e) => {
|
|
168
|
+
let t = K(e.source), n = K(e.target);
|
|
169
|
+
if (r === "LR" || r === "RL") {
|
|
170
170
|
let e = (t.x + n.x) / 2;
|
|
171
171
|
return `M${t.x},${t.y} C${e},${t.y} ${e},${n.y} ${n.x},${n.y}`;
|
|
172
172
|
}
|
|
173
|
-
let
|
|
174
|
-
return `M${t.x},${t.y} C${t.x},${
|
|
175
|
-
}, [
|
|
173
|
+
let i = (t.y + n.y) / 2;
|
|
174
|
+
return `M${t.x},${t.y} C${t.x},${i} ${n.x},${i} ${n.x},${n.y}`;
|
|
175
|
+
}, [K, r]), q = c((e) => ({
|
|
176
176
|
id: e.data.id ?? null,
|
|
177
177
|
name: e.data.name,
|
|
178
178
|
subname: e.data.subname ?? null,
|
|
@@ -183,47 +183,47 @@ function _({ data: s, orientation: l = "LR", width: d = 800, height: _ = 500, le
|
|
|
183
183
|
path: e.ancestors().map((e) => e.data.name).reverse(),
|
|
184
184
|
childrenCount: e.children?.length ?? 0,
|
|
185
185
|
data: e.data
|
|
186
|
-
}), []), [
|
|
187
|
-
if (
|
|
188
|
-
let [e, t, n, r] =
|
|
186
|
+
}), []), [J, Oe] = p(`0 -${b / 2} ${m} ${b}`), [Y, ke] = p(1), Ae = f(null), je = d(() => {
|
|
187
|
+
if (Y === 1) return J;
|
|
188
|
+
let [e, t, n, r] = J.split(" ").map(Number), i = n / Y, a = r / Y;
|
|
189
189
|
return `${e + (n - i) / 2} ${t + (r - a) / 2} ${i} ${a}`;
|
|
190
|
-
}, [
|
|
191
|
-
|
|
192
|
-
let e =
|
|
190
|
+
}, [J, Y]);
|
|
191
|
+
u(() => {
|
|
192
|
+
let e = Ae.current;
|
|
193
193
|
if (!e) return;
|
|
194
194
|
let t = requestAnimationFrame(() => {
|
|
195
195
|
try {
|
|
196
196
|
let t = e.getBBox();
|
|
197
|
-
|
|
197
|
+
Oe(`${t.x - 24} ${t.y - 24} ${t.width + 48} ${t.height + 48}`);
|
|
198
198
|
} catch {
|
|
199
|
-
|
|
199
|
+
Oe(`0 -${b / 2} ${m} ${b}`);
|
|
200
200
|
}
|
|
201
201
|
});
|
|
202
202
|
return () => cancelAnimationFrame(t);
|
|
203
203
|
}, [
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
204
|
+
V,
|
|
205
|
+
m,
|
|
206
|
+
b,
|
|
207
|
+
r
|
|
208
208
|
]);
|
|
209
|
-
let
|
|
210
|
-
if (!
|
|
209
|
+
let Me = c((e) => {
|
|
210
|
+
if (!E || j || !e.ctrlKey) return;
|
|
211
211
|
e.preventDefault();
|
|
212
212
|
let t = e.deltaY < 0 ? 1.15 : 1 / 1.15;
|
|
213
|
-
|
|
214
|
-
}, [
|
|
215
|
-
|
|
216
|
-
e(),
|
|
213
|
+
ke((e) => Math.max(.25, Math.min(8, e * t)));
|
|
214
|
+
}, [E, j]), X = f(null), Ne = (e) => {
|
|
215
|
+
X.current &&= (clearTimeout(X.current), null), X.current = setTimeout(() => {
|
|
216
|
+
e(), X.current = null;
|
|
217
217
|
}, 250);
|
|
218
|
-
},
|
|
219
|
-
|
|
218
|
+
}, Z = () => {
|
|
219
|
+
X.current &&= (clearTimeout(X.current), null);
|
|
220
220
|
};
|
|
221
|
-
|
|
222
|
-
let
|
|
223
|
-
|
|
221
|
+
l(() => () => Z(), []);
|
|
222
|
+
let Pe = c(() => {
|
|
223
|
+
z((e) => {
|
|
224
224
|
if (e.length <= 1) return e;
|
|
225
225
|
let t = e.slice(0, -1);
|
|
226
|
-
return
|
|
226
|
+
return O?.({
|
|
227
227
|
focusedNode: {
|
|
228
228
|
id: t[t.length - 1].id ?? null,
|
|
229
229
|
name: t[t.length - 1].name,
|
|
@@ -239,90 +239,90 @@ function _({ data: s, orientation: l = "LR", width: d = 800, height: _ = 500, le
|
|
|
239
239
|
isRoot: t.length <= 1
|
|
240
240
|
}), t;
|
|
241
241
|
});
|
|
242
|
-
}, [
|
|
243
|
-
|
|
244
|
-
if (!
|
|
242
|
+
}, [O]);
|
|
243
|
+
u(() => {
|
|
244
|
+
if (!E && !D) return;
|
|
245
245
|
let e = (e) => {
|
|
246
|
-
e.key === "Escape" && (
|
|
246
|
+
e.key === "Escape" && (E && ke(1), D && (Z(), z([t]), O?.({
|
|
247
247
|
focusedNode: {
|
|
248
|
-
id:
|
|
249
|
-
name:
|
|
250
|
-
subname:
|
|
248
|
+
id: t.id ?? null,
|
|
249
|
+
name: t.name,
|
|
250
|
+
subname: t.subname ?? null,
|
|
251
251
|
value: null,
|
|
252
252
|
specialValueA: null,
|
|
253
253
|
specialValueB: null,
|
|
254
254
|
depth: 0,
|
|
255
|
-
path: [
|
|
256
|
-
childrenCount:
|
|
257
|
-
data:
|
|
255
|
+
path: [t.name],
|
|
256
|
+
childrenCount: t.children?.length ?? 0,
|
|
257
|
+
data: t
|
|
258
258
|
},
|
|
259
259
|
isRoot: !0
|
|
260
260
|
})));
|
|
261
261
|
};
|
|
262
262
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
263
263
|
}, [
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
264
|
+
E,
|
|
265
|
+
D,
|
|
266
|
+
t,
|
|
267
|
+
O
|
|
268
268
|
]);
|
|
269
|
-
let
|
|
269
|
+
let Fe = f(null), Ie = f(null), [Le, Re] = p(!1), [ze, Be] = p(null), [Ve, He] = p({
|
|
270
270
|
left: 0,
|
|
271
271
|
top: 0
|
|
272
|
-
}), [
|
|
273
|
-
if (
|
|
274
|
-
let n =
|
|
275
|
-
if ((t.ctrlKey || t.metaKey) &&
|
|
276
|
-
|
|
277
|
-
|
|
272
|
+
}), [Q, Ue] = p(null), We = (e, t) => {
|
|
273
|
+
if (j) return;
|
|
274
|
+
let n = q(e);
|
|
275
|
+
if ((t.ctrlKey || t.metaKey) && D && e.children) {
|
|
276
|
+
Ne(() => {
|
|
277
|
+
z((t) => [...t, e.data]), O?.({
|
|
278
278
|
focusedNode: n,
|
|
279
279
|
isRoot: !1
|
|
280
280
|
});
|
|
281
281
|
});
|
|
282
282
|
return;
|
|
283
283
|
}
|
|
284
|
-
if ((t.ctrlKey || t.metaKey) &&
|
|
285
|
-
|
|
284
|
+
if ((t.ctrlKey || t.metaKey) && D) {
|
|
285
|
+
Z(), Pe();
|
|
286
286
|
return;
|
|
287
287
|
}
|
|
288
|
-
if (
|
|
289
|
-
let e =
|
|
290
|
-
|
|
288
|
+
if (k) {
|
|
289
|
+
let e = Fe.current?.getBoundingClientRect();
|
|
290
|
+
He({
|
|
291
291
|
left: e ? t.clientX - e.left : t.clientX,
|
|
292
292
|
top: e ? t.clientY - e.top : t.clientY
|
|
293
|
-
}),
|
|
293
|
+
}), Be(Ie.current), Ue(n), Re(!0);
|
|
294
294
|
}
|
|
295
|
-
|
|
296
|
-
},
|
|
297
|
-
|
|
298
|
-
},
|
|
295
|
+
ce?.(n, t);
|
|
296
|
+
}, Ge = (e, t) => {
|
|
297
|
+
j || !D || (t.ctrlKey || t.metaKey) && (Z(), Pe());
|
|
298
|
+
}, Ke = {
|
|
299
299
|
followCursor: !0,
|
|
300
300
|
enterDelay: 50,
|
|
301
301
|
enterNextDelay: 0,
|
|
302
|
-
disableHoverListener:
|
|
302
|
+
disableHoverListener: j,
|
|
303
303
|
slotProps: { tooltip: { sx: { maxWidth: 240 } } }
|
|
304
|
-
},
|
|
305
|
-
return /* @__PURE__ */
|
|
306
|
-
ref:
|
|
304
|
+
}, $ = Math.round(S * 1.3);
|
|
305
|
+
return /* @__PURE__ */ g(n, {
|
|
306
|
+
ref: Fe,
|
|
307
307
|
sx: {
|
|
308
308
|
display: "inline-flex",
|
|
309
309
|
position: "relative",
|
|
310
|
-
opacity:
|
|
311
|
-
cursor:
|
|
310
|
+
opacity: j ? .5 : 1,
|
|
311
|
+
cursor: j ? "not-allowed" : "default",
|
|
312
312
|
userSelect: "none"
|
|
313
313
|
},
|
|
314
314
|
children: [
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
ref:
|
|
315
|
+
/* @__PURE__ */ h(n, {
|
|
316
|
+
ref: Ie,
|
|
317
317
|
sx: {
|
|
318
318
|
position: "absolute",
|
|
319
|
-
left:
|
|
320
|
-
top:
|
|
319
|
+
left: Ve.left,
|
|
320
|
+
top: Ve.top,
|
|
321
321
|
width: 0,
|
|
322
322
|
height: 0
|
|
323
323
|
}
|
|
324
324
|
}),
|
|
325
|
-
|
|
325
|
+
D && R.length > 1 && /* @__PURE__ */ h(n, {
|
|
326
326
|
sx: {
|
|
327
327
|
position: "absolute",
|
|
328
328
|
top: 4,
|
|
@@ -333,7 +333,7 @@ function _({ data: s, orientation: l = "LR", width: d = 800, height: _ = 500, le
|
|
|
333
333
|
pointerEvents: "none",
|
|
334
334
|
zIndex: 1
|
|
335
335
|
},
|
|
336
|
-
children: /* @__PURE__ */
|
|
336
|
+
children: /* @__PURE__ */ h(o, {
|
|
337
337
|
variant: "caption",
|
|
338
338
|
sx: {
|
|
339
339
|
bgcolor: "action.hover",
|
|
@@ -343,45 +343,45 @@ function _({ data: s, orientation: l = "LR", width: d = 800, height: _ = 500, le
|
|
|
343
343
|
color: "text.secondary",
|
|
344
344
|
fontSize: "0.7rem"
|
|
345
345
|
},
|
|
346
|
-
children:
|
|
346
|
+
children: R.map((e) => e.name).join(" › ")
|
|
347
347
|
})
|
|
348
348
|
}),
|
|
349
|
-
/* @__PURE__ */
|
|
350
|
-
width:
|
|
351
|
-
height:
|
|
352
|
-
viewBox:
|
|
353
|
-
onWheel:
|
|
349
|
+
/* @__PURE__ */ h("svg", {
|
|
350
|
+
width: m,
|
|
351
|
+
height: b,
|
|
352
|
+
viewBox: je,
|
|
353
|
+
onWheel: Me,
|
|
354
354
|
style: {
|
|
355
|
-
fontFamily:
|
|
356
|
-
overflow:
|
|
355
|
+
fontFamily: he ?? "sans-serif",
|
|
356
|
+
overflow: E && Y > 1 ? "hidden" : "visible"
|
|
357
357
|
},
|
|
358
358
|
role: "img",
|
|
359
|
-
"aria-label":
|
|
360
|
-
children: /* @__PURE__ */
|
|
361
|
-
ref:
|
|
359
|
+
"aria-label": t.name,
|
|
360
|
+
children: /* @__PURE__ */ g("g", {
|
|
361
|
+
ref: Ae,
|
|
362
362
|
children: [
|
|
363
|
-
|
|
363
|
+
ge && /* @__PURE__ */ h("text", {
|
|
364
364
|
textAnchor: "middle",
|
|
365
365
|
dy: "0.35em",
|
|
366
366
|
fontSize: 13,
|
|
367
|
-
fill:
|
|
368
|
-
children:
|
|
367
|
+
fill: fe,
|
|
368
|
+
children: N.noData
|
|
369
369
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ h("g", {
|
|
371
371
|
fill: "none",
|
|
372
|
-
stroke:
|
|
373
|
-
strokeOpacity:
|
|
374
|
-
strokeWidth:
|
|
375
|
-
children:
|
|
372
|
+
stroke: pe,
|
|
373
|
+
strokeOpacity: ae,
|
|
374
|
+
strokeWidth: T,
|
|
375
|
+
children: Se.map((e, t) => /* @__PURE__ */ h("path", { d: De(e) }, `link-${t}`))
|
|
376
376
|
}),
|
|
377
|
-
|
|
378
|
-
let
|
|
377
|
+
xe.map((e, t) => {
|
|
378
|
+
let i = K(e), s = G(e), c = q(e), l = e.children ? v.folder : v.person, u = r === "LR", d = r === "RL", f = u ? S + 6 : d ? -(S + 6) : 0, p = !u && !d ? r === "TB" ? S + 16 : -(S + 6) : 0, m = u ? "start" : d ? "end" : "middle", _ = /* @__PURE__ */ g(n, {
|
|
379
379
|
sx: {
|
|
380
380
|
py: .5,
|
|
381
381
|
minWidth: 140
|
|
382
382
|
},
|
|
383
383
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ h(o, {
|
|
385
385
|
variant: "caption",
|
|
386
386
|
sx: {
|
|
387
387
|
fontWeight: "bold",
|
|
@@ -390,7 +390,7 @@ function _({ data: s, orientation: l = "LR", width: d = 800, height: _ = 500, le
|
|
|
390
390
|
},
|
|
391
391
|
children: e.data.name
|
|
392
392
|
}),
|
|
393
|
-
e.data.subname && /* @__PURE__ */
|
|
393
|
+
e.data.subname && /* @__PURE__ */ h(o, {
|
|
394
394
|
variant: "caption",
|
|
395
395
|
sx: {
|
|
396
396
|
display: "block",
|
|
@@ -398,54 +398,54 @@ function _({ data: s, orientation: l = "LR", width: d = 800, height: _ = 500, le
|
|
|
398
398
|
},
|
|
399
399
|
children: e.data.subname
|
|
400
400
|
}),
|
|
401
|
-
(
|
|
401
|
+
(c.specialValueA != null || c.specialValueB != null || e.children) && /* @__PURE__ */ g(n, {
|
|
402
402
|
sx: {
|
|
403
403
|
mt: .75,
|
|
404
404
|
borderTop: "1px solid rgba(255,255,255,0.2)",
|
|
405
405
|
pt: .75
|
|
406
406
|
},
|
|
407
407
|
children: [
|
|
408
|
-
|
|
408
|
+
c.specialValueA != null && /* @__PURE__ */ g(n, {
|
|
409
409
|
sx: {
|
|
410
410
|
display: "flex",
|
|
411
411
|
justifyContent: "space-between",
|
|
412
412
|
gap: 2
|
|
413
413
|
},
|
|
414
|
-
children: [/* @__PURE__ */
|
|
414
|
+
children: [/* @__PURE__ */ h(o, {
|
|
415
415
|
variant: "caption",
|
|
416
416
|
sx: { opacity: .6 },
|
|
417
|
-
children:
|
|
418
|
-
}), /* @__PURE__ */
|
|
417
|
+
children: N.specialValueA ?? "A"
|
|
418
|
+
}), /* @__PURE__ */ h(o, {
|
|
419
419
|
variant: "caption",
|
|
420
|
-
children: String(
|
|
420
|
+
children: String(c.specialValueA)
|
|
421
421
|
})]
|
|
422
422
|
}),
|
|
423
|
-
|
|
423
|
+
c.specialValueB != null && /* @__PURE__ */ g(n, {
|
|
424
424
|
sx: {
|
|
425
425
|
display: "flex",
|
|
426
426
|
justifyContent: "space-between",
|
|
427
427
|
gap: 2
|
|
428
428
|
},
|
|
429
|
-
children: [/* @__PURE__ */
|
|
429
|
+
children: [/* @__PURE__ */ h(o, {
|
|
430
430
|
variant: "caption",
|
|
431
431
|
sx: { opacity: .6 },
|
|
432
|
-
children:
|
|
433
|
-
}), /* @__PURE__ */
|
|
432
|
+
children: N.specialValueB ?? "B"
|
|
433
|
+
}), /* @__PURE__ */ h(o, {
|
|
434
434
|
variant: "caption",
|
|
435
|
-
children: String(
|
|
435
|
+
children: String(c.specialValueB)
|
|
436
436
|
})]
|
|
437
437
|
}),
|
|
438
|
-
e.children && /* @__PURE__ */
|
|
438
|
+
e.children && /* @__PURE__ */ g(n, {
|
|
439
439
|
sx: {
|
|
440
440
|
display: "flex",
|
|
441
441
|
justifyContent: "space-between",
|
|
442
442
|
gap: 2
|
|
443
443
|
},
|
|
444
|
-
children: [/* @__PURE__ */
|
|
444
|
+
children: [/* @__PURE__ */ h(o, {
|
|
445
445
|
variant: "caption",
|
|
446
446
|
sx: { opacity: .6 },
|
|
447
447
|
children: "Reports"
|
|
448
|
-
}), /* @__PURE__ */
|
|
448
|
+
}), /* @__PURE__ */ h(o, {
|
|
449
449
|
variant: "caption",
|
|
450
450
|
children: e.children.length
|
|
451
451
|
})]
|
|
@@ -454,48 +454,48 @@ function _({ data: s, orientation: l = "LR", width: d = 800, height: _ = 500, le
|
|
|
454
454
|
})
|
|
455
455
|
]
|
|
456
456
|
});
|
|
457
|
-
return /* @__PURE__ */
|
|
458
|
-
...
|
|
459
|
-
title:
|
|
460
|
-
children: /* @__PURE__ */
|
|
461
|
-
transform: `translate(${
|
|
462
|
-
onClick: (t) =>
|
|
463
|
-
onDoubleClick: (t) =>
|
|
457
|
+
return /* @__PURE__ */ h(a, {
|
|
458
|
+
...Ke,
|
|
459
|
+
title: _,
|
|
460
|
+
children: /* @__PURE__ */ g("g", {
|
|
461
|
+
transform: `translate(${i.x},${i.y})`,
|
|
462
|
+
onClick: (t) => We(e, t),
|
|
463
|
+
onDoubleClick: (t) => Ge(e, t),
|
|
464
464
|
onMouseEnter: (t) => {
|
|
465
|
-
|
|
465
|
+
j || le?.(q(e), t);
|
|
466
466
|
},
|
|
467
467
|
onMouseLeave: (e) => {
|
|
468
|
-
|
|
468
|
+
le?.(null, e);
|
|
469
469
|
},
|
|
470
|
-
style: { cursor:
|
|
470
|
+
style: { cursor: j ? "not-allowed" : "pointer" },
|
|
471
471
|
children: [
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
r:
|
|
472
|
+
/* @__PURE__ */ h("circle", {
|
|
473
|
+
r: S + 8,
|
|
474
474
|
fill: "transparent"
|
|
475
475
|
}),
|
|
476
|
-
/* @__PURE__ */
|
|
477
|
-
r:
|
|
478
|
-
fill:
|
|
476
|
+
/* @__PURE__ */ h("circle", {
|
|
477
|
+
r: S + 2,
|
|
478
|
+
fill: s,
|
|
479
479
|
fillOpacity: .15
|
|
480
480
|
}),
|
|
481
|
-
/* @__PURE__ */
|
|
482
|
-
r:
|
|
483
|
-
fill:
|
|
481
|
+
/* @__PURE__ */ h("circle", {
|
|
482
|
+
r: S,
|
|
483
|
+
fill: s
|
|
484
484
|
}),
|
|
485
|
-
|
|
486
|
-
path:
|
|
487
|
-
size:
|
|
485
|
+
ie && /* @__PURE__ */ h(y, {
|
|
486
|
+
path: l,
|
|
487
|
+
size: $
|
|
488
488
|
}),
|
|
489
|
-
|
|
490
|
-
x:
|
|
491
|
-
y:
|
|
489
|
+
te && /* @__PURE__ */ h("text", {
|
|
490
|
+
x: f,
|
|
491
|
+
y: p,
|
|
492
492
|
dy: "0.35em",
|
|
493
|
-
textAnchor:
|
|
494
|
-
fontSize:
|
|
493
|
+
textAnchor: m,
|
|
494
|
+
fontSize: ne,
|
|
495
495
|
fontWeight: e.children ? "bold" : "normal",
|
|
496
|
-
fill: e.data.colorConfig?.textColor ??
|
|
496
|
+
fill: e.data.colorConfig?.textColor ?? fe,
|
|
497
497
|
paintOrder: "stroke",
|
|
498
|
-
stroke:
|
|
498
|
+
stroke: me,
|
|
499
499
|
strokeWidth: 3,
|
|
500
500
|
pointerEvents: "none",
|
|
501
501
|
children: e.data.name
|
|
@@ -504,45 +504,45 @@ function _({ data: s, orientation: l = "LR", width: d = 800, height: _ = 500, le
|
|
|
504
504
|
})
|
|
505
505
|
}, `node-${t}`);
|
|
506
506
|
}),
|
|
507
|
-
|
|
507
|
+
we && ((e, t) => /* @__PURE__ */ g("g", {
|
|
508
508
|
"data-testid": "drill-ghost-layer",
|
|
509
509
|
opacity: t,
|
|
510
510
|
pointerEvents: "none",
|
|
511
|
-
children: [/* @__PURE__ */
|
|
511
|
+
children: [/* @__PURE__ */ h("g", {
|
|
512
512
|
fill: "none",
|
|
513
|
-
stroke:
|
|
514
|
-
strokeOpacity:
|
|
515
|
-
strokeWidth:
|
|
516
|
-
children: e.links().map((e, t) => /* @__PURE__ */
|
|
517
|
-
}), /* @__PURE__ */
|
|
518
|
-
let n =
|
|
519
|
-
return /* @__PURE__ */
|
|
513
|
+
stroke: pe,
|
|
514
|
+
strokeOpacity: ae,
|
|
515
|
+
strokeWidth: T,
|
|
516
|
+
children: e.links().map((e, t) => /* @__PURE__ */ h("path", { d: De(e) }, `ghost-link-${t}`))
|
|
517
|
+
}), /* @__PURE__ */ h("g", { children: e.descendants().map((e, t) => {
|
|
518
|
+
let n = K(e);
|
|
519
|
+
return /* @__PURE__ */ g("g", {
|
|
520
520
|
transform: `translate(${n.x},${n.y})`,
|
|
521
521
|
children: [
|
|
522
|
-
/* @__PURE__ */
|
|
523
|
-
r:
|
|
524
|
-
fill:
|
|
522
|
+
/* @__PURE__ */ h("circle", {
|
|
523
|
+
r: S + 2,
|
|
524
|
+
fill: G(e),
|
|
525
525
|
fillOpacity: .15
|
|
526
526
|
}),
|
|
527
|
-
/* @__PURE__ */
|
|
528
|
-
r:
|
|
529
|
-
fill:
|
|
527
|
+
/* @__PURE__ */ h("circle", {
|
|
528
|
+
r: S,
|
|
529
|
+
fill: G(e)
|
|
530
530
|
}),
|
|
531
|
-
|
|
532
|
-
path: e.children ?
|
|
533
|
-
size:
|
|
531
|
+
ie && /* @__PURE__ */ h(y, {
|
|
532
|
+
path: e.children ? v.folder : v.person,
|
|
533
|
+
size: $
|
|
534
534
|
})
|
|
535
535
|
]
|
|
536
536
|
}, `ghost-node-${t}`);
|
|
537
537
|
}) })]
|
|
538
|
-
}))(
|
|
538
|
+
}))(we, Te)
|
|
539
539
|
]
|
|
540
540
|
})
|
|
541
541
|
}),
|
|
542
|
-
|
|
543
|
-
open:
|
|
544
|
-
anchorEl:
|
|
545
|
-
onClose: () =>
|
|
542
|
+
k && /* @__PURE__ */ h(i, {
|
|
543
|
+
open: Le,
|
|
544
|
+
anchorEl: ze,
|
|
545
|
+
onClose: () => Re(!1),
|
|
546
546
|
anchorOrigin: {
|
|
547
547
|
vertical: "top",
|
|
548
548
|
horizontal: "right"
|
|
@@ -552,15 +552,15 @@ function _({ data: s, orientation: l = "LR", width: d = 800, height: _ = 500, le
|
|
|
552
552
|
horizontal: "left"
|
|
553
553
|
},
|
|
554
554
|
slotProps: { paper: { elevation: 4 } },
|
|
555
|
-
children:
|
|
556
|
-
info:
|
|
557
|
-
labelA:
|
|
558
|
-
labelB:
|
|
555
|
+
children: Q && (se ? se(Q) : /* @__PURE__ */ h(ee, {
|
|
556
|
+
info: Q,
|
|
557
|
+
labelA: N.specialValueA ?? "Value A",
|
|
558
|
+
labelB: N.specialValueB ?? "Value B"
|
|
559
559
|
}))
|
|
560
560
|
})
|
|
561
561
|
]
|
|
562
562
|
});
|
|
563
563
|
}
|
|
564
|
-
|
|
564
|
+
b.displayName = "HorizontalTreeChart";
|
|
565
565
|
//#endregion
|
|
566
|
-
export {
|
|
566
|
+
export { b as HorizontalTreeChart };
|