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