@cgi-learning-hub/ui 1.4.0-dev.1741972878 → 1.4.0-dev.1741974011
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/dist/components/TreeView/TreeView.cjs.js +8 -8
- package/dist/components/TreeView/TreeView.es.js +831 -803
- package/dist/components/stories/TreeView.stories.cjs.js +7 -2
- package/dist/components/stories/TreeView.stories.d.ts +1 -0
- package/dist/components/stories/TreeView.stories.es.js +86 -29
- package/package.json +1 -1
|
@@ -1,88 +1,88 @@
|
|
|
1
1
|
import { jsx as v, jsxs as de } from "react/jsx-runtime";
|
|
2
|
-
import { D as
|
|
2
|
+
import { D as Ht } from "../../Delete-CbtdIdDB.js";
|
|
3
3
|
import { c as ue } from "../../createSvgIcon-K1Hd8ryN.js";
|
|
4
|
-
import { B as
|
|
4
|
+
import { B as st } from "../../Box-DgqaLb7j.js";
|
|
5
5
|
import * as E from "react";
|
|
6
|
-
import { forwardRef as
|
|
6
|
+
import { forwardRef as en, useCallback as lt, useMemo as nt, useState as tn, useEffect as ot } from "react";
|
|
7
7
|
import { _ as C } from "../../ButtonBase-IZ_QjbpE.js";
|
|
8
8
|
import { w as ve } from "../../warning-C8W811fV.js";
|
|
9
9
|
import { u as Ie } from "../../useForkRef-C_4o__cU.js";
|
|
10
10
|
import { r as H, e as U } from "../../resolveComponentProps-CPmhKPdH.js";
|
|
11
|
-
import { I as
|
|
11
|
+
import { I as at, H as ct, n as J, P as d, G as $e } from "../../generateUtilityClasses-DotvgSDH.js";
|
|
12
12
|
import { a as G } from "../../TransitionGroupContext-DbLioz_6.js";
|
|
13
|
-
import { u as
|
|
13
|
+
import { u as nn } from "../../useThemeProps-BTfGtNci.js";
|
|
14
14
|
import { s as _, f as pe, c as Ne } from "../../DefaultPropsProvider-Cqcb4sws.js";
|
|
15
|
-
import { C as
|
|
16
|
-
import { C as
|
|
17
|
-
import { u as
|
|
18
|
-
import { u as
|
|
15
|
+
import { C as dt } from "../../Collapse-CLl0D4CI.js";
|
|
16
|
+
import { C as ut } from "../../Checkbox-DgU-0k3O.js";
|
|
17
|
+
import { u as pt } from "../../unsupportedProp-BuVD30Gh.js";
|
|
18
|
+
import { u as on, a as V } from "../../useSlotProps-C9tsxDNg.js";
|
|
19
19
|
import { u as ce } from "../../useEventCallback-BAQJJ3ye.js";
|
|
20
|
-
import { o as
|
|
21
|
-
import { e as
|
|
20
|
+
import { o as rn } from "../../ownerDocument-CUrv0DIK.js";
|
|
21
|
+
import { e as sn } from "../../elementTypeAcceptingRef-5ESWTE79.js";
|
|
22
22
|
const Ve = ue(/* @__PURE__ */ v("path", {
|
|
23
23
|
d: "M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"
|
|
24
|
-
}), "Folder"),
|
|
24
|
+
}), "Folder"), ln = ue(/* @__PURE__ */ v("path", {
|
|
25
25
|
d: "M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"
|
|
26
|
-
}), "KeyboardArrowDown"),
|
|
26
|
+
}), "KeyboardArrowDown"), an = ue(/* @__PURE__ */ v("path", {
|
|
27
27
|
d: "M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"
|
|
28
|
-
}), "KeyboardArrowRight"),
|
|
28
|
+
}), "KeyboardArrowRight"), cn = ue(/* @__PURE__ */ v("path", {
|
|
29
29
|
d: "M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92"
|
|
30
30
|
}), "Share");
|
|
31
|
-
function
|
|
32
|
-
return
|
|
31
|
+
function dn(e) {
|
|
32
|
+
return at("MuiRichTreeView", e);
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
ct("MuiRichTreeView", ["root"]);
|
|
35
35
|
function je(e) {
|
|
36
|
-
return
|
|
36
|
+
return nn;
|
|
37
37
|
}
|
|
38
|
-
const
|
|
39
|
-
const n = E.useRef({}), [o,
|
|
40
|
-
const
|
|
41
|
-
return e.forEach((
|
|
42
|
-
|
|
38
|
+
const un = (e, t) => {
|
|
39
|
+
const n = E.useRef({}), [o, i] = E.useState(() => {
|
|
40
|
+
const f = {};
|
|
41
|
+
return e.forEach((l) => {
|
|
42
|
+
l.models && Object.entries(l.models).forEach(([u, c]) => {
|
|
43
43
|
n.current[u] = {
|
|
44
44
|
isControlled: t[u] !== void 0,
|
|
45
45
|
getDefaultValue: c.getDefaultValue
|
|
46
|
-
},
|
|
46
|
+
}, f[u] = c.getDefaultValue(t);
|
|
47
47
|
});
|
|
48
|
-
}),
|
|
49
|
-
}), I = Object.fromEntries(Object.entries(n.current).map(([
|
|
50
|
-
const u = t[
|
|
51
|
-
return [
|
|
48
|
+
}), f;
|
|
49
|
+
}), I = Object.fromEntries(Object.entries(n.current).map(([f, l]) => {
|
|
50
|
+
const u = t[f] ?? o[f];
|
|
51
|
+
return [f, {
|
|
52
52
|
value: u,
|
|
53
53
|
setControlledValue: (c) => {
|
|
54
|
-
|
|
55
|
-
[
|
|
54
|
+
l.isControlled || i((r) => C({}, r, {
|
|
55
|
+
[f]: c
|
|
56
56
|
}));
|
|
57
57
|
}
|
|
58
58
|
}];
|
|
59
59
|
}));
|
|
60
|
-
return process.env.NODE_ENV !== "production" && Object.entries(n.current).forEach(([
|
|
61
|
-
const u = t[
|
|
60
|
+
return process.env.NODE_ENV !== "production" && Object.entries(n.current).forEach(([f, l]) => {
|
|
61
|
+
const u = t[f], c = l.getDefaultValue(t);
|
|
62
62
|
E.useEffect(() => {
|
|
63
|
-
|
|
63
|
+
l.isControlled !== (u !== void 0) && console.error([`MUI X: A component is changing the ${l.isControlled ? "" : "un"}controlled ${f} state of TreeView to be ${l.isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${f} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join(`
|
|
64
64
|
`));
|
|
65
65
|
}, [u]);
|
|
66
66
|
const {
|
|
67
|
-
current:
|
|
67
|
+
current: r
|
|
68
68
|
} = E.useRef(c);
|
|
69
69
|
E.useEffect(() => {
|
|
70
|
-
!
|
|
70
|
+
!l.isControlled && r !== c && console.error([`MUI X: A component is changing the default ${f} state of an uncontrolled TreeView after being initialized. To suppress this warning opt to use a controlled TreeView.`].join(`
|
|
71
71
|
`));
|
|
72
72
|
}, [JSON.stringify(c)]);
|
|
73
73
|
}), I;
|
|
74
74
|
};
|
|
75
|
-
class
|
|
75
|
+
class pn {
|
|
76
76
|
constructor() {
|
|
77
77
|
this.maxListeners = 20, this.warnOnce = !1, this.events = {};
|
|
78
78
|
}
|
|
79
79
|
on(t, n, o = {}) {
|
|
80
|
-
let
|
|
81
|
-
if (
|
|
80
|
+
let i = this.events[t];
|
|
81
|
+
if (i || (i = {
|
|
82
82
|
highPriority: /* @__PURE__ */ new Map(),
|
|
83
83
|
regular: /* @__PURE__ */ new Map()
|
|
84
|
-
}, this.events[t] =
|
|
85
|
-
const I =
|
|
84
|
+
}, this.events[t] = i), o.isFirst ? i.highPriority.set(n, !0) : i.regular.set(n, !0), process.env.NODE_ENV !== "production") {
|
|
85
|
+
const I = i.highPriority.size + i.regular.size;
|
|
86
86
|
I > this.maxListeners && !this.warnOnce && (this.warnOnce = !0, console.warn([`Possible EventEmitter memory leak detected. ${I} ${t} listeners added.`].join(`
|
|
87
87
|
`)));
|
|
88
88
|
}
|
|
@@ -97,29 +97,29 @@ class dn {
|
|
|
97
97
|
const o = this.events[t];
|
|
98
98
|
if (!o)
|
|
99
99
|
return;
|
|
100
|
-
const
|
|
101
|
-
for (let
|
|
102
|
-
const
|
|
103
|
-
o.highPriority.has(
|
|
100
|
+
const i = Array.from(o.highPriority.keys()), I = Array.from(o.regular.keys());
|
|
101
|
+
for (let f = i.length - 1; f >= 0; f -= 1) {
|
|
102
|
+
const l = i[f];
|
|
103
|
+
o.highPriority.has(l) && l.apply(this, n);
|
|
104
104
|
}
|
|
105
|
-
for (let
|
|
106
|
-
const
|
|
107
|
-
o.regular.has(
|
|
105
|
+
for (let f = 0; f < I.length; f += 1) {
|
|
106
|
+
const l = I[f];
|
|
107
|
+
o.regular.has(l) && l.apply(this, n);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
once(t, n) {
|
|
111
111
|
const o = this;
|
|
112
|
-
this.on(t, function
|
|
113
|
-
o.removeListener(t,
|
|
112
|
+
this.on(t, function i(...I) {
|
|
113
|
+
o.removeListener(t, i), n.apply(o, I);
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
const
|
|
118
|
-
const [e] = E.useState(() => new
|
|
119
|
-
const [
|
|
120
|
-
|
|
121
|
-
}, [e]), n = E.useCallback((o,
|
|
122
|
-
e.removeListener(o,
|
|
117
|
+
const fn = (e) => e.isPropagationStopped !== void 0, ft = () => {
|
|
118
|
+
const [e] = E.useState(() => new pn()), t = E.useCallback((...o) => {
|
|
119
|
+
const [i, I, f = {}] = o;
|
|
120
|
+
f.defaultMuiPrevented = !1, !(fn(f) && f.isPropagationStopped()) && e.emit(i, I, f);
|
|
121
|
+
}, [e]), n = E.useCallback((o, i) => (e.on(o, i), () => {
|
|
122
|
+
e.removeListener(o, i);
|
|
123
123
|
}), [e]);
|
|
124
124
|
return {
|
|
125
125
|
instance: {
|
|
@@ -128,8 +128,8 @@ const un = (e) => e.isPropagationStopped !== void 0, ut = () => {
|
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
};
|
|
131
|
-
|
|
132
|
-
const
|
|
131
|
+
ft.params = {};
|
|
132
|
+
const mt = ({
|
|
133
133
|
plugins: e
|
|
134
134
|
}) => {
|
|
135
135
|
const t = new Set(e);
|
|
@@ -139,9 +139,9 @@ const pt = ({
|
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
141
|
};
|
|
142
|
-
|
|
143
|
-
let
|
|
144
|
-
const
|
|
142
|
+
mt.params = {};
|
|
143
|
+
let rt = 0;
|
|
144
|
+
const mn = () => (rt += 1, `mui-tree-view-${rt}`), Ke = ({
|
|
145
145
|
id: e,
|
|
146
146
|
treeId: t = "",
|
|
147
147
|
itemId: n
|
|
@@ -151,9 +151,9 @@ const pn = () => (ot += 1, `mui-tree-view-${ot}`), Ke = ({
|
|
|
151
151
|
setState: n
|
|
152
152
|
}) => {
|
|
153
153
|
E.useEffect(() => {
|
|
154
|
-
n((
|
|
155
|
-
id: C({},
|
|
156
|
-
treeId: e.id ??
|
|
154
|
+
n((i) => i.id.treeId === e.id && i.id.treeId !== void 0 ? i : C({}, i, {
|
|
155
|
+
id: C({}, i.id, {
|
|
156
|
+
treeId: e.id ?? mn()
|
|
157
157
|
})
|
|
158
158
|
}));
|
|
159
159
|
}, [n, e.id]);
|
|
@@ -177,65 +177,65 @@ _e.getInitialState = ({
|
|
|
177
177
|
treeId: e ?? void 0
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
|
-
const
|
|
180
|
+
const In = [ft, mt, _e], gn = ["slots", "slotProps", "apiRef", "experimentalFeatures"], bn = (e) => {
|
|
181
181
|
let {
|
|
182
182
|
props: {
|
|
183
183
|
slots: t,
|
|
184
184
|
slotProps: n,
|
|
185
185
|
apiRef: o,
|
|
186
|
-
experimentalFeatures:
|
|
186
|
+
experimentalFeatures: i
|
|
187
187
|
},
|
|
188
188
|
plugins: I
|
|
189
|
-
} = e,
|
|
190
|
-
const
|
|
191
|
-
I.forEach((
|
|
192
|
-
Object.assign(
|
|
189
|
+
} = e, f = G(e.props, gn);
|
|
190
|
+
const l = {};
|
|
191
|
+
I.forEach((p) => {
|
|
192
|
+
Object.assign(l, p.params);
|
|
193
193
|
});
|
|
194
194
|
const u = {}, c = {};
|
|
195
|
-
Object.keys(
|
|
196
|
-
const a = p
|
|
197
|
-
|
|
195
|
+
Object.keys(f).forEach((p) => {
|
|
196
|
+
const a = f[p];
|
|
197
|
+
l[p] ? u[p] = a : c[p] = a;
|
|
198
198
|
});
|
|
199
|
-
const
|
|
200
|
-
params:
|
|
201
|
-
experimentalFeatures:
|
|
202
|
-
}) :
|
|
199
|
+
const r = i ?? {}, s = I.reduce((p, a) => a.getDefaultizedParams ? a.getDefaultizedParams({
|
|
200
|
+
params: p,
|
|
201
|
+
experimentalFeatures: r
|
|
202
|
+
}) : p, u);
|
|
203
203
|
return {
|
|
204
204
|
apiRef: o,
|
|
205
205
|
forwardedProps: c,
|
|
206
|
-
pluginParams:
|
|
206
|
+
pluginParams: s,
|
|
207
207
|
slots: t ?? {},
|
|
208
208
|
slotProps: n ?? {},
|
|
209
|
-
experimentalFeatures:
|
|
209
|
+
experimentalFeatures: r
|
|
210
210
|
};
|
|
211
|
-
},
|
|
211
|
+
}, hn = ({
|
|
212
212
|
plugins: e,
|
|
213
213
|
instance: t,
|
|
214
214
|
publicAPI: n,
|
|
215
215
|
rootRef: o
|
|
216
216
|
}) => ({
|
|
217
|
-
runItemPlugins: (
|
|
217
|
+
runItemPlugins: (l) => {
|
|
218
218
|
let u = null, c = null;
|
|
219
|
-
const
|
|
220
|
-
e.forEach((
|
|
221
|
-
if (!
|
|
219
|
+
const r = [], s = {};
|
|
220
|
+
e.forEach((x) => {
|
|
221
|
+
if (!x.itemPlugin)
|
|
222
222
|
return;
|
|
223
|
-
const g =
|
|
224
|
-
props:
|
|
223
|
+
const g = x.itemPlugin({
|
|
224
|
+
props: l,
|
|
225
225
|
rootRef: u,
|
|
226
226
|
contentRef: c
|
|
227
227
|
});
|
|
228
|
-
g != null && g.rootRef && (u = g.rootRef), g != null && g.contentRef && (c = g.contentRef), g != null && g.propsEnhancers && (
|
|
229
|
-
|
|
228
|
+
g != null && g.rootRef && (u = g.rootRef), g != null && g.contentRef && (c = g.contentRef), g != null && g.propsEnhancers && (r.push(g.propsEnhancers), Object.keys(g.propsEnhancers).forEach((m) => {
|
|
229
|
+
s[m] = !0;
|
|
230
230
|
}));
|
|
231
231
|
});
|
|
232
|
-
const
|
|
233
|
-
const
|
|
234
|
-
return
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
}),
|
|
238
|
-
}, a = Object.fromEntries(Object.keys(
|
|
232
|
+
const p = (x) => (g) => {
|
|
233
|
+
const m = {};
|
|
234
|
+
return r.forEach((b) => {
|
|
235
|
+
const h = b[x];
|
|
236
|
+
h != null && Object.assign(m, h(g));
|
|
237
|
+
}), m;
|
|
238
|
+
}, a = Object.fromEntries(Object.keys(s).map((x) => [x, p(x)]));
|
|
239
239
|
return {
|
|
240
240
|
contentRef: c,
|
|
241
241
|
rootRef: u,
|
|
@@ -243,14 +243,14 @@ const fn = [ut, pt, _e], mn = ["slots", "slotProps", "apiRef", "experimentalFeat
|
|
|
243
243
|
};
|
|
244
244
|
},
|
|
245
245
|
wrapItem: ({
|
|
246
|
-
itemId:
|
|
246
|
+
itemId: l,
|
|
247
247
|
children: u
|
|
248
248
|
}) => {
|
|
249
249
|
let c = u;
|
|
250
|
-
for (let
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
itemId:
|
|
250
|
+
for (let r = e.length - 1; r >= 0; r -= 1) {
|
|
251
|
+
const s = e[r];
|
|
252
|
+
s.wrapItem && (c = s.wrapItem({
|
|
253
|
+
itemId: l,
|
|
254
254
|
children: c,
|
|
255
255
|
instance: t
|
|
256
256
|
}));
|
|
@@ -258,12 +258,12 @@ const fn = [ut, pt, _e], mn = ["slots", "slotProps", "apiRef", "experimentalFeat
|
|
|
258
258
|
return c;
|
|
259
259
|
},
|
|
260
260
|
wrapRoot: ({
|
|
261
|
-
children:
|
|
261
|
+
children: l
|
|
262
262
|
}) => {
|
|
263
|
-
let u =
|
|
263
|
+
let u = l;
|
|
264
264
|
for (let c = e.length - 1; c >= 0; c -= 1) {
|
|
265
|
-
const
|
|
266
|
-
|
|
265
|
+
const r = e[c];
|
|
266
|
+
r.wrapRoot && (u = r.wrapRoot({
|
|
267
267
|
children: u,
|
|
268
268
|
instance: t
|
|
269
269
|
}));
|
|
@@ -274,68 +274,68 @@ const fn = [ut, pt, _e], mn = ["slots", "slotProps", "apiRef", "experimentalFeat
|
|
|
274
274
|
rootRef: o,
|
|
275
275
|
publicAPI: n
|
|
276
276
|
});
|
|
277
|
-
function
|
|
277
|
+
function xn(e) {
|
|
278
278
|
const t = E.useRef({});
|
|
279
279
|
return e ? (e.current == null && (e.current = {}), e.current) : t.current;
|
|
280
280
|
}
|
|
281
|
-
const
|
|
281
|
+
const yn = ({
|
|
282
282
|
plugins: e,
|
|
283
283
|
rootRef: t,
|
|
284
284
|
props: n
|
|
285
285
|
}) => {
|
|
286
|
-
const o = [...
|
|
287
|
-
pluginParams:
|
|
286
|
+
const o = [...In, ...e], {
|
|
287
|
+
pluginParams: i,
|
|
288
288
|
forwardedProps: I,
|
|
289
|
-
apiRef:
|
|
290
|
-
experimentalFeatures:
|
|
289
|
+
apiRef: f,
|
|
290
|
+
experimentalFeatures: l,
|
|
291
291
|
slots: u,
|
|
292
292
|
slotProps: c
|
|
293
|
-
} =
|
|
293
|
+
} = bn({
|
|
294
294
|
plugins: o,
|
|
295
295
|
props: n
|
|
296
|
-
}),
|
|
296
|
+
}), r = un(o, i), p = E.useRef({}).current, a = xn(f), x = E.useRef(null), g = Ie(x, t), m = hn({
|
|
297
297
|
plugins: o,
|
|
298
|
-
instance:
|
|
298
|
+
instance: p,
|
|
299
299
|
publicAPI: a,
|
|
300
|
-
rootRef:
|
|
301
|
-
}), [b,
|
|
300
|
+
rootRef: x
|
|
301
|
+
}), [b, h] = E.useState(() => {
|
|
302
302
|
const P = {};
|
|
303
303
|
return o.forEach((D) => {
|
|
304
|
-
D.getInitialState && Object.assign(P, D.getInitialState(
|
|
304
|
+
D.getInitialState && Object.assign(P, D.getInitialState(i));
|
|
305
305
|
}), P;
|
|
306
|
-
}),
|
|
306
|
+
}), w = [], k = (P) => {
|
|
307
307
|
const D = P({
|
|
308
|
-
instance:
|
|
309
|
-
params:
|
|
308
|
+
instance: p,
|
|
309
|
+
params: i,
|
|
310
310
|
slots: u,
|
|
311
311
|
slotProps: c,
|
|
312
|
-
experimentalFeatures:
|
|
312
|
+
experimentalFeatures: l,
|
|
313
313
|
state: b,
|
|
314
|
-
setState:
|
|
315
|
-
rootRef:
|
|
316
|
-
models:
|
|
314
|
+
setState: h,
|
|
315
|
+
rootRef: x,
|
|
316
|
+
models: r,
|
|
317
317
|
plugins: o
|
|
318
318
|
});
|
|
319
|
-
D.getRootProps &&
|
|
319
|
+
D.getRootProps && w.push(D.getRootProps), D.publicAPI && Object.assign(a, D.publicAPI), D.instance && Object.assign(p, D.instance), D.contextValue && Object.assign(m, D.contextValue);
|
|
320
320
|
};
|
|
321
|
-
return o.forEach(
|
|
321
|
+
return o.forEach(k), {
|
|
322
322
|
getRootProps: (P = {}) => {
|
|
323
323
|
const D = C({
|
|
324
324
|
role: "tree"
|
|
325
325
|
}, I, P, {
|
|
326
326
|
ref: g
|
|
327
327
|
});
|
|
328
|
-
return
|
|
328
|
+
return w.forEach((N) => {
|
|
329
329
|
Object.assign(D, N(P));
|
|
330
330
|
}), D;
|
|
331
331
|
},
|
|
332
332
|
rootRef: g,
|
|
333
|
-
contextValue:
|
|
334
|
-
instance:
|
|
333
|
+
contextValue: m,
|
|
334
|
+
instance: p
|
|
335
335
|
};
|
|
336
336
|
}, Be = /* @__PURE__ */ E.createContext(null);
|
|
337
337
|
process.env.NODE_ENV !== "production" && (Be.displayName = "TreeViewContext");
|
|
338
|
-
function
|
|
338
|
+
function Tn(e) {
|
|
339
339
|
const {
|
|
340
340
|
value: t,
|
|
341
341
|
children: n
|
|
@@ -354,56 +354,56 @@ const ie = () => {
|
|
|
354
354
|
throw new Error(["MUI X: Could not find the Tree View context.", "It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.", "This can also happen if you are bundling multiple versions of the Tree View."].join(`
|
|
355
355
|
`));
|
|
356
356
|
return e;
|
|
357
|
-
},
|
|
357
|
+
}, Cn = (e, t, n) => {
|
|
358
358
|
e.$$publishEvent(t, n);
|
|
359
|
-
}, ae = "__TREE_VIEW_ROOT_PARENT_ID__",
|
|
359
|
+
}, ae = "__TREE_VIEW_ROOT_PARENT_ID__", En = (e) => {
|
|
360
360
|
const t = {};
|
|
361
361
|
return e.forEach((n, o) => {
|
|
362
362
|
t[n] = o;
|
|
363
363
|
}), t;
|
|
364
364
|
}, Pe = /* @__PURE__ */ E.createContext(() => -1);
|
|
365
365
|
process.env.NODE_ENV !== "production" && (Pe.displayName = "TreeViewItemDepthContext");
|
|
366
|
-
const
|
|
366
|
+
const wn = ["children"], It = ({
|
|
367
367
|
items: e,
|
|
368
368
|
isItemDisabled: t,
|
|
369
369
|
getItemLabel: n,
|
|
370
370
|
getItemId: o
|
|
371
371
|
}) => {
|
|
372
|
-
const
|
|
372
|
+
const i = {}, I = {}, f = {
|
|
373
373
|
[ae]: []
|
|
374
|
-
},
|
|
375
|
-
var g,
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
374
|
+
}, l = (c, r, s) => {
|
|
375
|
+
var g, m;
|
|
376
|
+
const p = o ? o(c) : c.id;
|
|
377
|
+
if (p == null)
|
|
378
378
|
throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", "An item was provided without id in the `items` prop:", JSON.stringify(c)].join(`
|
|
379
379
|
`));
|
|
380
|
-
if (
|
|
381
|
-
throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", `Two items were provided with the same id in the \`items\` prop: "${
|
|
380
|
+
if (i[p] != null)
|
|
381
|
+
throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", `Two items were provided with the same id in the \`items\` prop: "${p}"`].join(`
|
|
382
382
|
`));
|
|
383
383
|
const a = n ? n(c) : c.label;
|
|
384
384
|
if (a == null)
|
|
385
385
|
throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.", "An item was provided without label in the `items` prop:", JSON.stringify(c)].join(`
|
|
386
386
|
`));
|
|
387
|
-
|
|
388
|
-
id:
|
|
387
|
+
i[p] = {
|
|
388
|
+
id: p,
|
|
389
389
|
label: a,
|
|
390
|
-
parentId:
|
|
390
|
+
parentId: s,
|
|
391
391
|
idAttribute: void 0,
|
|
392
392
|
expandable: !!((g = c.children) != null && g.length),
|
|
393
393
|
disabled: t ? t(c) : !1,
|
|
394
|
-
depth:
|
|
395
|
-
}, I[
|
|
396
|
-
const
|
|
397
|
-
|
|
394
|
+
depth: r
|
|
395
|
+
}, I[p] = c;
|
|
396
|
+
const x = s ?? ae;
|
|
397
|
+
f[x] || (f[x] = []), f[x].push(p), (m = c.children) == null || m.forEach((b) => l(b, r + 1, p));
|
|
398
398
|
};
|
|
399
|
-
e.forEach((c) =>
|
|
399
|
+
e.forEach((c) => l(c, 0, null));
|
|
400
400
|
const u = {};
|
|
401
|
-
return Object.keys(
|
|
402
|
-
u[c] =
|
|
401
|
+
return Object.keys(f).forEach((c) => {
|
|
402
|
+
u[c] = En(f[c]);
|
|
403
403
|
}), {
|
|
404
|
-
itemMetaMap:
|
|
404
|
+
itemMetaMap: i,
|
|
405
405
|
itemMap: I,
|
|
406
|
-
itemOrderedChildrenIds:
|
|
406
|
+
itemOrderedChildrenIds: f,
|
|
407
407
|
itemChildrenIndexes: u
|
|
408
408
|
};
|
|
409
409
|
}, he = ({
|
|
@@ -411,53 +411,53 @@ const Cn = ["children"], ft = ({
|
|
|
411
411
|
params: t,
|
|
412
412
|
state: n,
|
|
413
413
|
setState: o,
|
|
414
|
-
experimentalFeatures:
|
|
414
|
+
experimentalFeatures: i
|
|
415
415
|
}) => {
|
|
416
|
-
const I = E.useCallback((b) => n.items.itemMetaMap[b], [n.items.itemMetaMap]),
|
|
417
|
-
const b = (
|
|
418
|
-
const
|
|
419
|
-
return
|
|
416
|
+
const I = E.useCallback((b) => n.items.itemMetaMap[b], [n.items.itemMetaMap]), f = E.useCallback((b) => n.items.itemMap[b], [n.items.itemMap]), l = E.useCallback(() => {
|
|
417
|
+
const b = (h) => {
|
|
418
|
+
const w = n.items.itemMap[h], k = G(w, wn), R = n.items.itemOrderedChildrenIds[h];
|
|
419
|
+
return R && (k.children = R.map(b)), k;
|
|
420
420
|
};
|
|
421
421
|
return n.items.itemOrderedChildrenIds[ae].map(b);
|
|
422
422
|
}, [n.items.itemMap, n.items.itemOrderedChildrenIds]), u = E.useCallback((b) => {
|
|
423
423
|
if (b == null)
|
|
424
424
|
return !1;
|
|
425
|
-
let
|
|
426
|
-
if (!
|
|
425
|
+
let h = e.getItemMeta(b);
|
|
426
|
+
if (!h)
|
|
427
427
|
return !1;
|
|
428
|
-
if (
|
|
428
|
+
if (h.disabled)
|
|
429
429
|
return !0;
|
|
430
|
-
for (;
|
|
431
|
-
if (
|
|
430
|
+
for (; h.parentId != null; )
|
|
431
|
+
if (h = e.getItemMeta(h.parentId), h.disabled)
|
|
432
432
|
return !0;
|
|
433
433
|
return !1;
|
|
434
434
|
}, [e]), c = E.useCallback((b) => {
|
|
435
|
-
const
|
|
436
|
-
return n.items.itemChildrenIndexes[
|
|
437
|
-
}, [e, n.items.itemChildrenIndexes]),
|
|
438
|
-
const
|
|
439
|
-
return
|
|
435
|
+
const h = e.getItemMeta(b).parentId ?? ae;
|
|
436
|
+
return n.items.itemChildrenIndexes[h][b];
|
|
437
|
+
}, [e, n.items.itemChildrenIndexes]), r = E.useCallback((b) => n.items.itemOrderedChildrenIds[b ?? ae] ?? [], [n.items.itemOrderedChildrenIds]), s = (b) => {
|
|
438
|
+
const h = e.getItemMeta(b);
|
|
439
|
+
return h == null ? null : document.getElementById(Ke({
|
|
440
440
|
treeId: n.id.treeId,
|
|
441
441
|
itemId: b,
|
|
442
|
-
id:
|
|
442
|
+
id: h.idAttribute
|
|
443
443
|
}));
|
|
444
|
-
},
|
|
444
|
+
}, p = (b) => t.disabledItemsFocusable ? !0 : !e.isItemDisabled(b), a = E.useRef(!1), x = E.useCallback(() => {
|
|
445
445
|
a.current = !0;
|
|
446
446
|
}, []), g = E.useCallback(() => a.current, []);
|
|
447
447
|
return E.useEffect(() => {
|
|
448
448
|
e.areItemUpdatesPrevented() || o((b) => {
|
|
449
|
-
const
|
|
449
|
+
const h = It({
|
|
450
450
|
items: t.items,
|
|
451
451
|
isItemDisabled: t.isItemDisabled,
|
|
452
452
|
getItemId: t.getItemId,
|
|
453
453
|
getItemLabel: t.getItemLabel
|
|
454
454
|
});
|
|
455
|
-
return Object.values(b.items.itemMetaMap).forEach((
|
|
456
|
-
|
|
457
|
-
id:
|
|
455
|
+
return Object.values(b.items.itemMetaMap).forEach((w) => {
|
|
456
|
+
h.itemMetaMap[w.id] || Cn(e, "removeItem", {
|
|
457
|
+
id: w.id
|
|
458
458
|
});
|
|
459
459
|
}), C({}, b, {
|
|
460
|
-
items:
|
|
460
|
+
items: h
|
|
461
461
|
});
|
|
462
462
|
});
|
|
463
463
|
}, [e, o, t.items, t.isItemDisabled, t.getItemId, t.getItemLabel]), {
|
|
@@ -467,47 +467,47 @@ const Cn = ["children"], ft = ({
|
|
|
467
467
|
}
|
|
468
468
|
}),
|
|
469
469
|
publicAPI: {
|
|
470
|
-
getItem:
|
|
471
|
-
getItemDOMElement:
|
|
472
|
-
getItemTree:
|
|
473
|
-
getItemOrderedChildrenIds:
|
|
470
|
+
getItem: f,
|
|
471
|
+
getItemDOMElement: s,
|
|
472
|
+
getItemTree: l,
|
|
473
|
+
getItemOrderedChildrenIds: r
|
|
474
474
|
},
|
|
475
475
|
instance: {
|
|
476
476
|
getItemMeta: I,
|
|
477
|
-
getItem:
|
|
478
|
-
getItemTree:
|
|
477
|
+
getItem: f,
|
|
478
|
+
getItemTree: l,
|
|
479
479
|
getItemsToRender: () => {
|
|
480
|
-
const b = (
|
|
481
|
-
var
|
|
482
|
-
const
|
|
480
|
+
const b = (h) => {
|
|
481
|
+
var k;
|
|
482
|
+
const w = n.items.itemMetaMap[h];
|
|
483
483
|
return {
|
|
484
|
-
label:
|
|
485
|
-
itemId:
|
|
486
|
-
id:
|
|
487
|
-
children: (
|
|
484
|
+
label: w.label,
|
|
485
|
+
itemId: w.id,
|
|
486
|
+
id: w.idAttribute,
|
|
487
|
+
children: (k = n.items.itemOrderedChildrenIds[h]) == null ? void 0 : k.map(b)
|
|
488
488
|
};
|
|
489
489
|
};
|
|
490
490
|
return n.items.itemOrderedChildrenIds[ae].map(b);
|
|
491
491
|
},
|
|
492
492
|
getItemIndex: c,
|
|
493
|
-
getItemDOMElement:
|
|
494
|
-
getItemOrderedChildrenIds:
|
|
493
|
+
getItemDOMElement: s,
|
|
494
|
+
getItemOrderedChildrenIds: r,
|
|
495
495
|
isItemDisabled: u,
|
|
496
|
-
isItemNavigable:
|
|
497
|
-
preventItemUpdates:
|
|
496
|
+
isItemNavigable: p,
|
|
497
|
+
preventItemUpdates: x,
|
|
498
498
|
areItemUpdatesPrevented: g
|
|
499
499
|
},
|
|
500
500
|
contextValue: {
|
|
501
501
|
items: {
|
|
502
502
|
onItemClick: t.onItemClick,
|
|
503
503
|
disabledItemsFocusable: t.disabledItemsFocusable,
|
|
504
|
-
indentationAtItemLevel:
|
|
504
|
+
indentationAtItemLevel: i.indentationAtItemLevel ?? !1
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
};
|
|
508
508
|
};
|
|
509
509
|
he.getInitialState = (e) => ({
|
|
510
|
-
items:
|
|
510
|
+
items: It({
|
|
511
511
|
items: e.items,
|
|
512
512
|
isItemDisabled: e.isItemDisabled,
|
|
513
513
|
getItemId: e.getItemId,
|
|
@@ -545,44 +545,44 @@ const Se = ({
|
|
|
545
545
|
models: n
|
|
546
546
|
}) => {
|
|
547
547
|
const o = E.useMemo(() => {
|
|
548
|
-
const
|
|
549
|
-
return n.expandedItems.value.forEach((
|
|
550
|
-
|
|
551
|
-
}),
|
|
552
|
-
}, [n.expandedItems.value]),
|
|
548
|
+
const s = /* @__PURE__ */ new Map();
|
|
549
|
+
return n.expandedItems.value.forEach((p) => {
|
|
550
|
+
s.set(p, !0);
|
|
551
|
+
}), s;
|
|
552
|
+
}, [n.expandedItems.value]), i = (s, p) => {
|
|
553
553
|
var a;
|
|
554
|
-
(a = t.onExpandedItemsChange) == null || a.call(t,
|
|
555
|
-
}, I = E.useCallback((
|
|
556
|
-
var
|
|
557
|
-
return !!((
|
|
558
|
-
}, [e]),
|
|
559
|
-
const a = e.isItemExpanded(
|
|
560
|
-
e.setItemExpansion(
|
|
561
|
-
}), u = ce((
|
|
562
|
-
if (e.isItemExpanded(
|
|
554
|
+
(a = t.onExpandedItemsChange) == null || a.call(t, s, p), n.expandedItems.setControlledValue(p);
|
|
555
|
+
}, I = E.useCallback((s) => o.has(s), [o]), f = E.useCallback((s) => {
|
|
556
|
+
var p;
|
|
557
|
+
return !!((p = e.getItemMeta(s)) != null && p.expandable);
|
|
558
|
+
}, [e]), l = ce((s, p) => {
|
|
559
|
+
const a = e.isItemExpanded(p);
|
|
560
|
+
e.setItemExpansion(s, p, !a);
|
|
561
|
+
}), u = ce((s, p, a) => {
|
|
562
|
+
if (e.isItemExpanded(p) === a)
|
|
563
563
|
return;
|
|
564
564
|
let g;
|
|
565
|
-
a ? g = [
|
|
566
|
-
}), c = (
|
|
567
|
-
const a = e.getItemMeta(
|
|
565
|
+
a ? g = [p].concat(n.expandedItems.value) : g = n.expandedItems.value.filter((m) => m !== p), t.onItemExpansionToggle && t.onItemExpansionToggle(s, p, a), i(s, g);
|
|
566
|
+
}), c = (s, p) => {
|
|
567
|
+
const a = e.getItemMeta(p), g = e.getItemOrderedChildrenIds(a.parentId).filter((b) => e.isItemExpandable(b) && !e.isItemExpanded(b)), m = n.expandedItems.value.concat(g);
|
|
568
568
|
g.length > 0 && (t.onItemExpansionToggle && g.forEach((b) => {
|
|
569
|
-
t.onItemExpansionToggle(
|
|
570
|
-
}),
|
|
571
|
-
},
|
|
569
|
+
t.onItemExpansionToggle(s, b, !0);
|
|
570
|
+
}), i(s, m));
|
|
571
|
+
}, r = E.useMemo(() => t.expansionTrigger ? t.expansionTrigger : e.isTreeViewEditable ? "iconContainer" : "content", [t.expansionTrigger, e.isTreeViewEditable]);
|
|
572
572
|
return {
|
|
573
573
|
publicAPI: {
|
|
574
574
|
setItemExpansion: u
|
|
575
575
|
},
|
|
576
576
|
instance: {
|
|
577
577
|
isItemExpanded: I,
|
|
578
|
-
isItemExpandable:
|
|
578
|
+
isItemExpandable: f,
|
|
579
579
|
setItemExpansion: u,
|
|
580
|
-
toggleItemExpansion:
|
|
580
|
+
toggleItemExpansion: l,
|
|
581
581
|
expandAllSiblings: c
|
|
582
582
|
},
|
|
583
583
|
contextValue: {
|
|
584
584
|
expansion: {
|
|
585
|
-
expansionTrigger:
|
|
585
|
+
expansionTrigger: r
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
588
|
};
|
|
@@ -592,11 +592,11 @@ Se.models = {
|
|
|
592
592
|
getDefaultValue: (e) => e.defaultExpandedItems
|
|
593
593
|
}
|
|
594
594
|
};
|
|
595
|
-
const
|
|
595
|
+
const Rn = [];
|
|
596
596
|
Se.getDefaultizedParams = ({
|
|
597
597
|
params: e
|
|
598
598
|
}) => C({}, e, {
|
|
599
|
-
defaultExpandedItems: e.defaultExpandedItems ??
|
|
599
|
+
defaultExpandedItems: e.defaultExpandedItems ?? Rn
|
|
600
600
|
});
|
|
601
601
|
Se.params = {
|
|
602
602
|
expandedItems: !0,
|
|
@@ -605,25 +605,25 @@ Se.params = {
|
|
|
605
605
|
onItemExpansionToggle: !0,
|
|
606
606
|
expansionTrigger: !0
|
|
607
607
|
};
|
|
608
|
-
const
|
|
608
|
+
const gt = (e, t) => {
|
|
609
609
|
let n = t.length - 1;
|
|
610
610
|
for (; n >= 0 && !e.isItemNavigable(t[n]); )
|
|
611
611
|
n -= 1;
|
|
612
612
|
if (n !== -1)
|
|
613
613
|
return t[n];
|
|
614
|
-
},
|
|
615
|
-
const n = e.getItemMeta(t), o = e.getItemOrderedChildrenIds(n.parentId),
|
|
616
|
-
if (
|
|
614
|
+
}, bt = (e, t) => {
|
|
615
|
+
const n = e.getItemMeta(t), o = e.getItemOrderedChildrenIds(n.parentId), i = e.getItemIndex(t);
|
|
616
|
+
if (i === 0)
|
|
617
617
|
return n.parentId;
|
|
618
|
-
let I =
|
|
618
|
+
let I = i - 1;
|
|
619
619
|
for (; !e.isItemNavigable(o[I]) && I >= 0; )
|
|
620
620
|
I -= 1;
|
|
621
621
|
if (I === -1)
|
|
622
|
-
return n.parentId == null ? null :
|
|
623
|
-
let
|
|
624
|
-
for (; e.isItemExpanded(
|
|
625
|
-
|
|
626
|
-
return
|
|
622
|
+
return n.parentId == null ? null : bt(e, n.parentId);
|
|
623
|
+
let f = o[I], l = gt(e, e.getItemOrderedChildrenIds(f));
|
|
624
|
+
for (; e.isItemExpanded(f) && l != null; )
|
|
625
|
+
f = l, l = e.getItemOrderedChildrenIds(f).find(e.isItemNavigable);
|
|
626
|
+
return f;
|
|
627
627
|
}, we = (e, t) => {
|
|
628
628
|
if (e.isItemExpanded(t)) {
|
|
629
629
|
const o = e.getItemOrderedChildrenIds(t).find(e.isItemNavigable);
|
|
@@ -632,9 +632,9 @@ const mt = (e, t) => {
|
|
|
632
632
|
}
|
|
633
633
|
let n = e.getItemMeta(t);
|
|
634
634
|
for (; n != null; ) {
|
|
635
|
-
const o = e.getItemOrderedChildrenIds(n.parentId),
|
|
636
|
-
if (
|
|
637
|
-
let I =
|
|
635
|
+
const o = e.getItemOrderedChildrenIds(n.parentId), i = e.getItemIndex(n.id);
|
|
636
|
+
if (i < o.length - 1) {
|
|
637
|
+
let I = i + 1;
|
|
638
638
|
for (; !e.isItemNavigable(o[I]) && I < o.length - 1; )
|
|
639
639
|
I += 1;
|
|
640
640
|
if (e.isItemNavigable(o[I]))
|
|
@@ -643,45 +643,45 @@ const mt = (e, t) => {
|
|
|
643
643
|
n = e.getItemMeta(n.parentId);
|
|
644
644
|
}
|
|
645
645
|
return null;
|
|
646
|
-
},
|
|
646
|
+
}, ht = (e) => {
|
|
647
647
|
let t = null;
|
|
648
648
|
for (; t == null || e.isItemExpanded(t); ) {
|
|
649
|
-
const n = e.getItemOrderedChildrenIds(t), o =
|
|
649
|
+
const n = e.getItemOrderedChildrenIds(t), o = gt(e, n);
|
|
650
650
|
if (o == null)
|
|
651
651
|
return t;
|
|
652
652
|
t = o;
|
|
653
653
|
}
|
|
654
654
|
return t;
|
|
655
|
-
}, ge = (e) => e.getItemOrderedChildrenIds(null).find(e.isItemNavigable),
|
|
655
|
+
}, ge = (e) => e.getItemOrderedChildrenIds(null).find(e.isItemNavigable), xt = (e, t, n) => {
|
|
656
656
|
if (t === n)
|
|
657
657
|
return [t, n];
|
|
658
|
-
const o = e.getItemMeta(t),
|
|
659
|
-
if (o.parentId ===
|
|
660
|
-
return
|
|
661
|
-
const I = [o.id],
|
|
662
|
-
let
|
|
663
|
-
for (; !
|
|
664
|
-
|
|
665
|
-
const a = c ?
|
|
666
|
-
return
|
|
667
|
-
},
|
|
658
|
+
const o = e.getItemMeta(t), i = e.getItemMeta(n);
|
|
659
|
+
if (o.parentId === i.id || i.parentId === o.id)
|
|
660
|
+
return i.parentId === o.id ? [o.id, i.id] : [i.id, o.id];
|
|
661
|
+
const I = [o.id], f = [i.id];
|
|
662
|
+
let l = o.parentId, u = i.parentId, c = f.indexOf(l) !== -1, r = I.indexOf(u) !== -1, s = !0, p = !0;
|
|
663
|
+
for (; !r && !c; )
|
|
664
|
+
s && (I.push(l), c = f.indexOf(l) !== -1, s = l !== null, !c && s && (l = e.getItemMeta(l).parentId)), p && !c && (f.push(u), r = I.indexOf(u) !== -1, p = u !== null, !r && p && (u = e.getItemMeta(u).parentId));
|
|
665
|
+
const a = c ? l : u, x = e.getItemOrderedChildrenIds(a), g = I[I.indexOf(a) - 1], m = f[f.indexOf(a) - 1];
|
|
666
|
+
return x.indexOf(g) < x.indexOf(m) ? [t, n] : [n, t];
|
|
667
|
+
}, vn = (e, t, n) => {
|
|
668
668
|
const o = (u) => {
|
|
669
669
|
if (e.isItemExpandable(u) && e.isItemExpanded(u))
|
|
670
670
|
return e.getItemOrderedChildrenIds(u)[0];
|
|
671
671
|
let c = e.getItemMeta(u);
|
|
672
672
|
for (; c != null; ) {
|
|
673
|
-
const
|
|
674
|
-
if (
|
|
675
|
-
return
|
|
673
|
+
const r = e.getItemOrderedChildrenIds(c.parentId), s = e.getItemIndex(c.id);
|
|
674
|
+
if (s < r.length - 1)
|
|
675
|
+
return r[s + 1];
|
|
676
676
|
c = e.getItemMeta(c.parentId);
|
|
677
677
|
}
|
|
678
678
|
throw new Error("Invalid range");
|
|
679
|
-
}, [
|
|
680
|
-
let
|
|
681
|
-
for (;
|
|
682
|
-
|
|
683
|
-
return
|
|
684
|
-
},
|
|
679
|
+
}, [i, I] = xt(e, t, n), f = [i];
|
|
680
|
+
let l = i;
|
|
681
|
+
for (; l !== I; )
|
|
682
|
+
l = o(l), e.isItemDisabled(l) || f.push(l);
|
|
683
|
+
return f;
|
|
684
|
+
}, Pn = (e) => {
|
|
685
685
|
let t = ge(e);
|
|
686
686
|
const n = [];
|
|
687
687
|
for (; t != null; )
|
|
@@ -692,49 +692,49 @@ const mt = (e, t) => {
|
|
|
692
692
|
return e.forEach((n) => {
|
|
693
693
|
t[n] = !0;
|
|
694
694
|
}), t;
|
|
695
|
-
},
|
|
695
|
+
}, ke = ({
|
|
696
696
|
instance: e,
|
|
697
697
|
params: t,
|
|
698
698
|
models: n
|
|
699
699
|
}) => {
|
|
700
|
-
const o = E.useRef(null),
|
|
700
|
+
const o = E.useRef(null), i = E.useRef({}), I = E.useMemo(() => {
|
|
701
701
|
const g = /* @__PURE__ */ new Map();
|
|
702
|
-
return Array.isArray(n.selectedItems.value) ? n.selectedItems.value.forEach((
|
|
703
|
-
g.set(
|
|
702
|
+
return Array.isArray(n.selectedItems.value) ? n.selectedItems.value.forEach((m) => {
|
|
703
|
+
g.set(m, !0);
|
|
704
704
|
}) : n.selectedItems.value != null && g.set(n.selectedItems.value, !0), g;
|
|
705
|
-
}, [n.selectedItems.value]),
|
|
705
|
+
}, [n.selectedItems.value]), f = (g, m) => {
|
|
706
706
|
if (t.onItemSelectionToggle)
|
|
707
707
|
if (t.multiSelect) {
|
|
708
|
-
const b =
|
|
709
|
-
b.forEach((
|
|
710
|
-
t.onItemSelectionToggle(g,
|
|
711
|
-
}),
|
|
712
|
-
t.onItemSelectionToggle(g,
|
|
708
|
+
const b = m.filter((w) => !e.isItemSelected(w)), h = n.selectedItems.value.filter((w) => !m.includes(w));
|
|
709
|
+
b.forEach((w) => {
|
|
710
|
+
t.onItemSelectionToggle(g, w, !0);
|
|
711
|
+
}), h.forEach((w) => {
|
|
712
|
+
t.onItemSelectionToggle(g, w, !1);
|
|
713
713
|
});
|
|
714
|
-
} else
|
|
715
|
-
t.onSelectedItemsChange && t.onSelectedItemsChange(g,
|
|
716
|
-
},
|
|
714
|
+
} else m !== n.selectedItems.value && (n.selectedItems.value != null && t.onItemSelectionToggle(g, n.selectedItems.value, !1), m != null && t.onItemSelectionToggle(g, m, !0));
|
|
715
|
+
t.onSelectedItemsChange && t.onSelectedItemsChange(g, m), n.selectedItems.setControlledValue(m);
|
|
716
|
+
}, l = (g) => I.has(g), u = ({
|
|
717
717
|
event: g,
|
|
718
|
-
itemId:
|
|
718
|
+
itemId: m,
|
|
719
719
|
keepExistingSelection: b = !1,
|
|
720
|
-
shouldBeSelected:
|
|
720
|
+
shouldBeSelected: h
|
|
721
721
|
}) => {
|
|
722
722
|
if (t.disableSelection)
|
|
723
723
|
return;
|
|
724
|
-
let
|
|
724
|
+
let w;
|
|
725
725
|
if (b) {
|
|
726
|
-
const
|
|
727
|
-
|
|
726
|
+
const k = Re(n.selectedItems.value), R = e.isItemSelected(m);
|
|
727
|
+
R && (h === !1 || h == null) ? w = k.filter((P) => P !== m) : !R && (h === !0 || h == null) ? w = [m].concat(k) : w = k;
|
|
728
728
|
} else
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
}, c = (g, [
|
|
729
|
+
h === !1 || h == null && e.isItemSelected(m) ? w = t.multiSelect ? [] : null : w = t.multiSelect ? [m] : m;
|
|
730
|
+
f(g, w), o.current = m, i.current = {};
|
|
731
|
+
}, c = (g, [m, b]) => {
|
|
732
732
|
if (t.disableSelection || !t.multiSelect)
|
|
733
733
|
return;
|
|
734
|
-
let
|
|
735
|
-
Object.keys(
|
|
736
|
-
const
|
|
737
|
-
|
|
734
|
+
let h = Re(n.selectedItems.value).slice();
|
|
735
|
+
Object.keys(i.current).length > 0 && (h = h.filter((P) => !i.current[P]));
|
|
736
|
+
const w = Fe(h), k = vn(e, m, b), R = k.filter((P) => !w[P]);
|
|
737
|
+
h = h.concat(R), f(g, h), i.current = Fe(k);
|
|
738
738
|
};
|
|
739
739
|
return {
|
|
740
740
|
getRootProps: () => ({
|
|
@@ -744,34 +744,34 @@ const mt = (e, t) => {
|
|
|
744
744
|
selectItem: u
|
|
745
745
|
},
|
|
746
746
|
instance: {
|
|
747
|
-
isItemSelected:
|
|
747
|
+
isItemSelected: l,
|
|
748
748
|
selectItem: u,
|
|
749
749
|
selectAllNavigableItems: (g) => {
|
|
750
750
|
if (t.disableSelection || !t.multiSelect)
|
|
751
751
|
return;
|
|
752
|
-
const
|
|
753
|
-
|
|
752
|
+
const m = Pn(e);
|
|
753
|
+
f(g, m), i.current = Fe(m);
|
|
754
754
|
},
|
|
755
|
-
expandSelectionRange: (g,
|
|
755
|
+
expandSelectionRange: (g, m) => {
|
|
756
756
|
if (o.current != null) {
|
|
757
|
-
const [b,
|
|
758
|
-
c(g, [b,
|
|
757
|
+
const [b, h] = xt(e, m, o.current);
|
|
758
|
+
c(g, [b, h]);
|
|
759
759
|
}
|
|
760
760
|
},
|
|
761
|
-
selectRangeFromStartToItem: (g,
|
|
762
|
-
c(g, [ge(e),
|
|
761
|
+
selectRangeFromStartToItem: (g, m) => {
|
|
762
|
+
c(g, [ge(e), m]);
|
|
763
763
|
},
|
|
764
|
-
selectRangeFromItemToEnd: (g,
|
|
765
|
-
c(g, [
|
|
764
|
+
selectRangeFromItemToEnd: (g, m) => {
|
|
765
|
+
c(g, [m, ht(e)]);
|
|
766
766
|
},
|
|
767
|
-
selectItemFromArrowNavigation: (g,
|
|
767
|
+
selectItemFromArrowNavigation: (g, m, b) => {
|
|
768
768
|
if (t.disableSelection || !t.multiSelect)
|
|
769
769
|
return;
|
|
770
|
-
let
|
|
771
|
-
Object.keys(
|
|
772
|
-
[
|
|
770
|
+
let h = Re(n.selectedItems.value).slice();
|
|
771
|
+
Object.keys(i.current).length === 0 ? (h.push(b), i.current = {
|
|
772
|
+
[m]: !0,
|
|
773
773
|
[b]: !0
|
|
774
|
-
}) : (
|
|
774
|
+
}) : (i.current[m] || (i.current = {}), i.current[b] ? (h = h.filter((w) => w !== m), delete i.current[m]) : (h.push(b), i.current[b] = !0)), f(g, h);
|
|
775
775
|
}
|
|
776
776
|
},
|
|
777
777
|
contextValue: {
|
|
@@ -783,21 +783,21 @@ const mt = (e, t) => {
|
|
|
783
783
|
}
|
|
784
784
|
};
|
|
785
785
|
};
|
|
786
|
-
|
|
786
|
+
ke.models = {
|
|
787
787
|
selectedItems: {
|
|
788
788
|
getDefaultValue: (e) => e.defaultSelectedItems
|
|
789
789
|
}
|
|
790
790
|
};
|
|
791
|
-
const
|
|
792
|
-
|
|
791
|
+
const Sn = [];
|
|
792
|
+
ke.getDefaultizedParams = ({
|
|
793
793
|
params: e
|
|
794
794
|
}) => C({}, e, {
|
|
795
795
|
disableSelection: e.disableSelection ?? !1,
|
|
796
796
|
multiSelect: e.multiSelect ?? !1,
|
|
797
797
|
checkboxSelection: e.checkboxSelection ?? !1,
|
|
798
|
-
defaultSelectedItems: e.defaultSelectedItems ?? (e.multiSelect ?
|
|
798
|
+
defaultSelectedItems: e.defaultSelectedItems ?? (e.multiSelect ? Sn : null)
|
|
799
799
|
});
|
|
800
|
-
|
|
800
|
+
ke.params = {
|
|
801
801
|
disableSelection: !0,
|
|
802
802
|
multiSelect: !0,
|
|
803
803
|
checkboxSelection: !0,
|
|
@@ -806,17 +806,17 @@ Me.params = {
|
|
|
806
806
|
onSelectedItemsChange: !0,
|
|
807
807
|
onItemSelectionToggle: !0
|
|
808
808
|
};
|
|
809
|
-
const
|
|
810
|
-
class
|
|
811
|
-
constructor(t =
|
|
812
|
-
this.timeouts = /* @__PURE__ */ new Map(), this.cleanupTimeout =
|
|
809
|
+
const it = 1e3;
|
|
810
|
+
class kn {
|
|
811
|
+
constructor(t = it) {
|
|
812
|
+
this.timeouts = /* @__PURE__ */ new Map(), this.cleanupTimeout = it, this.cleanupTimeout = t;
|
|
813
813
|
}
|
|
814
814
|
register(t, n, o) {
|
|
815
815
|
this.timeouts || (this.timeouts = /* @__PURE__ */ new Map());
|
|
816
|
-
const
|
|
816
|
+
const i = setTimeout(() => {
|
|
817
817
|
typeof n == "function" && n(), this.timeouts.delete(o.cleanupToken);
|
|
818
818
|
}, this.cleanupTimeout);
|
|
819
|
-
this.timeouts.set(o.cleanupToken,
|
|
819
|
+
this.timeouts.set(o.cleanupToken, i);
|
|
820
820
|
}
|
|
821
821
|
unregister(t) {
|
|
822
822
|
const n = this.timeouts.get(t.cleanupToken);
|
|
@@ -830,7 +830,7 @@ class Pn {
|
|
|
830
830
|
}), this.timeouts = void 0);
|
|
831
831
|
}
|
|
832
832
|
}
|
|
833
|
-
class
|
|
833
|
+
class Mn {
|
|
834
834
|
constructor() {
|
|
835
835
|
this.registry = new FinalizationRegistry((t) => {
|
|
836
836
|
typeof t == "function" && t();
|
|
@@ -846,58 +846,58 @@ class Sn {
|
|
|
846
846
|
reset() {
|
|
847
847
|
}
|
|
848
848
|
}
|
|
849
|
-
class
|
|
849
|
+
class Dn {
|
|
850
850
|
}
|
|
851
|
-
function
|
|
851
|
+
function On(e) {
|
|
852
852
|
let t = 0;
|
|
853
|
-
return function(o,
|
|
854
|
-
e.registry === null && (e.registry = typeof FinalizationRegistry < "u" ? new
|
|
855
|
-
const [
|
|
853
|
+
return function(o, i, I) {
|
|
854
|
+
e.registry === null && (e.registry = typeof FinalizationRegistry < "u" ? new Mn() : new kn());
|
|
855
|
+
const [f] = E.useState(new Dn()), l = E.useRef(null), u = E.useRef(void 0);
|
|
856
856
|
u.current = I;
|
|
857
857
|
const c = E.useRef(null);
|
|
858
|
-
if (!
|
|
859
|
-
const
|
|
858
|
+
if (!l.current && u.current) {
|
|
859
|
+
const r = (s, p) => {
|
|
860
860
|
var a;
|
|
861
|
-
|
|
861
|
+
p.defaultMuiPrevented || (a = u.current) == null || a.call(u, s, p);
|
|
862
862
|
};
|
|
863
|
-
|
|
863
|
+
l.current = o.$$subscribeEvent(i, r), t += 1, c.current = {
|
|
864
864
|
cleanupToken: t
|
|
865
865
|
}, e.registry.register(
|
|
866
|
-
|
|
866
|
+
f,
|
|
867
867
|
// The callback below will be called once this reference stops being retained
|
|
868
868
|
() => {
|
|
869
|
-
var
|
|
870
|
-
(
|
|
869
|
+
var s;
|
|
870
|
+
(s = l.current) == null || s.call(l), l.current = null, c.current = null;
|
|
871
871
|
},
|
|
872
872
|
c.current
|
|
873
873
|
);
|
|
874
|
-
} else !u.current &&
|
|
874
|
+
} else !u.current && l.current && (l.current(), l.current = null, c.current && (e.registry.unregister(c.current), c.current = null));
|
|
875
875
|
E.useEffect(() => {
|
|
876
|
-
if (!
|
|
877
|
-
const
|
|
876
|
+
if (!l.current && u.current) {
|
|
877
|
+
const r = (s, p) => {
|
|
878
878
|
var a;
|
|
879
|
-
|
|
879
|
+
p.defaultMuiPrevented || (a = u.current) == null || a.call(u, s, p);
|
|
880
880
|
};
|
|
881
|
-
|
|
881
|
+
l.current = o.$$subscribeEvent(i, r);
|
|
882
882
|
}
|
|
883
883
|
return c.current && e.registry && (e.registry.unregister(c.current), c.current = null), () => {
|
|
884
|
-
var
|
|
885
|
-
(
|
|
884
|
+
var r;
|
|
885
|
+
(r = l.current) == null || r.call(l), l.current = null;
|
|
886
886
|
};
|
|
887
|
-
}, [o,
|
|
887
|
+
}, [o, i]);
|
|
888
888
|
};
|
|
889
889
|
}
|
|
890
|
-
const
|
|
890
|
+
const An = {
|
|
891
891
|
registry: null
|
|
892
|
-
},
|
|
892
|
+
}, Ln = On(An), yt = (e = document) => {
|
|
893
893
|
const t = e.activeElement;
|
|
894
|
-
return t ? t.shadowRoot ?
|
|
895
|
-
},
|
|
894
|
+
return t ? t.shadowRoot ? yt(t.shadowRoot) : t : null;
|
|
895
|
+
}, Vn = (e, t) => {
|
|
896
896
|
let n = Re(t).find((o) => {
|
|
897
897
|
if (!e.isItemNavigable(o))
|
|
898
898
|
return !1;
|
|
899
|
-
const
|
|
900
|
-
return
|
|
899
|
+
const i = e.getItemMeta(o);
|
|
900
|
+
return i && (i.parentId == null || e.isItemExpanded(i.parentId));
|
|
901
901
|
});
|
|
902
902
|
return n == null && (n = ge(e)), n;
|
|
903
903
|
}, Ue = ({
|
|
@@ -905,22 +905,22 @@ const Dn = {
|
|
|
905
905
|
params: t,
|
|
906
906
|
state: n,
|
|
907
907
|
setState: o,
|
|
908
|
-
models:
|
|
908
|
+
models: i,
|
|
909
909
|
rootRef: I
|
|
910
910
|
}) => {
|
|
911
|
-
const
|
|
912
|
-
const b = typeof
|
|
913
|
-
n.focusedItemId !== b && o((
|
|
911
|
+
const f = Vn(e, i.selectedItems.value), l = ce((m) => {
|
|
912
|
+
const b = typeof m == "function" ? m(n.focusedItemId) : m;
|
|
913
|
+
n.focusedItemId !== b && o((h) => C({}, h, {
|
|
914
914
|
focusedItemId: b
|
|
915
915
|
}));
|
|
916
|
-
}), u = E.useCallback(() => !!I.current && I.current.contains(
|
|
917
|
-
const b = e.getItemMeta(
|
|
916
|
+
}), u = E.useCallback(() => !!I.current && I.current.contains(yt(rn(I.current))), [I]), c = E.useCallback((m) => n.focusedItemId === m && u(), [n.focusedItemId, u]), r = (m) => {
|
|
917
|
+
const b = e.getItemMeta(m);
|
|
918
918
|
return b && (b.parentId == null || e.isItemExpanded(b.parentId));
|
|
919
|
-
},
|
|
920
|
-
const
|
|
921
|
-
|
|
922
|
-
},
|
|
923
|
-
|
|
919
|
+
}, s = (m, b) => {
|
|
920
|
+
const h = e.getItemDOMElement(b);
|
|
921
|
+
h && h.focus(), l(b), t.onItemFocus && t.onItemFocus(m, b);
|
|
922
|
+
}, p = ce((m, b) => {
|
|
923
|
+
r(b) && s(m, b);
|
|
924
924
|
}), a = ce(() => {
|
|
925
925
|
if (n.focusedItemId == null)
|
|
926
926
|
return;
|
|
@@ -928,28 +928,28 @@ const Dn = {
|
|
|
928
928
|
const b = e.getItemDOMElement(n.focusedItemId);
|
|
929
929
|
b && b.blur();
|
|
930
930
|
}
|
|
931
|
-
|
|
932
|
-
}),
|
|
933
|
-
|
|
934
|
-
id:
|
|
931
|
+
l(null);
|
|
932
|
+
}), x = (m) => m === f;
|
|
933
|
+
Ln(e, "removeItem", ({
|
|
934
|
+
id: m
|
|
935
935
|
}) => {
|
|
936
|
-
n.focusedItemId ===
|
|
936
|
+
n.focusedItemId === m && s(null, f);
|
|
937
937
|
});
|
|
938
|
-
const g = (
|
|
939
|
-
var
|
|
940
|
-
(
|
|
938
|
+
const g = (m) => (b) => {
|
|
939
|
+
var h;
|
|
940
|
+
(h = m.onFocus) == null || h.call(m, b), !b.defaultMuiPrevented && b.target === b.currentTarget && s(b, f);
|
|
941
941
|
};
|
|
942
942
|
return {
|
|
943
|
-
getRootProps: (
|
|
944
|
-
onFocus: g(
|
|
943
|
+
getRootProps: (m) => ({
|
|
944
|
+
onFocus: g(m)
|
|
945
945
|
}),
|
|
946
946
|
publicAPI: {
|
|
947
|
-
focusItem:
|
|
947
|
+
focusItem: p
|
|
948
948
|
},
|
|
949
949
|
instance: {
|
|
950
950
|
isItemFocused: c,
|
|
951
|
-
canItemBeTabbed:
|
|
952
|
-
focusItem:
|
|
951
|
+
canItemBeTabbed: x,
|
|
952
|
+
focusItem: p,
|
|
953
953
|
removeFocusedItem: a
|
|
954
954
|
}
|
|
955
955
|
};
|
|
@@ -960,7 +960,7 @@ Ue.getInitialState = () => ({
|
|
|
960
960
|
Ue.params = {
|
|
961
961
|
onItemFocus: !0
|
|
962
962
|
};
|
|
963
|
-
const re = (e, t) => e.getAvailablePlugins().has(t),
|
|
963
|
+
const re = (e, t) => e.getAvailablePlugins().has(t), Fn = ({
|
|
964
964
|
props: e
|
|
965
965
|
}) => {
|
|
966
966
|
const {
|
|
@@ -968,31 +968,31 @@ const re = (e, t) => e.getAvailablePlugins().has(t), Ln = ({
|
|
|
968
968
|
} = ie(), {
|
|
969
969
|
label: n,
|
|
970
970
|
itemId: o
|
|
971
|
-
} = e, [
|
|
971
|
+
} = e, [i, I] = E.useState(n), f = t.isItemBeingEdited(o);
|
|
972
972
|
return E.useEffect(() => {
|
|
973
|
-
|
|
974
|
-
}, [
|
|
973
|
+
f || I(n);
|
|
974
|
+
}, [f, n]), {
|
|
975
975
|
propsEnhancers: {
|
|
976
976
|
labelInput: ({
|
|
977
|
-
externalEventHandlers:
|
|
977
|
+
externalEventHandlers: l,
|
|
978
978
|
interactions: u
|
|
979
979
|
}) => t.isItemEditable(o) ? {
|
|
980
|
-
value:
|
|
980
|
+
value: i ?? "",
|
|
981
981
|
"data-element": "labelInput",
|
|
982
982
|
onChange: (a) => {
|
|
983
|
-
var
|
|
984
|
-
(
|
|
983
|
+
var x;
|
|
984
|
+
(x = l.onChange) == null || x.call(l, a), I(a.target.value);
|
|
985
985
|
},
|
|
986
986
|
onKeyDown: (a) => {
|
|
987
987
|
var g;
|
|
988
|
-
if ((g =
|
|
988
|
+
if ((g = l.onKeyDown) == null || g.call(l, a), a.defaultMuiPrevented)
|
|
989
989
|
return;
|
|
990
|
-
const
|
|
991
|
-
a.key === "Enter" &&
|
|
990
|
+
const x = a.target;
|
|
991
|
+
a.key === "Enter" && x.value ? u.handleSaveItemLabel(a, x.value) : a.key === "Escape" && u.handleCancelItemLabelEditing(a);
|
|
992
992
|
},
|
|
993
993
|
onBlur: (a) => {
|
|
994
|
-
var
|
|
995
|
-
(
|
|
994
|
+
var x;
|
|
995
|
+
(x = l.onBlur) == null || x.call(l, a), !a.defaultMuiPrevented && a.target.value && u.handleSaveItemLabel(a, a.target.value);
|
|
996
996
|
},
|
|
997
997
|
autoFocus: !0,
|
|
998
998
|
type: "text"
|
|
@@ -1005,47 +1005,47 @@ const re = (e, t) => e.getAvailablePlugins().has(t), Ln = ({
|
|
|
1005
1005
|
setState: n,
|
|
1006
1006
|
params: o
|
|
1007
1007
|
}) => {
|
|
1008
|
-
const
|
|
1009
|
-
n((
|
|
1010
|
-
editedItemId:
|
|
1011
|
-
})),
|
|
1012
|
-
},
|
|
1013
|
-
if (
|
|
1008
|
+
const i = E.useRef(t.editedItemId), I = (s) => i.current === s, f = (s) => {
|
|
1009
|
+
n((p) => C({}, p, {
|
|
1010
|
+
editedItemId: s
|
|
1011
|
+
})), i.current = s;
|
|
1012
|
+
}, l = (s) => s === t.editedItemId, u = !!o.isItemEditable, c = (s) => {
|
|
1013
|
+
if (s == null || !u)
|
|
1014
1014
|
return !1;
|
|
1015
|
-
const
|
|
1016
|
-
return
|
|
1017
|
-
},
|
|
1018
|
-
if (!
|
|
1019
|
-
throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "The label of an item cannot be empty.",
|
|
1015
|
+
const p = e.getItem(s);
|
|
1016
|
+
return p ? typeof o.isItemEditable == "function" ? o.isItemEditable(p) : !!o.isItemEditable : !1;
|
|
1017
|
+
}, r = (s, p) => {
|
|
1018
|
+
if (!p)
|
|
1019
|
+
throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "The label of an item cannot be empty.", s].join(`
|
|
1020
1020
|
`));
|
|
1021
1021
|
n((a) => {
|
|
1022
|
-
const
|
|
1023
|
-
return
|
|
1022
|
+
const x = a.items.itemMetaMap[s];
|
|
1023
|
+
return x.label !== p ? C({}, a, {
|
|
1024
1024
|
items: C({}, a.items, {
|
|
1025
1025
|
itemMetaMap: C({}, a.items.itemMetaMap, {
|
|
1026
|
-
[
|
|
1027
|
-
label:
|
|
1026
|
+
[s]: C({}, x, {
|
|
1027
|
+
label: p
|
|
1028
1028
|
})
|
|
1029
1029
|
})
|
|
1030
1030
|
})
|
|
1031
1031
|
}) : a;
|
|
1032
|
-
}), o.onItemLabelChange && o.onItemLabelChange(
|
|
1032
|
+
}), o.onItemLabelChange && o.onItemLabelChange(s, p);
|
|
1033
1033
|
};
|
|
1034
1034
|
return {
|
|
1035
1035
|
instance: {
|
|
1036
|
-
setEditedItemId:
|
|
1037
|
-
isItemBeingEdited:
|
|
1038
|
-
updateItemLabel:
|
|
1036
|
+
setEditedItemId: f,
|
|
1037
|
+
isItemBeingEdited: l,
|
|
1038
|
+
updateItemLabel: r,
|
|
1039
1039
|
isItemEditable: c,
|
|
1040
1040
|
isTreeViewEditable: u,
|
|
1041
1041
|
isItemBeingEditedRef: I
|
|
1042
1042
|
},
|
|
1043
1043
|
publicAPI: {
|
|
1044
|
-
updateItemLabel:
|
|
1044
|
+
updateItemLabel: r
|
|
1045
1045
|
}
|
|
1046
1046
|
};
|
|
1047
1047
|
};
|
|
1048
|
-
K.itemPlugin =
|
|
1048
|
+
K.itemPlugin = Fn;
|
|
1049
1049
|
K.getDefaultizedParams = ({
|
|
1050
1050
|
params: e,
|
|
1051
1051
|
experimentalFeatures: t
|
|
@@ -1062,49 +1062,49 @@ K.params = {
|
|
|
1062
1062
|
onItemLabelChange: !0,
|
|
1063
1063
|
isItemEditable: !0
|
|
1064
1064
|
};
|
|
1065
|
-
function
|
|
1065
|
+
function $n(e) {
|
|
1066
1066
|
return !!e && e.length === 1 && !!e.match(/\S/);
|
|
1067
1067
|
}
|
|
1068
|
-
const
|
|
1068
|
+
const Tt = ({
|
|
1069
1069
|
instance: e,
|
|
1070
1070
|
params: t,
|
|
1071
1071
|
state: n
|
|
1072
1072
|
}) => {
|
|
1073
|
-
const o =
|
|
1074
|
-
|
|
1073
|
+
const o = on(), i = E.useRef({}), I = ce((r) => {
|
|
1074
|
+
i.current = r(i.current);
|
|
1075
1075
|
});
|
|
1076
1076
|
E.useEffect(() => {
|
|
1077
1077
|
if (e.areItemUpdatesPrevented())
|
|
1078
1078
|
return;
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1079
|
+
const r = {}, s = (p) => {
|
|
1080
|
+
r[p.id] = p.label.substring(0, 1).toLowerCase();
|
|
1081
1081
|
};
|
|
1082
|
-
Object.values(n.items.itemMetaMap).forEach(
|
|
1082
|
+
Object.values(n.items.itemMetaMap).forEach(s), i.current = r;
|
|
1083
1083
|
}, [n.items.itemMetaMap, t.getItemId, e]);
|
|
1084
|
-
const
|
|
1085
|
-
const
|
|
1086
|
-
const
|
|
1087
|
-
return
|
|
1084
|
+
const f = (r, s) => {
|
|
1085
|
+
const p = s.toLowerCase(), a = (b) => {
|
|
1086
|
+
const h = we(e, b);
|
|
1087
|
+
return h === null ? ge(e) : h;
|
|
1088
1088
|
};
|
|
1089
|
-
let
|
|
1090
|
-
const
|
|
1091
|
-
for (;
|
|
1092
|
-
|
|
1093
|
-
return
|
|
1094
|
-
},
|
|
1089
|
+
let x = null, g = a(r);
|
|
1090
|
+
const m = {};
|
|
1091
|
+
for (; x == null && !m[g]; )
|
|
1092
|
+
i.current[g] === p ? x = g : (m[g] = !0, g = a(g));
|
|
1093
|
+
return x;
|
|
1094
|
+
}, l = (r) => !t.disableSelection && !e.isItemDisabled(r), u = (r) => !e.isItemDisabled(r) && e.isItemExpandable(r);
|
|
1095
1095
|
return {
|
|
1096
1096
|
instance: {
|
|
1097
1097
|
updateFirstCharMap: I,
|
|
1098
|
-
handleItemKeyDown: (
|
|
1099
|
-
if (
|
|
1098
|
+
handleItemKeyDown: (r, s) => {
|
|
1099
|
+
if (r.defaultMuiPrevented || r.altKey || be(r.target, r.currentTarget))
|
|
1100
1100
|
return;
|
|
1101
|
-
const
|
|
1101
|
+
const p = r.ctrlKey || r.metaKey, a = r.key;
|
|
1102
1102
|
switch (!0) {
|
|
1103
1103
|
// Select the item when pressing "Space"
|
|
1104
|
-
case (a === " " && s
|
|
1105
|
-
|
|
1106
|
-
event:
|
|
1107
|
-
itemId:
|
|
1104
|
+
case (a === " " && l(s)): {
|
|
1105
|
+
r.preventDefault(), t.multiSelect && r.shiftKey ? e.expandSelectionRange(r, s) : e.selectItem({
|
|
1106
|
+
event: r,
|
|
1107
|
+
itemId: s,
|
|
1108
1108
|
keepExistingSelection: t.multiSelect,
|
|
1109
1109
|
shouldBeSelected: t.multiSelect ? void 0 : !0
|
|
1110
1110
|
});
|
|
@@ -1113,78 +1113,78 @@ const xt = ({
|
|
|
1113
1113
|
// If the focused item has children, we expand it.
|
|
1114
1114
|
// If the focused item has no children, we select it.
|
|
1115
1115
|
case a === "Enter": {
|
|
1116
|
-
re(e, K) && e.isItemEditable(
|
|
1117
|
-
event:
|
|
1118
|
-
itemId:
|
|
1116
|
+
re(e, K) && e.isItemEditable(s) && !e.isItemBeingEdited(s) ? e.setEditedItemId(s) : u(s) ? (e.toggleItemExpansion(r, s), r.preventDefault()) : l(s) && (t.multiSelect ? (r.preventDefault(), e.selectItem({
|
|
1117
|
+
event: r,
|
|
1118
|
+
itemId: s,
|
|
1119
1119
|
keepExistingSelection: !0
|
|
1120
|
-
})) : e.isItemSelected(
|
|
1121
|
-
event:
|
|
1122
|
-
itemId:
|
|
1123
|
-
}),
|
|
1120
|
+
})) : e.isItemSelected(s) || (e.selectItem({
|
|
1121
|
+
event: r,
|
|
1122
|
+
itemId: s
|
|
1123
|
+
}), r.preventDefault()));
|
|
1124
1124
|
break;
|
|
1125
1125
|
}
|
|
1126
1126
|
// Focus the next focusable item
|
|
1127
1127
|
case a === "ArrowDown": {
|
|
1128
|
-
const
|
|
1129
|
-
|
|
1128
|
+
const x = we(e, s);
|
|
1129
|
+
x && (r.preventDefault(), e.focusItem(r, x), t.multiSelect && r.shiftKey && l(x) && e.selectItemFromArrowNavigation(r, s, x));
|
|
1130
1130
|
break;
|
|
1131
1131
|
}
|
|
1132
1132
|
// Focuses the previous focusable item
|
|
1133
1133
|
case a === "ArrowUp": {
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1134
|
+
const x = bt(e, s);
|
|
1135
|
+
x && (r.preventDefault(), e.focusItem(r, x), t.multiSelect && r.shiftKey && l(x) && e.selectItemFromArrowNavigation(r, s, x));
|
|
1136
1136
|
break;
|
|
1137
1137
|
}
|
|
1138
1138
|
// If the focused item is expanded, we move the focus to its first child
|
|
1139
1139
|
// If the focused item is collapsed and has children, we expand it
|
|
1140
1140
|
case (a === "ArrowRight" && !o || a === "ArrowLeft" && o): {
|
|
1141
|
-
if (
|
|
1141
|
+
if (p)
|
|
1142
1142
|
return;
|
|
1143
|
-
if (e.isItemExpanded(
|
|
1144
|
-
const
|
|
1145
|
-
|
|
1146
|
-
} else u(
|
|
1143
|
+
if (e.isItemExpanded(s)) {
|
|
1144
|
+
const x = we(e, s);
|
|
1145
|
+
x && (e.focusItem(r, x), r.preventDefault());
|
|
1146
|
+
} else u(s) && (e.toggleItemExpansion(r, s), r.preventDefault());
|
|
1147
1147
|
break;
|
|
1148
1148
|
}
|
|
1149
1149
|
// If the focused item is expanded, we collapse it
|
|
1150
1150
|
// If the focused item is collapsed and has a parent, we move the focus to this parent
|
|
1151
1151
|
case (a === "ArrowLeft" && !o || a === "ArrowRight" && o): {
|
|
1152
|
-
if (
|
|
1152
|
+
if (p)
|
|
1153
1153
|
return;
|
|
1154
|
-
if (u(
|
|
1155
|
-
e.toggleItemExpansion(
|
|
1154
|
+
if (u(s) && e.isItemExpanded(s))
|
|
1155
|
+
e.toggleItemExpansion(r, s), r.preventDefault();
|
|
1156
1156
|
else {
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1157
|
+
const x = e.getItemMeta(s).parentId;
|
|
1158
|
+
x && (e.focusItem(r, x), r.preventDefault());
|
|
1159
1159
|
}
|
|
1160
1160
|
break;
|
|
1161
1161
|
}
|
|
1162
1162
|
// Focuses the first item in the tree
|
|
1163
1163
|
case a === "Home": {
|
|
1164
|
-
s
|
|
1164
|
+
l(s) && t.multiSelect && p && r.shiftKey ? e.selectRangeFromStartToItem(r, s) : e.focusItem(r, ge(e)), r.preventDefault();
|
|
1165
1165
|
break;
|
|
1166
1166
|
}
|
|
1167
1167
|
// Focuses the last item in the tree
|
|
1168
1168
|
case a === "End": {
|
|
1169
|
-
s
|
|
1169
|
+
l(s) && t.multiSelect && p && r.shiftKey ? e.selectRangeFromItemToEnd(r, s) : e.focusItem(r, ht(e)), r.preventDefault();
|
|
1170
1170
|
break;
|
|
1171
1171
|
}
|
|
1172
1172
|
// Expand all siblings that are at the same level as the focused item
|
|
1173
1173
|
case a === "*": {
|
|
1174
|
-
e.expandAllSiblings(
|
|
1174
|
+
e.expandAllSiblings(r, s), r.preventDefault();
|
|
1175
1175
|
break;
|
|
1176
1176
|
}
|
|
1177
1177
|
// Multi select behavior when pressing Ctrl + a
|
|
1178
1178
|
// Selects all the items
|
|
1179
|
-
case (String.fromCharCode(
|
|
1180
|
-
e.selectAllNavigableItems(
|
|
1179
|
+
case (String.fromCharCode(r.keyCode) === "A" && p && t.multiSelect && !t.disableSelection): {
|
|
1180
|
+
e.selectAllNavigableItems(r), r.preventDefault();
|
|
1181
1181
|
break;
|
|
1182
1182
|
}
|
|
1183
1183
|
// Type-ahead
|
|
1184
1184
|
// TODO: Support typing multiple characters
|
|
1185
|
-
case (!
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1185
|
+
case (!p && !r.shiftKey && $n(a)): {
|
|
1186
|
+
const x = f(s, a);
|
|
1187
|
+
x != null && (e.focusItem(r, x), r.preventDefault());
|
|
1188
1188
|
break;
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
@@ -1192,8 +1192,8 @@ const xt = ({
|
|
|
1192
1192
|
}
|
|
1193
1193
|
};
|
|
1194
1194
|
};
|
|
1195
|
-
|
|
1196
|
-
const
|
|
1195
|
+
Tt.params = {};
|
|
1196
|
+
const Ct = ({
|
|
1197
1197
|
slots: e,
|
|
1198
1198
|
slotProps: t
|
|
1199
1199
|
}) => ({
|
|
@@ -1212,9 +1212,9 @@ const yt = ({
|
|
|
1212
1212
|
}
|
|
1213
1213
|
}
|
|
1214
1214
|
});
|
|
1215
|
-
|
|
1216
|
-
const
|
|
1217
|
-
function
|
|
1215
|
+
Ct.params = {};
|
|
1216
|
+
const Nn = [he, Se, ke, Ue, Tt, Ct, K];
|
|
1217
|
+
function Et(e) {
|
|
1218
1218
|
const {
|
|
1219
1219
|
instance: t,
|
|
1220
1220
|
items: {
|
|
@@ -1222,68 +1222,68 @@ function Tt(e) {
|
|
|
1222
1222
|
},
|
|
1223
1223
|
selection: {
|
|
1224
1224
|
multiSelect: o,
|
|
1225
|
-
checkboxSelection:
|
|
1225
|
+
checkboxSelection: i,
|
|
1226
1226
|
disableSelection: I
|
|
1227
1227
|
},
|
|
1228
1228
|
expansion: {
|
|
1229
|
-
expansionTrigger:
|
|
1229
|
+
expansionTrigger: f
|
|
1230
1230
|
}
|
|
1231
|
-
} = ie(),
|
|
1232
|
-
if (!
|
|
1233
|
-
c || t.focusItem(
|
|
1234
|
-
const P = o && (
|
|
1235
|
-
|
|
1231
|
+
} = ie(), l = t.isItemExpandable(e), u = t.isItemExpanded(e), c = t.isItemFocused(e), r = t.isItemSelected(e), s = t.isItemDisabled(e), p = t != null && t.isItemBeingEdited ? t == null ? void 0 : t.isItemBeingEdited(e) : !1, a = t.isItemEditable ? t.isItemEditable(e) : !1, x = (R) => {
|
|
1232
|
+
if (!s) {
|
|
1233
|
+
c || t.focusItem(R, e);
|
|
1234
|
+
const P = o && (R.shiftKey || R.ctrlKey || R.metaKey);
|
|
1235
|
+
l && !(P && t.isItemExpanded(e)) && t.toggleItemExpansion(R, e);
|
|
1236
1236
|
}
|
|
1237
|
-
}, g = (
|
|
1238
|
-
|
|
1239
|
-
event:
|
|
1237
|
+
}, g = (R) => {
|
|
1238
|
+
s || (c || t.focusItem(R, e), o && (R.shiftKey || R.ctrlKey || R.metaKey) ? R.shiftKey ? t.expandSelectionRange(R, e) : t.selectItem({
|
|
1239
|
+
event: R,
|
|
1240
1240
|
itemId: e,
|
|
1241
1241
|
keepExistingSelection: !0
|
|
1242
1242
|
}) : t.selectItem({
|
|
1243
|
-
event:
|
|
1243
|
+
event: R,
|
|
1244
1244
|
itemId: e,
|
|
1245
1245
|
shouldBeSelected: !0
|
|
1246
1246
|
}));
|
|
1247
|
-
},
|
|
1248
|
-
if (I ||
|
|
1247
|
+
}, m = (R) => {
|
|
1248
|
+
if (I || s)
|
|
1249
1249
|
return;
|
|
1250
|
-
const P =
|
|
1251
|
-
o && P ? t.expandSelectionRange(
|
|
1252
|
-
event:
|
|
1250
|
+
const P = R.nativeEvent.shiftKey;
|
|
1251
|
+
o && P ? t.expandSelectionRange(R, e) : t.selectItem({
|
|
1252
|
+
event: R,
|
|
1253
1253
|
itemId: e,
|
|
1254
1254
|
keepExistingSelection: o,
|
|
1255
|
-
shouldBeSelected:
|
|
1255
|
+
shouldBeSelected: R.target.checked
|
|
1256
1256
|
});
|
|
1257
|
-
}, b = (
|
|
1258
|
-
(
|
|
1259
|
-
},
|
|
1257
|
+
}, b = (R) => {
|
|
1258
|
+
(R.shiftKey || R.ctrlKey || R.metaKey || s) && R.preventDefault();
|
|
1259
|
+
}, h = () => {
|
|
1260
1260
|
re(t, K) && t.isItemEditable(e) && (t.isItemBeingEdited(e) ? t.setEditedItemId(null) : t.setEditedItemId(e));
|
|
1261
1261
|
};
|
|
1262
1262
|
return {
|
|
1263
|
-
disabled:
|
|
1263
|
+
disabled: s,
|
|
1264
1264
|
expanded: u,
|
|
1265
|
-
selected:
|
|
1265
|
+
selected: r,
|
|
1266
1266
|
focused: c,
|
|
1267
1267
|
editable: a,
|
|
1268
|
-
editing:
|
|
1268
|
+
editing: p,
|
|
1269
1269
|
disableSelection: I,
|
|
1270
|
-
checkboxSelection:
|
|
1271
|
-
handleExpansion:
|
|
1270
|
+
checkboxSelection: i,
|
|
1271
|
+
handleExpansion: x,
|
|
1272
1272
|
handleSelection: g,
|
|
1273
|
-
handleCheckboxSelection:
|
|
1273
|
+
handleCheckboxSelection: m,
|
|
1274
1274
|
handleContentClick: n,
|
|
1275
1275
|
preventSelection: b,
|
|
1276
|
-
expansionTrigger:
|
|
1277
|
-
toggleItemEditing:
|
|
1278
|
-
handleSaveItemLabel: (
|
|
1279
|
-
re(t, K) && t.isItemBeingEditedRef(e) && (t.updateItemLabel(e, P),
|
|
1276
|
+
expansionTrigger: f,
|
|
1277
|
+
toggleItemEditing: h,
|
|
1278
|
+
handleSaveItemLabel: (R, P) => {
|
|
1279
|
+
re(t, K) && t.isItemBeingEditedRef(e) && (t.updateItemLabel(e, P), h(), t.focusItem(R, e));
|
|
1280
1280
|
},
|
|
1281
|
-
handleCancelItemLabelEditing: (
|
|
1282
|
-
re(t, K) && t.isItemBeingEditedRef(e) && (
|
|
1281
|
+
handleCancelItemLabelEditing: (R) => {
|
|
1282
|
+
re(t, K) && t.isItemBeingEditedRef(e) && (h(), t.focusItem(R, e));
|
|
1283
1283
|
}
|
|
1284
1284
|
};
|
|
1285
1285
|
}
|
|
1286
|
-
const
|
|
1286
|
+
const jn = _("div", {
|
|
1287
1287
|
name: "MuiTreeItem2DragAndDropOverlay",
|
|
1288
1288
|
slot: "Root",
|
|
1289
1289
|
overridesResolver: (e, t) => t.root,
|
|
@@ -1334,7 +1334,7 @@ const $n = _("div", {
|
|
|
1334
1334
|
}]
|
|
1335
1335
|
}));
|
|
1336
1336
|
function ze(e) {
|
|
1337
|
-
return e.action == null ? null : /* @__PURE__ */ v(
|
|
1337
|
+
return e.action == null ? null : /* @__PURE__ */ v(jn, C({}, e));
|
|
1338
1338
|
}
|
|
1339
1339
|
process.env.NODE_ENV !== "production" && (ze.propTypes = {
|
|
1340
1340
|
// ----------------------------- Warning --------------------------------
|
|
@@ -1344,7 +1344,7 @@ process.env.NODE_ENV !== "production" && (ze.propTypes = {
|
|
|
1344
1344
|
action: d.oneOf(["make-child", "move-to-parent", "reorder-above", "reorder-below"]),
|
|
1345
1345
|
style: d.object
|
|
1346
1346
|
});
|
|
1347
|
-
const
|
|
1347
|
+
const wt = _("input", {
|
|
1348
1348
|
name: "MuiTreeItem2",
|
|
1349
1349
|
slot: "LabelInput",
|
|
1350
1350
|
overridesResolver: (e, t) => t.labelInput
|
|
@@ -1360,27 +1360,27 @@ const Ct = _("input", {
|
|
|
1360
1360
|
"&:focus": {
|
|
1361
1361
|
outline: `1px solid ${e.palette.primary.main}`
|
|
1362
1362
|
}
|
|
1363
|
-
})),
|
|
1363
|
+
})), Kn = ["classes", "className", "displayIcon", "expansionIcon", "icon", "label", "itemId", "onClick", "onMouseDown", "dragAndDropOverlayProps", "labelInputProps"], qe = /* @__PURE__ */ E.forwardRef(function(t, n) {
|
|
1364
1364
|
const {
|
|
1365
1365
|
classes: o,
|
|
1366
|
-
className:
|
|
1366
|
+
className: i,
|
|
1367
1367
|
displayIcon: I,
|
|
1368
|
-
expansionIcon:
|
|
1369
|
-
icon:
|
|
1368
|
+
expansionIcon: f,
|
|
1369
|
+
icon: l,
|
|
1370
1370
|
label: u,
|
|
1371
1371
|
itemId: c,
|
|
1372
|
-
onClick:
|
|
1373
|
-
onMouseDown:
|
|
1374
|
-
dragAndDropOverlayProps:
|
|
1372
|
+
onClick: r,
|
|
1373
|
+
onMouseDown: s,
|
|
1374
|
+
dragAndDropOverlayProps: p,
|
|
1375
1375
|
labelInputProps: a
|
|
1376
|
-
} = t,
|
|
1376
|
+
} = t, x = G(t, Kn), {
|
|
1377
1377
|
disabled: g,
|
|
1378
|
-
expanded:
|
|
1378
|
+
expanded: m,
|
|
1379
1379
|
selected: b,
|
|
1380
|
-
focused:
|
|
1381
|
-
editing:
|
|
1382
|
-
editable:
|
|
1383
|
-
disableSelection:
|
|
1380
|
+
focused: h,
|
|
1381
|
+
editing: w,
|
|
1382
|
+
editable: k,
|
|
1383
|
+
disableSelection: R,
|
|
1384
1384
|
checkboxSelection: P,
|
|
1385
1385
|
handleExpansion: D,
|
|
1386
1386
|
handleSelection: N,
|
|
@@ -1389,40 +1389,40 @@ const Ct = _("input", {
|
|
|
1389
1389
|
preventSelection: j,
|
|
1390
1390
|
expansionTrigger: Q,
|
|
1391
1391
|
toggleItemEditing: B
|
|
1392
|
-
} =
|
|
1393
|
-
j(A),
|
|
1392
|
+
} = Et(c), q = l || f || I, X = E.useRef(null), ee = (A) => {
|
|
1393
|
+
j(A), s && s(A);
|
|
1394
1394
|
}, Y = (A) => {
|
|
1395
1395
|
var Z;
|
|
1396
|
-
$ == null || $(A, c), !((Z = X.current) != null && Z.contains(A.target)) && (Q === "content" && D(A), P || N(A),
|
|
1396
|
+
$ == null || $(A, c), !((Z = X.current) != null && Z.contains(A.target)) && (Q === "content" && D(A), P || N(A), r && r(A));
|
|
1397
1397
|
}, te = (A) => {
|
|
1398
1398
|
A.defaultMuiPrevented || B();
|
|
1399
1399
|
};
|
|
1400
1400
|
return (
|
|
1401
1401
|
/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions -- Key event is handled by the TreeView */
|
|
1402
|
-
/* @__PURE__ */ de("div", C({},
|
|
1403
|
-
className: $e(o.root,
|
|
1402
|
+
/* @__PURE__ */ de("div", C({}, x, {
|
|
1403
|
+
className: $e(o.root, i, m && o.expanded, b && o.selected, h && o.focused, g && o.disabled, w && o.editing, k && o.editable),
|
|
1404
1404
|
onClick: Y,
|
|
1405
1405
|
onMouseDown: ee,
|
|
1406
1406
|
ref: n,
|
|
1407
1407
|
children: [/* @__PURE__ */ v("div", {
|
|
1408
1408
|
className: o.iconContainer,
|
|
1409
1409
|
children: q
|
|
1410
|
-
}), P && /* @__PURE__ */ v(
|
|
1410
|
+
}), P && /* @__PURE__ */ v(ut, {
|
|
1411
1411
|
className: o.checkbox,
|
|
1412
1412
|
checked: b,
|
|
1413
1413
|
onChange: z,
|
|
1414
|
-
disabled: g ||
|
|
1414
|
+
disabled: g || R,
|
|
1415
1415
|
ref: X,
|
|
1416
1416
|
tabIndex: -1
|
|
1417
|
-
}),
|
|
1417
|
+
}), w ? /* @__PURE__ */ v(wt, C({}, a, {
|
|
1418
1418
|
className: o.labelInput
|
|
1419
1419
|
})) : /* @__PURE__ */ v("div", C({
|
|
1420
1420
|
className: o.label
|
|
1421
|
-
},
|
|
1421
|
+
}, k && {
|
|
1422
1422
|
onDoubleClick: te
|
|
1423
1423
|
}, {
|
|
1424
1424
|
children: u
|
|
1425
|
-
})),
|
|
1425
|
+
})), p && /* @__PURE__ */ v(ze, C({}, p))]
|
|
1426
1426
|
}))
|
|
1427
1427
|
);
|
|
1428
1428
|
});
|
|
@@ -1470,29 +1470,29 @@ process.env.NODE_ENV !== "production" && (qe.propTypes = {
|
|
|
1470
1470
|
value: d.string
|
|
1471
1471
|
})
|
|
1472
1472
|
});
|
|
1473
|
-
function
|
|
1474
|
-
return
|
|
1473
|
+
function Rt(e) {
|
|
1474
|
+
return at("MuiTreeItem", e);
|
|
1475
1475
|
}
|
|
1476
|
-
const W =
|
|
1476
|
+
const W = ct("MuiTreeItem", ["root", "groupTransition", "content", "expanded", "selected", "focused", "disabled", "iconContainer", "label", "checkbox", "labelInput", "editable", "editing", "dragAndDropOverlay"]), vt = ue(/* @__PURE__ */ v("path", {
|
|
1477
1477
|
d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
|
|
1478
|
-
}), "TreeViewExpandIcon"),
|
|
1478
|
+
}), "TreeViewExpandIcon"), Pt = ue(/* @__PURE__ */ v("path", {
|
|
1479
1479
|
d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
|
|
1480
1480
|
}), "TreeViewCollapseIcon");
|
|
1481
|
-
function
|
|
1481
|
+
function Me(e) {
|
|
1482
1482
|
const {
|
|
1483
1483
|
children: t,
|
|
1484
1484
|
itemId: n
|
|
1485
1485
|
} = e, {
|
|
1486
1486
|
wrapItem: o,
|
|
1487
|
-
instance:
|
|
1487
|
+
instance: i
|
|
1488
1488
|
} = ie();
|
|
1489
1489
|
return o({
|
|
1490
1490
|
children: t,
|
|
1491
1491
|
itemId: n,
|
|
1492
|
-
instance:
|
|
1492
|
+
instance: i
|
|
1493
1493
|
});
|
|
1494
1494
|
}
|
|
1495
|
-
|
|
1495
|
+
Me.propTypes = {
|
|
1496
1496
|
// ----------------------------- Warning --------------------------------
|
|
1497
1497
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1498
1498
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -1500,7 +1500,7 @@ ke.propTypes = {
|
|
|
1500
1500
|
children: d.node,
|
|
1501
1501
|
itemId: d.string.isRequired
|
|
1502
1502
|
};
|
|
1503
|
-
const
|
|
1503
|
+
const _n = ["children", "className", "slots", "slotProps", "ContentComponent", "ContentProps", "itemId", "id", "label", "onClick", "onMouseDown", "onFocus", "onBlur", "onKeyDown"], Bn = ["ownerState"], Un = ["ownerState"], zn = ["ownerState"], qn = je(), Gn = (e) => {
|
|
1504
1504
|
const {
|
|
1505
1505
|
classes: t
|
|
1506
1506
|
} = e;
|
|
@@ -1518,8 +1518,8 @@ const jn = ["children", "className", "slots", "slotProps", "ContentComponent", "
|
|
|
1518
1518
|
editing: ["editing"],
|
|
1519
1519
|
editable: ["editable"],
|
|
1520
1520
|
groupTransition: ["groupTransition"]
|
|
1521
|
-
},
|
|
1522
|
-
},
|
|
1521
|
+
}, Rt, t);
|
|
1522
|
+
}, Xn = _("li", {
|
|
1523
1523
|
name: "MuiTreeItem",
|
|
1524
1524
|
slot: "Root",
|
|
1525
1525
|
overridesResolver: (e, t) => t.root
|
|
@@ -1528,7 +1528,7 @@ const jn = ["children", "className", "slots", "slotProps", "ContentComponent", "
|
|
|
1528
1528
|
margin: 0,
|
|
1529
1529
|
padding: 0,
|
|
1530
1530
|
outline: 0
|
|
1531
|
-
}),
|
|
1531
|
+
}), Wn = _(qe, {
|
|
1532
1532
|
name: "MuiTreeItem",
|
|
1533
1533
|
slot: "Content",
|
|
1534
1534
|
overridesResolver: (e, t) => [t.content, t.iconContainer && {
|
|
@@ -1606,7 +1606,7 @@ const jn = ["children", "className", "slots", "slotProps", "ContentComponent", "
|
|
|
1606
1606
|
paddingLeft: `calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`
|
|
1607
1607
|
}
|
|
1608
1608
|
}]
|
|
1609
|
-
})),
|
|
1609
|
+
})), Jn = _(dt, {
|
|
1610
1610
|
name: "MuiTreeItem",
|
|
1611
1611
|
slot: "GroupTransition",
|
|
1612
1612
|
overridesResolver: (e, t) => t.groupTransition,
|
|
@@ -1623,41 +1623,41 @@ const jn = ["children", "className", "slots", "slotProps", "ContentComponent", "
|
|
|
1623
1623
|
paddingLeft: 0
|
|
1624
1624
|
}
|
|
1625
1625
|
}]
|
|
1626
|
-
}),
|
|
1626
|
+
}), St = /* @__PURE__ */ E.forwardRef(function(t, n) {
|
|
1627
1627
|
var Qe, Ye, Ze, He;
|
|
1628
1628
|
const {
|
|
1629
1629
|
icons: o,
|
|
1630
|
-
runItemPlugins:
|
|
1630
|
+
runItemPlugins: i,
|
|
1631
1631
|
items: {
|
|
1632
1632
|
disabledItemsFocusable: I,
|
|
1633
|
-
indentationAtItemLevel:
|
|
1633
|
+
indentationAtItemLevel: f
|
|
1634
1634
|
},
|
|
1635
1635
|
selection: {
|
|
1636
|
-
disableSelection:
|
|
1636
|
+
disableSelection: l
|
|
1637
1637
|
},
|
|
1638
1638
|
expansion: {
|
|
1639
1639
|
expansionTrigger: u
|
|
1640
1640
|
},
|
|
1641
1641
|
treeId: c,
|
|
1642
|
-
instance:
|
|
1643
|
-
} = ie(),
|
|
1642
|
+
instance: r
|
|
1643
|
+
} = ie(), s = E.useContext(Pe), p = qn({
|
|
1644
1644
|
props: t,
|
|
1645
1645
|
name: "MuiTreeItem"
|
|
1646
1646
|
}), {
|
|
1647
1647
|
children: a,
|
|
1648
|
-
className:
|
|
1648
|
+
className: x,
|
|
1649
1649
|
slots: g,
|
|
1650
|
-
slotProps:
|
|
1650
|
+
slotProps: m,
|
|
1651
1651
|
ContentComponent: b = qe,
|
|
1652
|
-
ContentProps:
|
|
1653
|
-
itemId:
|
|
1654
|
-
id:
|
|
1655
|
-
label:
|
|
1652
|
+
ContentProps: h,
|
|
1653
|
+
itemId: w,
|
|
1654
|
+
id: k,
|
|
1655
|
+
label: R,
|
|
1656
1656
|
onClick: P,
|
|
1657
1657
|
onMouseDown: D,
|
|
1658
1658
|
onBlur: N,
|
|
1659
1659
|
onKeyDown: z
|
|
1660
|
-
} =
|
|
1660
|
+
} = p, $ = G(p, _n), {
|
|
1661
1661
|
expanded: j,
|
|
1662
1662
|
focused: Q,
|
|
1663
1663
|
selected: B,
|
|
@@ -1666,110 +1666,110 @@ const jn = ["children", "className", "slots", "slotProps", "ContentComponent", "
|
|
|
1666
1666
|
handleExpansion: ee,
|
|
1667
1667
|
handleCancelItemLabelEditing: Y,
|
|
1668
1668
|
handleSaveItemLabel: te
|
|
1669
|
-
} =
|
|
1670
|
-
process.env.NODE_ENV !== "production" && (
|
|
1669
|
+
} = Et(w);
|
|
1670
|
+
process.env.NODE_ENV !== "production" && (p.ContentComponent && ve(["MUI X: The ContentComponent prop of the TreeItem component is deprecated and will be removed in the next major release.", "You can use the new TreeItem2 component or the new useTreeItem2 hook to customize the rendering of the content.", "For more detail, see https://mui.com/x/react-tree-view/tree-item-customization/."]), p.ContentProps && ve(["MUI X: The ContentProps prop of the TreeItem component is deprecated and will be removed in the next major release.", "You can use the new TreeItem2 component or the new useTreeItem2 hook to customize the rendering of the content.", "For more detail, see https://mui.com/x/react-tree-view/tree-item-customization/."]));
|
|
1671
1671
|
const {
|
|
1672
1672
|
contentRef: A,
|
|
1673
1673
|
rootRef: Z,
|
|
1674
1674
|
propsEnhancers: L
|
|
1675
|
-
} =
|
|
1676
|
-
expandIcon: (g == null ? void 0 : g.expandIcon) ?? o.slots.expandIcon ??
|
|
1677
|
-
collapseIcon: (g == null ? void 0 : g.collapseIcon) ?? o.slots.collapseIcon ??
|
|
1675
|
+
} = i(p), ne = E.useRef(null), De = E.useRef(null), Ge = Ie(n, Z, ne), Xe = Ie(h == null ? void 0 : h.ref, A, De), se = {
|
|
1676
|
+
expandIcon: (g == null ? void 0 : g.expandIcon) ?? o.slots.expandIcon ?? vt,
|
|
1677
|
+
collapseIcon: (g == null ? void 0 : g.collapseIcon) ?? o.slots.collapseIcon ?? Pt,
|
|
1678
1678
|
endIcon: (g == null ? void 0 : g.endIcon) ?? o.slots.endIcon,
|
|
1679
1679
|
icon: g == null ? void 0 : g.icon,
|
|
1680
1680
|
groupTransition: g == null ? void 0 : g.groupTransition
|
|
1681
|
-
}, Oe = (
|
|
1681
|
+
}, Oe = (M) => Array.isArray(M) ? M.length > 0 && M.some(Oe) : !!M, fe = Oe(a), xe = C({}, p, {
|
|
1682
1682
|
expanded: j,
|
|
1683
1683
|
focused: Q,
|
|
1684
1684
|
selected: B,
|
|
1685
1685
|
disabled: q,
|
|
1686
|
-
indentationAtItemLevel:
|
|
1687
|
-
}), T =
|
|
1686
|
+
indentationAtItemLevel: f
|
|
1687
|
+
}), T = Gn(xe), y = se.groupTransition ?? void 0, S = V({
|
|
1688
1688
|
elementType: y,
|
|
1689
1689
|
ownerState: {},
|
|
1690
|
-
externalSlotProps:
|
|
1690
|
+
externalSlotProps: m == null ? void 0 : m.groupTransition,
|
|
1691
1691
|
additionalProps: C({
|
|
1692
1692
|
unmountOnExit: !0,
|
|
1693
1693
|
in: j,
|
|
1694
1694
|
component: "ul",
|
|
1695
1695
|
role: "group"
|
|
1696
|
-
},
|
|
1696
|
+
}, f ? {
|
|
1697
1697
|
indentationAtItemLevel: !0
|
|
1698
1698
|
} : {}),
|
|
1699
1699
|
className: T.groupTransition
|
|
1700
|
-
}), O = (
|
|
1701
|
-
u === "iconContainer" && ee(
|
|
1700
|
+
}), O = (M) => {
|
|
1701
|
+
u === "iconContainer" && ee(M);
|
|
1702
1702
|
}, F = j ? se.collapseIcon : se.expandIcon, oe = V({
|
|
1703
1703
|
elementType: F,
|
|
1704
1704
|
ownerState: {},
|
|
1705
|
-
externalSlotProps: (
|
|
1705
|
+
externalSlotProps: (M) => j ? C({}, H(o.slotProps.collapseIcon, M), H(m == null ? void 0 : m.collapseIcon, M)) : C({}, H(o.slotProps.expandIcon, M), H(m == null ? void 0 : m.expandIcon, M)),
|
|
1706
1706
|
additionalProps: {
|
|
1707
1707
|
onClick: O
|
|
1708
1708
|
}
|
|
1709
|
-
}), ye = G(oe,
|
|
1709
|
+
}), ye = G(oe, Bn), Te = fe && F ? /* @__PURE__ */ v(F, C({}, ye)) : null, Ae = fe ? void 0 : se.endIcon, Kt = V({
|
|
1710
1710
|
elementType: Ae,
|
|
1711
1711
|
ownerState: {},
|
|
1712
|
-
externalSlotProps: (
|
|
1713
|
-
}),
|
|
1712
|
+
externalSlotProps: (M) => fe ? {} : C({}, H(o.slotProps.endIcon, M), H(m == null ? void 0 : m.endIcon, M))
|
|
1713
|
+
}), _t = G(Kt, Un), Bt = Ae ? /* @__PURE__ */ v(Ae, C({}, _t)) : null, Le = se.icon, Ut = V({
|
|
1714
1714
|
elementType: Le,
|
|
1715
1715
|
ownerState: {},
|
|
1716
|
-
externalSlotProps:
|
|
1717
|
-
}),
|
|
1716
|
+
externalSlotProps: m == null ? void 0 : m.icon
|
|
1717
|
+
}), zt = G(Ut, zn), qt = Le ? /* @__PURE__ */ v(Le, C({}, zt)) : null;
|
|
1718
1718
|
let Ce;
|
|
1719
|
-
B ? Ce = !0 :
|
|
1720
|
-
function
|
|
1721
|
-
!Q && (!q || I) &&
|
|
1719
|
+
B ? Ce = !0 : l || q ? Ce = void 0 : Ce = !1;
|
|
1720
|
+
function Gt(M) {
|
|
1721
|
+
!Q && (!q || I) && M.currentTarget === M.target && r.focusItem(M, w);
|
|
1722
1722
|
}
|
|
1723
|
-
function
|
|
1723
|
+
function Xt(M) {
|
|
1724
1724
|
var le, me, et, tt;
|
|
1725
|
-
N == null || N(
|
|
1725
|
+
N == null || N(M), !(X || // we can exit the editing state by clicking outside the input (within the Tree Item) or by pressing Enter or Escape -> we don't want to remove the focused item from the state in these cases
|
|
1726
1726
|
// we can also exit the editing state by clicking on the root itself -> want to remove the focused item from the state in this case
|
|
1727
|
-
|
|
1727
|
+
M.relatedTarget && be(M.relatedTarget, ne.current) && (M.target && ((me = (le = M.target) == null ? void 0 : le.dataset) == null ? void 0 : me.element) === "labelInput" && be(M.target, ne.current) || ((tt = (et = M.relatedTarget) == null ? void 0 : et.dataset) == null ? void 0 : tt.element) === "labelInput")) && r.removeFocusedItem();
|
|
1728
1728
|
}
|
|
1729
|
-
const
|
|
1729
|
+
const Wt = (M) => {
|
|
1730
1730
|
var le, me;
|
|
1731
|
-
z == null || z(
|
|
1732
|
-
},
|
|
1733
|
-
itemId:
|
|
1731
|
+
z == null || z(M), ((me = (le = M.target) == null ? void 0 : le.dataset) == null ? void 0 : me.element) !== "labelInput" && r.handleItemKeyDown(M, w);
|
|
1732
|
+
}, Jt = Ke({
|
|
1733
|
+
itemId: w,
|
|
1734
1734
|
treeId: c,
|
|
1735
|
-
id:
|
|
1736
|
-
}),
|
|
1735
|
+
id: k
|
|
1736
|
+
}), Qt = r.canItemBeTabbed(w) ? 0 : -1, Ee = {
|
|
1737
1737
|
rootRefObject: ne,
|
|
1738
1738
|
contentRefObject: De,
|
|
1739
1739
|
interactions: {
|
|
1740
1740
|
handleSaveItemLabel: te,
|
|
1741
1741
|
handleCancelItemLabelEditing: Y
|
|
1742
1742
|
}
|
|
1743
|
-
},
|
|
1743
|
+
}, Yt = ((Qe = L.root) == null ? void 0 : Qe.call(L, C({}, Ee, {
|
|
1744
1744
|
externalEventHandlers: U($)
|
|
1745
|
-
}))) ?? {},
|
|
1746
|
-
externalEventHandlers: U(
|
|
1745
|
+
}))) ?? {}, Zt = ((Ye = L.content) == null ? void 0 : Ye.call(L, C({}, Ee, {
|
|
1746
|
+
externalEventHandlers: U(h)
|
|
1747
1747
|
}))) ?? {}, We = ((Ze = L.dragAndDropOverlay) == null ? void 0 : Ze.call(L, C({}, Ee, {
|
|
1748
1748
|
externalEventHandlers: {}
|
|
1749
1749
|
}))) ?? {}, Je = ((He = L.labelInput) == null ? void 0 : He.call(L, C({}, Ee, {
|
|
1750
1750
|
externalEventHandlers: {}
|
|
1751
1751
|
}))) ?? {};
|
|
1752
|
-
return /* @__PURE__ */ v(
|
|
1753
|
-
itemId:
|
|
1754
|
-
children: /* @__PURE__ */ de(
|
|
1755
|
-
className: $e(T.root,
|
|
1752
|
+
return /* @__PURE__ */ v(Me, {
|
|
1753
|
+
itemId: w,
|
|
1754
|
+
children: /* @__PURE__ */ de(Xn, C({
|
|
1755
|
+
className: $e(T.root, x),
|
|
1756
1756
|
role: "treeitem",
|
|
1757
1757
|
"aria-expanded": fe ? j : void 0,
|
|
1758
1758
|
"aria-selected": Ce,
|
|
1759
1759
|
"aria-disabled": q || void 0,
|
|
1760
|
-
id:
|
|
1761
|
-
tabIndex:
|
|
1760
|
+
id: Jt,
|
|
1761
|
+
tabIndex: Qt
|
|
1762
1762
|
}, $, {
|
|
1763
1763
|
ownerState: xe,
|
|
1764
|
-
onFocus:
|
|
1765
|
-
onBlur:
|
|
1766
|
-
onKeyDown:
|
|
1764
|
+
onFocus: Gt,
|
|
1765
|
+
onBlur: Xt,
|
|
1766
|
+
onKeyDown: Wt,
|
|
1767
1767
|
ref: Ge,
|
|
1768
|
-
style:
|
|
1769
|
-
"--TreeView-itemDepth": typeof
|
|
1768
|
+
style: f ? C({}, $.style, {
|
|
1769
|
+
"--TreeView-itemDepth": typeof s == "function" ? s(w) : s
|
|
1770
1770
|
}) : $.style
|
|
1771
|
-
},
|
|
1772
|
-
children: [/* @__PURE__ */ v(
|
|
1771
|
+
}, Yt, {
|
|
1772
|
+
children: [/* @__PURE__ */ v(Wn, C({
|
|
1773
1773
|
as: b,
|
|
1774
1774
|
classes: {
|
|
1775
1775
|
root: T.content,
|
|
@@ -1784,21 +1784,21 @@ const jn = ["children", "className", "slots", "slotProps", "ContentComponent", "
|
|
|
1784
1784
|
labelInput: T.labelInput,
|
|
1785
1785
|
checkbox: T.checkbox
|
|
1786
1786
|
},
|
|
1787
|
-
label:
|
|
1788
|
-
itemId:
|
|
1787
|
+
label: R,
|
|
1788
|
+
itemId: w,
|
|
1789
1789
|
onClick: P,
|
|
1790
1790
|
onMouseDown: D,
|
|
1791
|
-
icon:
|
|
1791
|
+
icon: qt,
|
|
1792
1792
|
expansionIcon: Te,
|
|
1793
|
-
displayIcon:
|
|
1793
|
+
displayIcon: Bt,
|
|
1794
1794
|
ownerState: xe
|
|
1795
|
-
},
|
|
1795
|
+
}, h, Zt, We.action == null ? {} : {
|
|
1796
1796
|
dragAndDropOverlayProps: We
|
|
1797
1797
|
}, Je.value == null ? {} : {
|
|
1798
1798
|
labelInputProps: Je
|
|
1799
1799
|
}, {
|
|
1800
1800
|
ref: Xe
|
|
1801
|
-
})), a && /* @__PURE__ */ v(
|
|
1801
|
+
})), a && /* @__PURE__ */ v(Jn, C({
|
|
1802
1802
|
as: y
|
|
1803
1803
|
}, S, {
|
|
1804
1804
|
children: a
|
|
@@ -1806,7 +1806,7 @@ const jn = ["children", "className", "slots", "slotProps", "ContentComponent", "
|
|
|
1806
1806
|
}))
|
|
1807
1807
|
});
|
|
1808
1808
|
});
|
|
1809
|
-
process.env.NODE_ENV !== "production" && (
|
|
1809
|
+
process.env.NODE_ENV !== "production" && (St.propTypes = {
|
|
1810
1810
|
// ----------------------------- Warning --------------------------------
|
|
1811
1811
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1812
1812
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -1825,7 +1825,7 @@ process.env.NODE_ENV !== "production" && (vt.propTypes = {
|
|
|
1825
1825
|
* @deprecated Consider using the `<TreeItem2 />` component or the `useTreeItem2` hook instead. For more details, see https://mui.com/x/react-tree-view/tree-item-customization/.
|
|
1826
1826
|
* @default TreeItemContent
|
|
1827
1827
|
*/
|
|
1828
|
-
ContentComponent:
|
|
1828
|
+
ContentComponent: sn,
|
|
1829
1829
|
/**
|
|
1830
1830
|
* Props applied to ContentComponent.
|
|
1831
1831
|
* @deprecated Consider using the `<TreeItem2 />` component or the `useTreeItem2` hook instead. For more details, see https://mui.com/x/react-tree-view/tree-item-customization/.
|
|
@@ -1848,7 +1848,7 @@ process.env.NODE_ENV !== "production" && (vt.propTypes = {
|
|
|
1848
1848
|
* This prop isn't supported.
|
|
1849
1849
|
* Use the `onItemFocus` callback on the tree if you need to monitor a item's focus.
|
|
1850
1850
|
*/
|
|
1851
|
-
onFocus:
|
|
1851
|
+
onFocus: pt,
|
|
1852
1852
|
/**
|
|
1853
1853
|
* Callback fired when a key of the keyboard is pressed on the item.
|
|
1854
1854
|
*/
|
|
@@ -1868,61 +1868,61 @@ process.env.NODE_ENV !== "production" && (vt.propTypes = {
|
|
|
1868
1868
|
*/
|
|
1869
1869
|
sx: d.oneOfType([d.arrayOf(d.oneOfType([d.func, d.object, d.bool])), d.func, d.object])
|
|
1870
1870
|
});
|
|
1871
|
-
const
|
|
1872
|
-
function
|
|
1871
|
+
const Qn = ["ownerState"];
|
|
1872
|
+
function Yn({
|
|
1873
1873
|
slots: e,
|
|
1874
1874
|
slotProps: t,
|
|
1875
1875
|
label: n,
|
|
1876
1876
|
id: o,
|
|
1877
|
-
itemId:
|
|
1877
|
+
itemId: i,
|
|
1878
1878
|
itemsToRender: I
|
|
1879
1879
|
}) {
|
|
1880
|
-
const
|
|
1881
|
-
elementType:
|
|
1880
|
+
const f = (e == null ? void 0 : e.item) ?? St, l = V({
|
|
1881
|
+
elementType: f,
|
|
1882
1882
|
externalSlotProps: t == null ? void 0 : t.item,
|
|
1883
1883
|
additionalProps: {
|
|
1884
|
-
itemId:
|
|
1884
|
+
itemId: i,
|
|
1885
1885
|
id: o,
|
|
1886
1886
|
label: n
|
|
1887
1887
|
},
|
|
1888
1888
|
ownerState: {
|
|
1889
|
-
itemId:
|
|
1889
|
+
itemId: i,
|
|
1890
1890
|
label: n
|
|
1891
1891
|
}
|
|
1892
|
-
}), u = G(
|
|
1892
|
+
}), u = G(l, Qn), c = E.useMemo(() => I ? /* @__PURE__ */ v(kt, {
|
|
1893
1893
|
itemsToRender: I,
|
|
1894
1894
|
slots: e,
|
|
1895
1895
|
slotProps: t
|
|
1896
1896
|
}) : null, [I, e, t]);
|
|
1897
|
-
return /* @__PURE__ */ v(
|
|
1897
|
+
return /* @__PURE__ */ v(f, C({}, u, {
|
|
1898
1898
|
children: c
|
|
1899
1899
|
}));
|
|
1900
1900
|
}
|
|
1901
|
-
function
|
|
1901
|
+
function kt(e) {
|
|
1902
1902
|
const {
|
|
1903
1903
|
itemsToRender: t,
|
|
1904
1904
|
slots: n,
|
|
1905
1905
|
slotProps: o
|
|
1906
1906
|
} = e;
|
|
1907
1907
|
return /* @__PURE__ */ v(E.Fragment, {
|
|
1908
|
-
children: t.map((
|
|
1908
|
+
children: t.map((i) => /* @__PURE__ */ v(Yn, {
|
|
1909
1909
|
slots: n,
|
|
1910
1910
|
slotProps: o,
|
|
1911
|
-
label:
|
|
1912
|
-
id:
|
|
1913
|
-
itemId:
|
|
1914
|
-
itemsToRender:
|
|
1915
|
-
},
|
|
1911
|
+
label: i.label,
|
|
1912
|
+
id: i.id,
|
|
1913
|
+
itemId: i.itemId,
|
|
1914
|
+
itemsToRender: i.children
|
|
1915
|
+
}, i.itemId))
|
|
1916
1916
|
});
|
|
1917
1917
|
}
|
|
1918
|
-
const
|
|
1918
|
+
const Zn = je(), Hn = (e) => {
|
|
1919
1919
|
const {
|
|
1920
1920
|
classes: t
|
|
1921
1921
|
} = e;
|
|
1922
1922
|
return Ne({
|
|
1923
1923
|
root: ["root"]
|
|
1924
|
-
},
|
|
1925
|
-
},
|
|
1924
|
+
}, dn, t);
|
|
1925
|
+
}, eo = _("ul", {
|
|
1926
1926
|
name: "MuiRichTreeView",
|
|
1927
1927
|
slot: "Root",
|
|
1928
1928
|
overridesResolver: (e, t) => t.root
|
|
@@ -1932,42 +1932,42 @@ const Qn = je(), Yn = (e) => {
|
|
|
1932
1932
|
listStyle: "none",
|
|
1933
1933
|
outline: 0,
|
|
1934
1934
|
position: "relative"
|
|
1935
|
-
}),
|
|
1936
|
-
const o =
|
|
1935
|
+
}), Mt = /* @__PURE__ */ E.forwardRef(function(t, n) {
|
|
1936
|
+
const o = Zn({
|
|
1937
1937
|
props: t,
|
|
1938
1938
|
name: "MuiRichTreeView"
|
|
1939
1939
|
});
|
|
1940
1940
|
process.env.NODE_ENV !== "production" && o.children != null && ve(["MUI X: The Rich Tree View component does not support JSX children.", "If you want to add items, you need to use the `items` prop.", "Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/items/."]);
|
|
1941
1941
|
const {
|
|
1942
|
-
getRootProps:
|
|
1942
|
+
getRootProps: i,
|
|
1943
1943
|
contextValue: I,
|
|
1944
|
-
instance:
|
|
1945
|
-
} =
|
|
1946
|
-
plugins:
|
|
1944
|
+
instance: f
|
|
1945
|
+
} = yn({
|
|
1946
|
+
plugins: Nn,
|
|
1947
1947
|
rootRef: n,
|
|
1948
1948
|
props: o
|
|
1949
1949
|
}), {
|
|
1950
|
-
slots:
|
|
1950
|
+
slots: l,
|
|
1951
1951
|
slotProps: u
|
|
1952
|
-
} = o, c =
|
|
1953
|
-
elementType:
|
|
1952
|
+
} = o, c = Hn(o), r = (l == null ? void 0 : l.root) ?? eo, s = V({
|
|
1953
|
+
elementType: r,
|
|
1954
1954
|
externalSlotProps: u == null ? void 0 : u.root,
|
|
1955
1955
|
className: c.root,
|
|
1956
|
-
getSlotProps:
|
|
1956
|
+
getSlotProps: i,
|
|
1957
1957
|
ownerState: o
|
|
1958
1958
|
});
|
|
1959
|
-
return /* @__PURE__ */ v(
|
|
1959
|
+
return /* @__PURE__ */ v(Tn, {
|
|
1960
1960
|
value: I,
|
|
1961
|
-
children: /* @__PURE__ */ v(
|
|
1962
|
-
children: /* @__PURE__ */ v(
|
|
1963
|
-
slots:
|
|
1961
|
+
children: /* @__PURE__ */ v(r, C({}, s, {
|
|
1962
|
+
children: /* @__PURE__ */ v(kt, {
|
|
1963
|
+
slots: l,
|
|
1964
1964
|
slotProps: u,
|
|
1965
|
-
itemsToRender:
|
|
1965
|
+
itemsToRender: f.getItemsToRender()
|
|
1966
1966
|
})
|
|
1967
1967
|
}))
|
|
1968
1968
|
});
|
|
1969
1969
|
});
|
|
1970
|
-
process.env.NODE_ENV !== "production" && (
|
|
1970
|
+
process.env.NODE_ENV !== "production" && (Mt.propTypes = {
|
|
1971
1971
|
// ----------------------------- Warning --------------------------------
|
|
1972
1972
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1973
1973
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -2155,7 +2155,7 @@ process.env.NODE_ENV !== "production" && (St.propTypes = {
|
|
|
2155
2155
|
*/
|
|
2156
2156
|
sx: d.oneOfType([d.arrayOf(d.oneOfType([d.func, d.object, d.bool])), d.func, d.object])
|
|
2157
2157
|
});
|
|
2158
|
-
const
|
|
2158
|
+
const Dt = (e) => Array.isArray(e) ? e.length > 0 && e.some(Dt) : !!e, to = ({
|
|
2159
2159
|
itemId: e,
|
|
2160
2160
|
children: t
|
|
2161
2161
|
}) => {
|
|
@@ -2164,22 +2164,22 @@ const Mt = (e) => Array.isArray(e) ? e.length > 0 && e.some(Mt) : !!e, Hn = ({
|
|
|
2164
2164
|
selection: {
|
|
2165
2165
|
multiSelect: o
|
|
2166
2166
|
},
|
|
2167
|
-
publicAPI:
|
|
2167
|
+
publicAPI: i
|
|
2168
2168
|
} = ie(), I = {
|
|
2169
|
-
expandable:
|
|
2169
|
+
expandable: Dt(t),
|
|
2170
2170
|
expanded: n.isItemExpanded(e),
|
|
2171
2171
|
focused: n.isItemFocused(e),
|
|
2172
2172
|
selected: n.isItemSelected(e),
|
|
2173
2173
|
disabled: n.isItemDisabled(e),
|
|
2174
2174
|
editing: n != null && n.isItemBeingEdited ? n == null ? void 0 : n.isItemBeingEdited(e) : !1,
|
|
2175
2175
|
editable: n.isItemEditable ? n.isItemEditable(e) : !1
|
|
2176
|
-
},
|
|
2176
|
+
}, f = (a) => {
|
|
2177
2177
|
if (I.disabled)
|
|
2178
2178
|
return;
|
|
2179
2179
|
I.focused || n.focusItem(a, e);
|
|
2180
|
-
const
|
|
2181
|
-
I.expandable && !(
|
|
2182
|
-
},
|
|
2180
|
+
const x = o && (a.shiftKey || a.ctrlKey || a.metaKey);
|
|
2181
|
+
I.expandable && !(x && n.isItemExpanded(e)) && n.toggleItemExpansion(a, e);
|
|
2182
|
+
}, l = (a) => {
|
|
2183
2183
|
if (I.disabled)
|
|
2184
2184
|
return;
|
|
2185
2185
|
I.focused || n.focusItem(a, e), o && (a.shiftKey || a.ctrlKey || a.metaKey) ? a.shiftKey ? n.expandSelectionRange(a, e) : n.selectItem({
|
|
@@ -2192,8 +2192,8 @@ const Mt = (e) => Array.isArray(e) ? e.length > 0 && e.some(Mt) : !!e, Hn = ({
|
|
|
2192
2192
|
shouldBeSelected: !0
|
|
2193
2193
|
});
|
|
2194
2194
|
}, u = (a) => {
|
|
2195
|
-
const
|
|
2196
|
-
o &&
|
|
2195
|
+
const x = a.nativeEvent.shiftKey;
|
|
2196
|
+
o && x ? n.expandSelectionRange(a, e) : n.selectItem({
|
|
2197
2197
|
event: a,
|
|
2198
2198
|
itemId: e,
|
|
2199
2199
|
keepExistingSelection: o,
|
|
@@ -2204,74 +2204,74 @@ const Mt = (e) => Array.isArray(e) ? e.length > 0 && e.some(Mt) : !!e, Hn = ({
|
|
|
2204
2204
|
};
|
|
2205
2205
|
return {
|
|
2206
2206
|
interactions: {
|
|
2207
|
-
handleExpansion:
|
|
2208
|
-
handleSelection:
|
|
2207
|
+
handleExpansion: f,
|
|
2208
|
+
handleSelection: l,
|
|
2209
2209
|
handleCheckboxSelection: u,
|
|
2210
2210
|
toggleItemEditing: c,
|
|
2211
|
-
handleSaveItemLabel: (a,
|
|
2212
|
-
re(n, K) && n.isItemBeingEditedRef(e) && (n.updateItemLabel(e,
|
|
2211
|
+
handleSaveItemLabel: (a, x) => {
|
|
2212
|
+
re(n, K) && n.isItemBeingEditedRef(e) && (n.updateItemLabel(e, x), c(), n.focusItem(a, e));
|
|
2213
2213
|
},
|
|
2214
2214
|
handleCancelItemLabelEditing: (a) => {
|
|
2215
2215
|
re(n, K) && n.isItemBeingEditedRef(e) && (c(), n.focusItem(a, e));
|
|
2216
2216
|
}
|
|
2217
2217
|
},
|
|
2218
2218
|
status: I,
|
|
2219
|
-
publicAPI:
|
|
2219
|
+
publicAPI: i
|
|
2220
2220
|
};
|
|
2221
|
-
},
|
|
2221
|
+
}, no = (e) => {
|
|
2222
2222
|
const {
|
|
2223
2223
|
runItemPlugins: t,
|
|
2224
2224
|
items: {
|
|
2225
2225
|
onItemClick: n,
|
|
2226
2226
|
disabledItemsFocusable: o,
|
|
2227
|
-
indentationAtItemLevel:
|
|
2227
|
+
indentationAtItemLevel: i
|
|
2228
2228
|
},
|
|
2229
2229
|
selection: {
|
|
2230
2230
|
disableSelection: I,
|
|
2231
|
-
checkboxSelection:
|
|
2231
|
+
checkboxSelection: f
|
|
2232
2232
|
},
|
|
2233
2233
|
expansion: {
|
|
2234
|
-
expansionTrigger:
|
|
2234
|
+
expansionTrigger: l
|
|
2235
2235
|
},
|
|
2236
2236
|
treeId: u,
|
|
2237
2237
|
instance: c,
|
|
2238
|
-
publicAPI:
|
|
2239
|
-
} = ie(),
|
|
2240
|
-
id:
|
|
2238
|
+
publicAPI: r
|
|
2239
|
+
} = ie(), s = E.useContext(Pe), {
|
|
2240
|
+
id: p,
|
|
2241
2241
|
itemId: a,
|
|
2242
|
-
label:
|
|
2242
|
+
label: x,
|
|
2243
2243
|
children: g,
|
|
2244
|
-
rootRef:
|
|
2244
|
+
rootRef: m
|
|
2245
2245
|
} = e, {
|
|
2246
2246
|
rootRef: b,
|
|
2247
|
-
contentRef:
|
|
2248
|
-
propsEnhancers:
|
|
2247
|
+
contentRef: h,
|
|
2248
|
+
propsEnhancers: w
|
|
2249
2249
|
} = t(e), {
|
|
2250
|
-
interactions:
|
|
2251
|
-
status:
|
|
2252
|
-
} =
|
|
2250
|
+
interactions: k,
|
|
2251
|
+
status: R
|
|
2252
|
+
} = to({
|
|
2253
2253
|
itemId: a,
|
|
2254
2254
|
children: g
|
|
2255
|
-
}), P = E.useRef(null), D = E.useRef(null), N = Ie(
|
|
2255
|
+
}), P = E.useRef(null), D = E.useRef(null), N = Ie(m, b, P), z = Ie(h, D), $ = E.useRef(null), j = Ke({
|
|
2256
2256
|
itemId: a,
|
|
2257
2257
|
treeId: u,
|
|
2258
|
-
id:
|
|
2258
|
+
id: p
|
|
2259
2259
|
}), Q = c.canItemBeTabbed(a) ? 0 : -1, B = {
|
|
2260
2260
|
rootRefObject: P,
|
|
2261
2261
|
contentRefObject: D,
|
|
2262
|
-
interactions:
|
|
2262
|
+
interactions: k
|
|
2263
2263
|
}, q = (T) => (y) => {
|
|
2264
2264
|
var O;
|
|
2265
2265
|
if ((O = T.onFocus) == null || O.call(T, y), y.defaultMuiPrevented)
|
|
2266
2266
|
return;
|
|
2267
|
-
const S = !
|
|
2268
|
-
!
|
|
2267
|
+
const S = !R.disabled || o;
|
|
2268
|
+
!R.focused && S && y.currentTarget === y.target && c.focusItem(y, a);
|
|
2269
2269
|
}, X = (T) => (y) => {
|
|
2270
2270
|
var O, F, oe, ye, Te;
|
|
2271
2271
|
if ((O = T.onBlur) == null || O.call(T, y), y.defaultMuiPrevented)
|
|
2272
2272
|
return;
|
|
2273
2273
|
const S = c.getItemDOMElement(a);
|
|
2274
|
-
|
|
2274
|
+
R.editing || // we can exit the editing state by clicking outside the input (within the Tree Item) or by pressing Enter or Escape -> we don't want to remove the focused item from the state in these cases
|
|
2275
2275
|
// we can also exit the editing state by clicking on the root itself -> want to remove the focused item from the state in this case
|
|
2276
2276
|
y.relatedTarget && be(y.relatedTarget, S) && (y.target && ((oe = (F = y.target) == null ? void 0 : F.dataset) == null ? void 0 : oe.element) === "labelInput" && be(y.target, S) || ((Te = (ye = y.relatedTarget) == null ? void 0 : ye.dataset) == null ? void 0 : Te.element) === "labelInput") || c.removeFocusedItem();
|
|
2277
2277
|
}, ee = (T) => (y) => {
|
|
@@ -2279,43 +2279,43 @@ const Mt = (e) => Array.isArray(e) ? e.length > 0 && e.some(Mt) : !!e, Hn = ({
|
|
|
2279
2279
|
(S = T.onKeyDown) == null || S.call(T, y), !(y.defaultMuiPrevented || ((F = (O = y.target) == null ? void 0 : O.dataset) == null ? void 0 : F.element) === "labelInput") && c.handleItemKeyDown(y, a);
|
|
2280
2280
|
}, Y = (T) => (y) => {
|
|
2281
2281
|
var S;
|
|
2282
|
-
(S = T.onDoubleClick) == null || S.call(T, y), !y.defaultMuiPrevented &&
|
|
2282
|
+
(S = T.onDoubleClick) == null || S.call(T, y), !y.defaultMuiPrevented && k.toggleItemEditing();
|
|
2283
2283
|
}, te = (T) => (y) => {
|
|
2284
2284
|
var S, O;
|
|
2285
|
-
(S = T.onClick) == null || S.call(T, y), n == null || n(y, a), !(y.defaultMuiPrevented || (O = $.current) != null && O.contains(y.target)) && (
|
|
2285
|
+
(S = T.onClick) == null || S.call(T, y), n == null || n(y, a), !(y.defaultMuiPrevented || (O = $.current) != null && O.contains(y.target)) && (l === "content" && k.handleExpansion(y), f || k.handleSelection(y));
|
|
2286
2286
|
}, A = (T) => (y) => {
|
|
2287
2287
|
var S;
|
|
2288
|
-
(S = T.onMouseDown) == null || S.call(T, y), !y.defaultMuiPrevented && (y.shiftKey || y.ctrlKey || y.metaKey ||
|
|
2288
|
+
(S = T.onMouseDown) == null || S.call(T, y), !y.defaultMuiPrevented && (y.shiftKey || y.ctrlKey || y.metaKey || R.disabled) && y.preventDefault();
|
|
2289
2289
|
}, Z = (T) => (y) => {
|
|
2290
2290
|
var S;
|
|
2291
|
-
(S = T.onChange) == null || S.call(T, y), !y.defaultMuiPrevented && (I ||
|
|
2291
|
+
(S = T.onChange) == null || S.call(T, y), !y.defaultMuiPrevented && (I || R.disabled || k.handleCheckboxSelection(y));
|
|
2292
2292
|
}, L = (T) => (y) => {
|
|
2293
2293
|
var S;
|
|
2294
|
-
(S = T.onClick) == null || S.call(T, y), !y.defaultMuiPrevented &&
|
|
2294
|
+
(S = T.onClick) == null || S.call(T, y), !y.defaultMuiPrevented && l === "iconContainer" && k.handleExpansion(y);
|
|
2295
2295
|
};
|
|
2296
2296
|
return {
|
|
2297
2297
|
getRootProps: (T = {}) => {
|
|
2298
2298
|
var oe;
|
|
2299
2299
|
const y = C({}, U(e), U(T));
|
|
2300
2300
|
let S;
|
|
2301
|
-
|
|
2301
|
+
R.selected ? S = !0 : I || R.disabled ? S = void 0 : S = !1;
|
|
2302
2302
|
const O = C({}, y, {
|
|
2303
2303
|
ref: N,
|
|
2304
2304
|
role: "treeitem",
|
|
2305
2305
|
tabIndex: Q,
|
|
2306
2306
|
id: j,
|
|
2307
|
-
"aria-expanded":
|
|
2307
|
+
"aria-expanded": R.expandable ? R.expanded : void 0,
|
|
2308
2308
|
"aria-selected": S,
|
|
2309
|
-
"aria-disabled":
|
|
2309
|
+
"aria-disabled": R.disabled || void 0
|
|
2310
2310
|
}, T, {
|
|
2311
2311
|
onFocus: q(y),
|
|
2312
2312
|
onBlur: X(y),
|
|
2313
2313
|
onKeyDown: ee(y)
|
|
2314
2314
|
});
|
|
2315
|
-
|
|
2316
|
-
"--TreeView-itemDepth": typeof
|
|
2315
|
+
i && (O.style = {
|
|
2316
|
+
"--TreeView-itemDepth": typeof s == "function" ? s(a) : s
|
|
2317
2317
|
});
|
|
2318
|
-
const F = ((oe =
|
|
2318
|
+
const F = ((oe = w.root) == null ? void 0 : oe.call(w, C({}, B, {
|
|
2319
2319
|
externalEventHandlers: y
|
|
2320
2320
|
}))) ?? {};
|
|
2321
2321
|
return C({}, O, F);
|
|
@@ -2326,10 +2326,10 @@ const Mt = (e) => Array.isArray(e) ? e.length > 0 && e.some(Mt) : !!e, Hn = ({
|
|
|
2326
2326
|
ref: z,
|
|
2327
2327
|
onClick: te(y),
|
|
2328
2328
|
onMouseDown: A(y),
|
|
2329
|
-
status:
|
|
2329
|
+
status: R
|
|
2330
2330
|
});
|
|
2331
|
-
|
|
2332
|
-
const O = ((F =
|
|
2331
|
+
i && (S.indentationAtItemLevel = !0);
|
|
2332
|
+
const O = ((F = w.content) == null ? void 0 : F.call(w, C({}, B, {
|
|
2333
2333
|
externalEventHandlers: y
|
|
2334
2334
|
}))) ?? {};
|
|
2335
2335
|
return C({}, S, O);
|
|
@@ -2339,10 +2339,10 @@ const Mt = (e) => Array.isArray(e) ? e.length > 0 && e.some(Mt) : !!e, Hn = ({
|
|
|
2339
2339
|
unmountOnExit: !0,
|
|
2340
2340
|
component: "ul",
|
|
2341
2341
|
role: "group",
|
|
2342
|
-
in:
|
|
2342
|
+
in: R.expanded,
|
|
2343
2343
|
children: g
|
|
2344
2344
|
}, T);
|
|
2345
|
-
return
|
|
2345
|
+
return i && (S.indentationAtItemLevel = !0), S;
|
|
2346
2346
|
},
|
|
2347
2347
|
getIconContainerProps: (T = {}) => {
|
|
2348
2348
|
const y = U(T);
|
|
@@ -2353,10 +2353,10 @@ const Mt = (e) => Array.isArray(e) ? e.length > 0 && e.some(Mt) : !!e, Hn = ({
|
|
|
2353
2353
|
getCheckboxProps: (T = {}) => {
|
|
2354
2354
|
const y = U(T);
|
|
2355
2355
|
return C({}, y, {
|
|
2356
|
-
visible:
|
|
2356
|
+
visible: f,
|
|
2357
2357
|
ref: $,
|
|
2358
|
-
checked:
|
|
2359
|
-
disabled: I ||
|
|
2358
|
+
checked: R.selected,
|
|
2359
|
+
disabled: I || R.disabled,
|
|
2360
2360
|
tabIndex: -1
|
|
2361
2361
|
}, T, {
|
|
2362
2362
|
onChange: Z(y)
|
|
@@ -2364,54 +2364,54 @@ const Mt = (e) => Array.isArray(e) ? e.length > 0 && e.some(Mt) : !!e, Hn = ({
|
|
|
2364
2364
|
},
|
|
2365
2365
|
getLabelProps: (T = {}) => {
|
|
2366
2366
|
const y = C({}, U(T)), S = C({}, y, {
|
|
2367
|
-
children:
|
|
2367
|
+
children: x
|
|
2368
2368
|
}, T, {
|
|
2369
2369
|
onDoubleClick: Y(y)
|
|
2370
2370
|
});
|
|
2371
|
-
return c.isTreeViewEditable && (S.editable =
|
|
2371
|
+
return c.isTreeViewEditable && (S.editable = R.editable), S;
|
|
2372
2372
|
},
|
|
2373
2373
|
getLabelInputProps: (T = {}) => {
|
|
2374
2374
|
var O;
|
|
2375
|
-
const y = U(T), S = ((O =
|
|
2375
|
+
const y = U(T), S = ((O = w.labelInput) == null ? void 0 : O.call(w, {
|
|
2376
2376
|
rootRefObject: P,
|
|
2377
2377
|
contentRefObject: D,
|
|
2378
2378
|
externalEventHandlers: y,
|
|
2379
|
-
interactions:
|
|
2379
|
+
interactions: k
|
|
2380
2380
|
})) ?? {};
|
|
2381
2381
|
return C({}, T, S);
|
|
2382
2382
|
},
|
|
2383
2383
|
getDragAndDropOverlayProps: (T = {}) => {
|
|
2384
2384
|
var O;
|
|
2385
|
-
const y = U(T), S = ((O =
|
|
2385
|
+
const y = U(T), S = ((O = w.dragAndDropOverlay) == null ? void 0 : O.call(w, C({}, B, {
|
|
2386
2386
|
externalEventHandlers: y
|
|
2387
2387
|
}))) ?? {};
|
|
2388
2388
|
return C({}, T, S);
|
|
2389
2389
|
},
|
|
2390
2390
|
rootRef: N,
|
|
2391
|
-
status:
|
|
2392
|
-
publicAPI:
|
|
2391
|
+
status: R,
|
|
2392
|
+
publicAPI: r
|
|
2393
2393
|
};
|
|
2394
|
-
},
|
|
2395
|
-
function
|
|
2394
|
+
}, Ot = no;
|
|
2395
|
+
function At(e) {
|
|
2396
2396
|
const {
|
|
2397
2397
|
slots: t,
|
|
2398
2398
|
slotProps: n,
|
|
2399
2399
|
status: o
|
|
2400
|
-
} = e,
|
|
2401
|
-
expandIcon:
|
|
2402
|
-
collapseIcon:
|
|
2403
|
-
}),
|
|
2404
|
-
let
|
|
2405
|
-
t != null && t.icon ?
|
|
2406
|
-
const u = (t == null ? void 0 : t[
|
|
2400
|
+
} = e, i = ie(), I = C({}, i.icons.slots, {
|
|
2401
|
+
expandIcon: i.icons.slots.expandIcon ?? vt,
|
|
2402
|
+
collapseIcon: i.icons.slots.collapseIcon ?? Pt
|
|
2403
|
+
}), f = i.icons.slotProps;
|
|
2404
|
+
let l;
|
|
2405
|
+
t != null && t.icon ? l = "icon" : o.expandable ? o.expanded ? l = "collapseIcon" : l = "expandIcon" : l = "endIcon";
|
|
2406
|
+
const u = (t == null ? void 0 : t[l]) ?? I[l], c = V({
|
|
2407
2407
|
elementType: u,
|
|
2408
|
-
externalSlotProps: (
|
|
2408
|
+
externalSlotProps: (r) => C({}, H(f[l], r), H(n == null ? void 0 : n[l], r)),
|
|
2409
2409
|
// TODO: Add proper ownerState
|
|
2410
2410
|
ownerState: {}
|
|
2411
2411
|
});
|
|
2412
2412
|
return u ? /* @__PURE__ */ v(u, C({}, c)) : null;
|
|
2413
2413
|
}
|
|
2414
|
-
process.env.NODE_ENV !== "production" && (
|
|
2414
|
+
process.env.NODE_ENV !== "production" && (At.propTypes = {
|
|
2415
2415
|
// ----------------------------- Warning --------------------------------
|
|
2416
2416
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
2417
2417
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -2436,7 +2436,7 @@ process.env.NODE_ENV !== "production" && (Dt.propTypes = {
|
|
|
2436
2436
|
selected: d.bool.isRequired
|
|
2437
2437
|
}).isRequired
|
|
2438
2438
|
});
|
|
2439
|
-
const
|
|
2439
|
+
const oo = ["visible"], ro = ["id", "itemId", "label", "disabled", "children", "slots", "slotProps"], io = je(), Lt = _("li", {
|
|
2440
2440
|
name: "MuiTreeItem2",
|
|
2441
2441
|
slot: "Root",
|
|
2442
2442
|
overridesResolver: (e, t) => t.root
|
|
@@ -2445,7 +2445,7 @@ const to = ["visible"], no = ["id", "itemId", "label", "disabled", "children", "
|
|
|
2445
2445
|
margin: 0,
|
|
2446
2446
|
padding: 0,
|
|
2447
2447
|
outline: 0
|
|
2448
|
-
}),
|
|
2448
|
+
}), Vt = _("div", {
|
|
2449
2449
|
name: "MuiTreeItem2",
|
|
2450
2450
|
slot: "Content",
|
|
2451
2451
|
overridesResolver: (e, t) => t.content,
|
|
@@ -2515,7 +2515,7 @@ const to = ["visible"], no = ["id", "itemId", "label", "disabled", "children", "
|
|
|
2515
2515
|
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : J(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
|
|
2516
2516
|
}
|
|
2517
2517
|
}]
|
|
2518
|
-
})),
|
|
2518
|
+
})), Ft = _("div", {
|
|
2519
2519
|
name: "MuiTreeItem2",
|
|
2520
2520
|
slot: "Label",
|
|
2521
2521
|
overridesResolver: (e, t) => t.label,
|
|
@@ -2539,7 +2539,7 @@ const to = ["visible"], no = ["id", "itemId", "label", "disabled", "children", "
|
|
|
2539
2539
|
paddingLeft: "2px"
|
|
2540
2540
|
}
|
|
2541
2541
|
}]
|
|
2542
|
-
})),
|
|
2542
|
+
})), $t = _("div", {
|
|
2543
2543
|
name: "MuiTreeItem2",
|
|
2544
2544
|
slot: "IconContainer",
|
|
2545
2545
|
overridesResolver: (e, t) => t.iconContainer
|
|
@@ -2551,7 +2551,7 @@ const to = ["visible"], no = ["id", "itemId", "label", "disabled", "children", "
|
|
|
2551
2551
|
"& svg": {
|
|
2552
2552
|
fontSize: 18
|
|
2553
2553
|
}
|
|
2554
|
-
}),
|
|
2554
|
+
}), Nt = _(dt, {
|
|
2555
2555
|
name: "MuiTreeItem2",
|
|
2556
2556
|
slot: "GroupTransition",
|
|
2557
2557
|
overridesResolver: (e, t) => t.groupTransition,
|
|
@@ -2568,11 +2568,11 @@ const to = ["visible"], no = ["id", "itemId", "label", "disabled", "children", "
|
|
|
2568
2568
|
paddingLeft: 0
|
|
2569
2569
|
}
|
|
2570
2570
|
}]
|
|
2571
|
-
}),
|
|
2571
|
+
}), so = _(/* @__PURE__ */ E.forwardRef((e, t) => {
|
|
2572
2572
|
const {
|
|
2573
2573
|
visible: n
|
|
2574
|
-
} = e, o = G(e,
|
|
2575
|
-
return n ? /* @__PURE__ */ v(
|
|
2574
|
+
} = e, o = G(e, oo);
|
|
2575
|
+
return n ? /* @__PURE__ */ v(ut, C({}, o, {
|
|
2576
2576
|
ref: t
|
|
2577
2577
|
})) : null;
|
|
2578
2578
|
}), {
|
|
@@ -2581,7 +2581,7 @@ const to = ["visible"], no = ["id", "itemId", "label", "disabled", "children", "
|
|
|
2581
2581
|
overridesResolver: (e, t) => t.checkbox
|
|
2582
2582
|
})({
|
|
2583
2583
|
padding: 0
|
|
2584
|
-
}),
|
|
2584
|
+
}), lo = (e) => {
|
|
2585
2585
|
const {
|
|
2586
2586
|
classes: t
|
|
2587
2587
|
} = e;
|
|
@@ -2600,106 +2600,106 @@ const to = ["visible"], no = ["id", "itemId", "label", "disabled", "children", "
|
|
|
2600
2600
|
groupTransition: ["groupTransition"],
|
|
2601
2601
|
labelInput: ["labelInput"],
|
|
2602
2602
|
dragAndDropOverlay: ["dragAndDropOverlay"]
|
|
2603
|
-
},
|
|
2604
|
-
},
|
|
2605
|
-
const o =
|
|
2603
|
+
}, Rt, t);
|
|
2604
|
+
}, ao = /* @__PURE__ */ E.forwardRef(function(t, n) {
|
|
2605
|
+
const o = io({
|
|
2606
2606
|
props: t,
|
|
2607
2607
|
name: "MuiTreeItem2"
|
|
2608
2608
|
}), {
|
|
2609
|
-
id:
|
|
2609
|
+
id: i,
|
|
2610
2610
|
itemId: I,
|
|
2611
|
-
label:
|
|
2612
|
-
disabled:
|
|
2611
|
+
label: f,
|
|
2612
|
+
disabled: l,
|
|
2613
2613
|
children: u,
|
|
2614
2614
|
slots: c = {},
|
|
2615
|
-
slotProps:
|
|
2616
|
-
} = o,
|
|
2617
|
-
getRootProps:
|
|
2615
|
+
slotProps: r = {}
|
|
2616
|
+
} = o, s = G(o, ro), {
|
|
2617
|
+
getRootProps: p,
|
|
2618
2618
|
getContentProps: a,
|
|
2619
|
-
getIconContainerProps:
|
|
2619
|
+
getIconContainerProps: x,
|
|
2620
2620
|
getCheckboxProps: g,
|
|
2621
|
-
getLabelProps:
|
|
2621
|
+
getLabelProps: m,
|
|
2622
2622
|
getGroupTransitionProps: b,
|
|
2623
|
-
getLabelInputProps:
|
|
2624
|
-
getDragAndDropOverlayProps:
|
|
2625
|
-
status:
|
|
2626
|
-
} =
|
|
2627
|
-
id:
|
|
2623
|
+
getLabelInputProps: h,
|
|
2624
|
+
getDragAndDropOverlayProps: w,
|
|
2625
|
+
status: k
|
|
2626
|
+
} = Ot({
|
|
2627
|
+
id: i,
|
|
2628
2628
|
itemId: I,
|
|
2629
2629
|
children: u,
|
|
2630
|
-
label:
|
|
2631
|
-
disabled:
|
|
2632
|
-
}),
|
|
2630
|
+
label: f,
|
|
2631
|
+
disabled: l
|
|
2632
|
+
}), R = C({}, o, k), P = lo(R), D = c.root ?? Lt, N = V({
|
|
2633
2633
|
elementType: D,
|
|
2634
|
-
getSlotProps:
|
|
2635
|
-
externalForwardedProps:
|
|
2636
|
-
externalSlotProps:
|
|
2634
|
+
getSlotProps: p,
|
|
2635
|
+
externalForwardedProps: s,
|
|
2636
|
+
externalSlotProps: r.root,
|
|
2637
2637
|
additionalProps: {
|
|
2638
2638
|
ref: n
|
|
2639
2639
|
},
|
|
2640
2640
|
ownerState: {},
|
|
2641
2641
|
className: P.root
|
|
2642
|
-
}), z = c.content ??
|
|
2642
|
+
}), z = c.content ?? Vt, $ = V({
|
|
2643
2643
|
elementType: z,
|
|
2644
2644
|
getSlotProps: a,
|
|
2645
|
-
externalSlotProps:
|
|
2645
|
+
externalSlotProps: r.content,
|
|
2646
2646
|
ownerState: {},
|
|
2647
|
-
className: $e(P.content,
|
|
2648
|
-
}), j = c.iconContainer ??
|
|
2647
|
+
className: $e(P.content, k.expanded && P.expanded, k.selected && P.selected, k.focused && P.focused, k.disabled && P.disabled, k.editing && P.editing, k.editable && P.editable)
|
|
2648
|
+
}), j = c.iconContainer ?? $t, Q = V({
|
|
2649
2649
|
elementType: j,
|
|
2650
|
-
getSlotProps:
|
|
2651
|
-
externalSlotProps:
|
|
2650
|
+
getSlotProps: x,
|
|
2651
|
+
externalSlotProps: r.iconContainer,
|
|
2652
2652
|
ownerState: {},
|
|
2653
2653
|
className: P.iconContainer
|
|
2654
|
-
}), B = c.label ??
|
|
2654
|
+
}), B = c.label ?? Ft, q = V({
|
|
2655
2655
|
elementType: B,
|
|
2656
|
-
getSlotProps:
|
|
2657
|
-
externalSlotProps:
|
|
2656
|
+
getSlotProps: m,
|
|
2657
|
+
externalSlotProps: r.label,
|
|
2658
2658
|
ownerState: {},
|
|
2659
2659
|
className: P.label
|
|
2660
|
-
}), X = c.checkbox ??
|
|
2660
|
+
}), X = c.checkbox ?? so, ee = V({
|
|
2661
2661
|
elementType: X,
|
|
2662
2662
|
getSlotProps: g,
|
|
2663
|
-
externalSlotProps:
|
|
2663
|
+
externalSlotProps: r.checkbox,
|
|
2664
2664
|
ownerState: {},
|
|
2665
2665
|
className: P.checkbox
|
|
2666
2666
|
}), Y = c.groupTransition ?? void 0, te = V({
|
|
2667
2667
|
elementType: Y,
|
|
2668
2668
|
getSlotProps: b,
|
|
2669
|
-
externalSlotProps:
|
|
2669
|
+
externalSlotProps: r.groupTransition,
|
|
2670
2670
|
ownerState: {},
|
|
2671
2671
|
className: P.groupTransition
|
|
2672
|
-
}), A = c.labelInput ??
|
|
2672
|
+
}), A = c.labelInput ?? wt, Z = V({
|
|
2673
2673
|
elementType: A,
|
|
2674
|
-
getSlotProps:
|
|
2675
|
-
externalSlotProps:
|
|
2674
|
+
getSlotProps: h,
|
|
2675
|
+
externalSlotProps: r.labelInput,
|
|
2676
2676
|
ownerState: {},
|
|
2677
2677
|
className: P.labelInput
|
|
2678
2678
|
}), L = c.dragAndDropOverlay ?? ze, ne = V({
|
|
2679
2679
|
elementType: L,
|
|
2680
|
-
getSlotProps:
|
|
2681
|
-
externalSlotProps:
|
|
2680
|
+
getSlotProps: w,
|
|
2681
|
+
externalSlotProps: r.dragAndDropOverlay,
|
|
2682
2682
|
ownerState: {},
|
|
2683
2683
|
className: P.dragAndDropOverlay
|
|
2684
2684
|
});
|
|
2685
|
-
return /* @__PURE__ */ v(
|
|
2685
|
+
return /* @__PURE__ */ v(Me, {
|
|
2686
2686
|
itemId: I,
|
|
2687
2687
|
children: /* @__PURE__ */ de(D, C({}, N, {
|
|
2688
2688
|
children: [/* @__PURE__ */ de(z, C({}, $, {
|
|
2689
2689
|
children: [/* @__PURE__ */ v(j, C({}, Q, {
|
|
2690
|
-
children: /* @__PURE__ */ v(
|
|
2691
|
-
status:
|
|
2690
|
+
children: /* @__PURE__ */ v(At, {
|
|
2691
|
+
status: k,
|
|
2692
2692
|
slots: c,
|
|
2693
|
-
slotProps:
|
|
2693
|
+
slotProps: r
|
|
2694
2694
|
})
|
|
2695
|
-
})), /* @__PURE__ */ v(X, C({}, ee)),
|
|
2696
|
-
})), u && /* @__PURE__ */ v(
|
|
2695
|
+
})), /* @__PURE__ */ v(X, C({}, ee)), k.editing ? /* @__PURE__ */ v(A, C({}, Z)) : /* @__PURE__ */ v(B, C({}, q)), /* @__PURE__ */ v(L, C({}, ne))]
|
|
2696
|
+
})), u && /* @__PURE__ */ v(Nt, C({
|
|
2697
2697
|
as: Y
|
|
2698
2698
|
}, te))]
|
|
2699
2699
|
}))
|
|
2700
2700
|
});
|
|
2701
2701
|
});
|
|
2702
|
-
process.env.NODE_ENV !== "production" && (
|
|
2702
|
+
process.env.NODE_ENV !== "production" && (ao.propTypes = {
|
|
2703
2703
|
// ----------------------------- Warning --------------------------------
|
|
2704
2704
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
2705
2705
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -2739,7 +2739,7 @@ process.env.NODE_ENV !== "production" && (so.propTypes = {
|
|
|
2739
2739
|
* This prop isn't supported.
|
|
2740
2740
|
* Use the `onItemFocus` callback on the tree if you need to monitor an item's focus.
|
|
2741
2741
|
*/
|
|
2742
|
-
onFocus:
|
|
2742
|
+
onFocus: pt,
|
|
2743
2743
|
/**
|
|
2744
2744
|
* Callback fired when a key is pressed on the keyboard and the tree is in focus.
|
|
2745
2745
|
*/
|
|
@@ -2755,60 +2755,67 @@ process.env.NODE_ENV !== "production" && (so.propTypes = {
|
|
|
2755
2755
|
*/
|
|
2756
2756
|
slots: d.object
|
|
2757
2757
|
});
|
|
2758
|
-
const
|
|
2759
|
-
var
|
|
2760
|
-
const
|
|
2758
|
+
const co = () => E.useRef(void 0);
|
|
2759
|
+
var uo = /* @__PURE__ */ ((e) => (e.FOLDER = "FOLDER", e.SHARE = "SHARE", e.TRASH = "TRASH", e.CUSTOM = "CUSTOM", e))(uo || {});
|
|
2760
|
+
const po = (e, t) => {
|
|
2761
2761
|
if (!e) return Ve;
|
|
2762
2762
|
if (typeof e != "string") return e;
|
|
2763
2763
|
switch (e) {
|
|
2764
2764
|
case "SHARE":
|
|
2765
|
-
return
|
|
2765
|
+
return cn;
|
|
2766
2766
|
case "TRASH":
|
|
2767
|
-
return
|
|
2767
|
+
return Ht;
|
|
2768
2768
|
case "CUSTOM":
|
|
2769
2769
|
return t || Ve;
|
|
2770
2770
|
case "FOLDER":
|
|
2771
2771
|
default:
|
|
2772
2772
|
return Ve;
|
|
2773
2773
|
}
|
|
2774
|
-
},
|
|
2774
|
+
}, fo = en(function(t, n) {
|
|
2775
2775
|
const {
|
|
2776
2776
|
id: o,
|
|
2777
|
-
itemId:
|
|
2777
|
+
itemId: i,
|
|
2778
2778
|
label: I,
|
|
2779
|
-
disabled:
|
|
2780
|
-
children:
|
|
2779
|
+
disabled: f,
|
|
2780
|
+
children: l,
|
|
2781
2781
|
itemData: u,
|
|
2782
|
-
iconColor: c = "primary"
|
|
2783
|
-
|
|
2782
|
+
iconColor: c = "primary",
|
|
2783
|
+
onClick: r
|
|
2784
|
+
} = t, s = po(
|
|
2784
2785
|
u == null ? void 0 : u.iconType,
|
|
2785
2786
|
u == null ? void 0 : u.customIcon
|
|
2786
2787
|
), {
|
|
2787
|
-
getRootProps:
|
|
2788
|
-
getContentProps:
|
|
2789
|
-
getLabelProps:
|
|
2790
|
-
getGroupTransitionProps:
|
|
2791
|
-
getIconContainerProps:
|
|
2792
|
-
status:
|
|
2793
|
-
} =
|
|
2794
|
-
|
|
2788
|
+
getRootProps: p,
|
|
2789
|
+
getContentProps: a,
|
|
2790
|
+
getLabelProps: x,
|
|
2791
|
+
getGroupTransitionProps: g,
|
|
2792
|
+
getIconContainerProps: m,
|
|
2793
|
+
status: b
|
|
2794
|
+
} = Ot({ id: o, itemId: i, label: I, disabled: f, children: l, rootRef: n }), h = a(), w = lt(
|
|
2795
|
+
(k) => {
|
|
2796
|
+
h.onClick && h.onClick(k), r && i && r(k);
|
|
2797
|
+
},
|
|
2798
|
+
[h, r, i]
|
|
2799
|
+
);
|
|
2800
|
+
return /* @__PURE__ */ v(Me, { itemId: i, children: /* @__PURE__ */ de(Lt, { ...p(), children: [
|
|
2795
2801
|
/* @__PURE__ */ de(
|
|
2796
|
-
|
|
2802
|
+
Vt,
|
|
2797
2803
|
{
|
|
2798
|
-
...
|
|
2804
|
+
...h,
|
|
2805
|
+
onClick: w,
|
|
2799
2806
|
style: { display: "flex", alignItems: "center", width: "100%" },
|
|
2800
2807
|
children: [
|
|
2801
|
-
/* @__PURE__ */ v(
|
|
2802
|
-
/* @__PURE__ */ v(
|
|
2803
|
-
/* @__PURE__ */ v(
|
|
2808
|
+
/* @__PURE__ */ v($t, { ...m(), children: /* @__PURE__ */ v(s, { fontSize: "small", color: c }) }),
|
|
2809
|
+
/* @__PURE__ */ v(Ft, { ...x() }),
|
|
2810
|
+
/* @__PURE__ */ v(st, { sx: { display: "flex", marginLeft: "auto" }, children: b.expandable && (b.expanded ? /* @__PURE__ */ v(ln, { fontSize: "small" }) : /* @__PURE__ */ v(an, { fontSize: "small" })) })
|
|
2804
2811
|
]
|
|
2805
2812
|
}
|
|
2806
2813
|
),
|
|
2807
|
-
|
|
2808
|
-
|
|
2814
|
+
l && /* @__PURE__ */ v(
|
|
2815
|
+
Nt,
|
|
2809
2816
|
{
|
|
2810
|
-
...
|
|
2811
|
-
style:
|
|
2817
|
+
...g(),
|
|
2818
|
+
style: b.expanded ? {
|
|
2812
2819
|
borderLeft: "1px solid #bdbdbd",
|
|
2813
2820
|
paddingLeft: "12px",
|
|
2814
2821
|
marginLeft: "15px",
|
|
@@ -2818,57 +2825,78 @@ const co = (e, t) => {
|
|
|
2818
2825
|
}
|
|
2819
2826
|
)
|
|
2820
2827
|
] }) });
|
|
2821
|
-
}),
|
|
2828
|
+
}), mo = (e) => {
|
|
2822
2829
|
const t = {}, n = (o) => {
|
|
2823
|
-
var
|
|
2824
|
-
t[o.id] = o, (
|
|
2830
|
+
var i;
|
|
2831
|
+
t[o.id] = o, (i = o.children) != null && i.length && o.children.forEach(n);
|
|
2825
2832
|
};
|
|
2826
2833
|
return e.forEach(n), t;
|
|
2827
|
-
},
|
|
2834
|
+
}, jt = (e, t, n = []) => {
|
|
2828
2835
|
var o;
|
|
2829
|
-
for (const
|
|
2830
|
-
if (
|
|
2836
|
+
for (const i of t) {
|
|
2837
|
+
if (i.id === e)
|
|
2831
2838
|
return n;
|
|
2832
|
-
if ((o =
|
|
2833
|
-
const I =
|
|
2839
|
+
if ((o = i.children) != null && o.length) {
|
|
2840
|
+
const I = jt(e, i.children, [
|
|
2834
2841
|
...n,
|
|
2835
|
-
|
|
2842
|
+
i.id
|
|
2836
2843
|
]);
|
|
2837
2844
|
if (I.length > 0)
|
|
2838
2845
|
return I;
|
|
2839
2846
|
}
|
|
2840
2847
|
}
|
|
2841
2848
|
return [];
|
|
2842
|
-
},
|
|
2849
|
+
}, Vo = ({
|
|
2843
2850
|
items: e,
|
|
2844
2851
|
onItemSelect: t,
|
|
2845
2852
|
iconColor: n = "primary",
|
|
2846
2853
|
expandedItemId: o
|
|
2847
2854
|
}) => {
|
|
2848
|
-
const
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
}, [
|
|
2854
|
-
|
|
2855
|
+
const i = nt(() => mo(e), [e]), I = co(), [f, l] = tn(
|
|
2856
|
+
o || null
|
|
2857
|
+
), u = nt(() => o ? i[o] ? [...jt(o, e), o] : [] : [], [o, i, e]);
|
|
2858
|
+
ot(() => {
|
|
2859
|
+
o && l(o);
|
|
2860
|
+
}, [o]), ot(() => {
|
|
2861
|
+
if (I.current && u.length > 0) {
|
|
2862
|
+
const r = I.current;
|
|
2863
|
+
u.forEach((s) => {
|
|
2864
|
+
try {
|
|
2865
|
+
r.setItemExpansion({}, s, !0);
|
|
2866
|
+
} catch (p) {
|
|
2867
|
+
console.error("Erreur lors de l'expansion de l'item:", s, p);
|
|
2868
|
+
}
|
|
2869
|
+
});
|
|
2870
|
+
}
|
|
2871
|
+
}, [I, u]);
|
|
2872
|
+
const c = lt(
|
|
2873
|
+
(r, s) => {
|
|
2874
|
+
t && (console.log("Clic sur l'item:", s), t(r, s), l(s));
|
|
2875
|
+
},
|
|
2876
|
+
[t]
|
|
2877
|
+
);
|
|
2878
|
+
return /* @__PURE__ */ v(st, { sx: { minHeight: 200, minWidth: 200 }, children: /* @__PURE__ */ v(
|
|
2879
|
+
Mt,
|
|
2855
2880
|
{
|
|
2856
2881
|
apiRef: I,
|
|
2857
2882
|
items: e,
|
|
2858
2883
|
itemChildrenIndentation: "50px",
|
|
2859
|
-
defaultExpandedItems:
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2884
|
+
defaultExpandedItems: u,
|
|
2885
|
+
selectedItems: f ? [f] : [],
|
|
2886
|
+
disableSelection: !1,
|
|
2887
|
+
multiSelect: !1,
|
|
2863
2888
|
slots: {
|
|
2864
|
-
item: (
|
|
2865
|
-
const
|
|
2889
|
+
item: (r) => {
|
|
2890
|
+
const s = r.itemId ? i[r.itemId] : void 0;
|
|
2866
2891
|
return /* @__PURE__ */ v(
|
|
2867
|
-
|
|
2892
|
+
fo,
|
|
2868
2893
|
{
|
|
2869
|
-
...
|
|
2870
|
-
itemData:
|
|
2871
|
-
iconColor: n
|
|
2894
|
+
...r,
|
|
2895
|
+
itemData: s,
|
|
2896
|
+
iconColor: n,
|
|
2897
|
+
onClick: (a) => {
|
|
2898
|
+
r.itemId && c(a, r.itemId);
|
|
2899
|
+
}
|
|
2872
2900
|
}
|
|
2873
2901
|
);
|
|
2874
2902
|
}
|
|
@@ -2877,6 +2905,6 @@ const co = (e, t) => {
|
|
|
2877
2905
|
) });
|
|
2878
2906
|
};
|
|
2879
2907
|
export {
|
|
2880
|
-
|
|
2881
|
-
|
|
2908
|
+
uo as ICON_TYPE,
|
|
2909
|
+
Vo as default
|
|
2882
2910
|
};
|