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