@cgi-learning-hub/ui 1.4.0-dev.1741982096 → 1.4.0-dev.1741985772
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/{Alert-Bdy5B5l-.js → Alert-BCd1tHk0.js} +9 -9
- package/dist/{Backdrop-2gYaM9j-.js → Backdrop-CjDitjBW.js} +6 -6
- package/dist/{Box-DgqaLb7j.js → Box-GMNejc_m.js} +7 -7
- package/dist/{Button-B7kOjNW1.js → Button-x5rtZxJN.js} +6 -6
- package/dist/{ButtonBase-IZ_QjbpE.js → ButtonBase-CU1npQuI.js} +4 -4
- package/dist/{CardContent-F4-KcZH8.js → CardContent-CL_61cm-.js} +3 -3
- package/dist/{Checkbox-DgU-0k3O.js → Checkbox-CtRSDqOe.js} +7 -7
- package/dist/{Chip-B8sdMltW.js → Chip-ZIBpWC4I.js} +6 -6
- package/dist/{CircularProgress-CQxzJquv.js → CircularProgress-B28FKeiH.js} +4 -4
- package/dist/{CloseRounded-CYS1vEvm.js → CloseRounded-pP8asZiP.js} +1 -1
- package/dist/{Collapse-CLl0D4CI.js → Collapse-wS8A5zc5.js} +6 -6
- package/dist/CustomTreeItem-CyfVhVMC.js +1002 -0
- package/dist/CustomTreeItem-GHUeoYTN.cjs +3 -0
- package/dist/DatePicker-64gpvkmk.cjs +13 -0
- package/dist/{DatePicker-CHNHFeLy.js → DatePicker-XdCuICxv.js} +2117 -2529
- package/dist/{DefaultPropsProvider-Cqcb4sws.js → DefaultPropsProvider-CQixa6JQ.js} +7 -7
- package/dist/{Delete-CbtdIdDB.js → Delete-BQA9--_t.js} +1 -1
- package/dist/{Dialog-vSSARfm5.js → Dialog-C-Ptqtq-.js} +9 -9
- package/dist/{DialogContent-BzPaz5G8.js → DialogContent-1sjO2rQK.js} +3 -3
- package/dist/{DialogTitle-BNGMQ2Px.js → DialogTitle-CGpa_QH9.js} +5 -5
- package/dist/{Divider-D-pZeQTm.js → Divider-CNGfzZqD.js} +8 -8
- package/dist/{FormLabel-3-CC-ZGw.js → FormLabel-BlaPVlwX.js} +67 -76
- package/dist/FormLabel-XpwTqbs8.cjs +2 -0
- package/dist/{Grow-DewB1oh4.js → Grow-D5UIC41W.js} +4 -4
- package/dist/{IconButton-CCNUMz2l.js → IconButton-CFUIddNg.js} +6 -6
- package/dist/{InputAdornment-DL8XIM8r.js → InputAdornment-GcbiriFv.js} +5 -5
- package/dist/{InputBase-By7jMrFP.js → InputBase-DJuF09Rf.js} +7 -7
- package/dist/{Link-C_GPIs0q.js → Link-DtsZ0d_s.js} +7 -7
- package/dist/List-BTPrBGqY.js +130 -0
- package/dist/List-Bo4pzQqG.cjs +1 -0
- package/dist/ListItem-C9OfYRAP.js +423 -0
- package/dist/ListItem-CB4JyjSb.cjs +1 -0
- package/dist/ListItemText-B_hEVsaT.js +928 -0
- package/dist/ListItemText-Bjd08uk4.cjs +1 -0
- package/dist/{Menu-DTOOgx49.js → Menu-DD_bqi6q.js} +306 -428
- package/dist/Menu-XypIRgTl.cjs +7 -0
- package/dist/{MenuItem-rnMlnHRT.js → MenuItem-Byj-2QQd.js} +72 -77
- package/dist/MenuItem-vb36Ljmd.cjs +1 -0
- package/dist/{Modal-CjMKpo95.js → Modal-S2P14Nsp.js} +8 -8
- package/dist/{Paper-BiZq6EF2.js → Paper-BrsaeLlu.js} +4 -4
- package/dist/{Popper-Cx071JBT.js → Popper-BNftxeQ5.js} +31 -30
- package/dist/Popper-BaxEpkdE.cjs +4 -0
- package/dist/{Portal-iCPDPYlY.js → Portal-BLEnzj1v.js} +2 -2
- package/dist/{Radio-YTlcDTxU.js → Radio-CRTKwNe5.js} +9 -9
- package/dist/{RadioGroup-d9PIO9nR.js → RadioGroup-NjI5PlIb.js} +3 -3
- package/dist/{Select-CHq7l5LD.cjs → Select-8kBUq_SZ.cjs} +1 -1
- package/dist/{Select-bVUll7Rd.js → Select-C0jrZLRg.js} +30 -30
- package/dist/{Stack-hbAJHQhq.js → Stack-Bm7M81n8.js} +22 -22
- package/dist/{Switch-B9uT9-d0.js → Switch-D5FnE7HW.js} +6 -6
- package/dist/{SwitchBase-CDkmnGAP.js → SwitchBase-91Mand9t.js} +5 -5
- package/dist/{Tabs-Cl4eoKT1.js → Tabs-C5VIdTSp.js} +25 -24
- package/dist/Tabs-Csp29aqN.cjs +4 -0
- package/dist/{TextField-DQ2FvwDM.cjs → TextField-BzqflYRV.cjs} +1 -1
- package/dist/{TextField-VHCImaQP.js → TextField-D5jS5WjF.js} +8 -8
- package/dist/ToggleButtonGroup-Bpi3kmko.cjs +140 -0
- package/dist/{ToggleButtonGroup--eIRTlqD.js → ToggleButtonGroup-CipWZLXf.js} +2366 -3278
- package/dist/Tooltip-DJmbLjU6.cjs +4 -0
- package/dist/{Tooltip-BM3r5yvP.js → Tooltip-DgTrUaHJ.js} +10 -10
- package/dist/{Typography-SIQ6eleU.js → Typography-Ct2Sc9KM.js} +5 -5
- package/dist/{capitalize-3KLkrEtk.js → capitalize-BJ0FEsU7.js} +1 -1
- package/dist/components/Alert/Alert.es.js +1 -1
- package/dist/components/Alert/index.es.js +1 -1
- package/dist/components/Button/Button.es.js +2 -2
- package/dist/components/DatePicker/DatePicker.cjs.js +1 -1
- package/dist/components/DatePicker/DatePicker.es.js +1 -1
- package/dist/components/DatePicker/index.cjs.js +1 -1
- package/dist/components/DatePicker/index.es.js +1 -1
- package/dist/components/Dialog/Dialog.es.js +2 -2
- package/dist/components/Dropzone/Dropzone.es.js +4 -4
- package/dist/components/EmptyState/EmptyState.es.js +3 -3
- package/dist/components/FileList/FileIcon.es.js +1 -1
- package/dist/components/FileList/FileListItem.es.js +4 -4
- package/dist/components/Heading/Heading.es.js +2 -2
- package/dist/components/ImagePicker/ImagePicker.es.js +5 -5
- package/dist/components/Loader/Loader.es.js +1 -1
- package/dist/components/LoaderBackdrop/LoaderBackdrop.es.js +2 -2
- package/dist/components/PasswordInput/PasswordInput.cjs.js +1 -1
- package/dist/components/PasswordInput/PasswordInput.es.js +4 -4
- package/dist/components/ResourceCard/ResourceCard.es.js +1 -1
- package/dist/components/SearchInput/SearchInput.es.js +4 -4
- package/dist/components/TreeView/TreeView.cjs.js +7 -9
- package/dist/components/TreeView/TreeView.d.ts +1 -29
- package/dist/components/TreeView/TreeView.es.js +949 -1950
- package/dist/components/TreeView/components/CustomTreeItem.cjs.js +1 -0
- package/dist/components/TreeView/components/CustomTreeItem.d.ts +4 -0
- package/dist/components/TreeView/components/CustomTreeItem.es.js +9 -0
- package/dist/components/TreeView/index.cjs.js +1 -1
- package/dist/components/TreeView/index.d.ts +1 -1
- package/dist/components/TreeView/index.es.js +4 -3
- package/dist/components/TreeView/style.cjs.js +1 -0
- package/dist/components/TreeView/style.d.ts +11 -0
- package/dist/components/TreeView/style.es.js +23 -0
- package/dist/components/TreeView/types.cjs.js +1 -0
- package/dist/components/TreeView/types.d.ts +37 -0
- package/dist/components/TreeView/types.es.js +4 -0
- package/dist/components/TreeView/utils.cjs.js +1 -0
- package/dist/components/TreeView/utils.d.ts +6 -0
- package/dist/components/TreeView/utils.es.js +51 -0
- package/dist/components/index.cjs.js +1 -1
- package/dist/components/index.es.js +344 -340
- package/dist/components/stories/Alert.stories.es.js +1 -1
- package/dist/components/stories/Button.stories.es.js +1 -1
- package/dist/components/stories/Card.stories.es.js +2 -2
- package/dist/components/stories/Checkbox.stories.es.js +1 -1
- package/dist/components/stories/Chip.stories.es.js +1 -1
- package/dist/components/stories/DatePicker.stories.cjs.js +1 -1
- package/dist/components/stories/DatePicker.stories.es.js +1 -1
- package/dist/components/stories/Dialog.stories.es.js +2 -2
- package/dist/components/stories/Divider.stories.es.js +1 -1
- package/dist/components/stories/FormControlLabel.stories.es.js +3 -3
- package/dist/components/stories/Heading.stories.es.js +2 -2
- package/dist/components/stories/IconButton.stories.es.js +2 -2
- package/dist/components/stories/Link.stories.es.js +1 -1
- package/dist/components/stories/Menu.stories.cjs.js +1 -1
- package/dist/components/stories/Menu.stories.es.js +2 -2
- package/dist/components/stories/Paper.stories.es.js +1 -1
- package/dist/components/stories/RadioGroup.stories.cjs.js +1 -1
- package/dist/components/stories/RadioGroup.stories.es.js +3 -3
- package/dist/components/stories/ResourceCard.stories.es.js +1 -1
- package/dist/components/stories/Select.stories.cjs.js +1 -1
- package/dist/components/stories/Select.stories.es.js +3 -3
- package/dist/components/stories/TabList.stories.cjs.js +1 -1
- package/dist/components/stories/TabList.stories.es.js +4 -4
- package/dist/components/stories/TextField.stories.cjs.js +1 -1
- package/dist/components/stories/TextField.stories.es.js +1 -1
- package/dist/components/stories/Tooltip.stories.cjs.js +1 -1
- package/dist/components/stories/Tooltip.stories.es.js +2 -2
- package/dist/components/stories/TreeView.stories.cjs.js +2 -2
- package/dist/components/stories/TreeView.stories.d.ts +3 -1
- package/dist/components/stories/TreeView.stories.es.js +288 -107
- package/dist/components/stories/Typography.stories.es.js +1 -1
- package/dist/{createSvgIcon-K1Hd8ryN.js → createSvgIcon-B62eln-G.js} +4 -4
- package/dist/{dividerClasses-afsB3Yy1.js → dividerClasses-DjJZQ2Lt.js} +1 -1
- package/dist/{elementTypeAcceptingRef-5ESWTE79.js → elementTypeAcceptingRef-B04tk6ag.js} +1 -1
- package/dist/{extendSxProp-dlShX1xL.js → extendSxProp-CgS-3O19.js} +1 -1
- package/dist/{generateUtilityClasses-DotvgSDH.js → generateUtilityClasses-EXBFO7eY.js} +9 -9
- package/dist/{getReactElementRef-CQNNHBNW.js → getReactElementRef-DjLvttrJ.js} +1 -1
- package/dist/{index-DTTmpNYg.js → index-BZ7ldAwE.js} +4 -4
- package/dist/index-Cr54V0sz.cjs +1 -0
- package/dist/index-D_xl88AE.js +22 -0
- package/dist/{index-B1u7G33_.js → index-DcwdJ8a_.js} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +344 -340
- package/dist/isMuiElement-BzDAj3yJ.cjs +1 -0
- package/dist/isMuiElement-DnSE4qG4.js +13 -0
- package/dist/listItemTextClasses-BCuJjsDp.cjs +1 -0
- package/dist/listItemTextClasses-Kxu3VILo.js +9 -0
- package/dist/{memoTheme-CqmIydD-.js → memoTheme-DJWQ754x.js} +1 -1
- package/dist/{refType-C210ipRY.js → refType-Bpj8bod6.js} +1 -1
- package/dist/{resolveComponentProps-CPmhKPdH.js → resolveComponentProps-CIdMNno4.js} +1 -1
- package/dist/{useSlot-GZu0V5wJ.js → useSlot-RbAtahZu.js} +1 -1
- package/dist/useSlotProps-BTRhbYwP.cjs +1 -0
- package/dist/useSlotProps-U2Iu6E0j.js +25 -0
- package/dist/{useTheme-tdgDVH1p.js → useTheme-CUKf8NYA.js} +1 -1
- package/dist/useTheme-Czi7oO55.js +11 -0
- package/dist/{useThemeProps-BQlPXzo3.js → useThemeProps-Bxjrhw9q.js} +2 -2
- package/dist/useThemeProps-v-SfXuGn.js +17 -0
- package/dist/{utils-Df4KKPfT.js → utils-B2jSugkj.js} +1 -1
- package/package.json +1 -1
- package/dist/DatePicker-BZ6G6Mxd.cjs +0 -13
- package/dist/FormLabel-BV7-a0i5.cjs +0 -2
- package/dist/Menu-CGrqZ9-7.cjs +0 -7
- package/dist/MenuItem-CCjOFEgY.cjs +0 -1
- package/dist/Popper-AHwSSh80.cjs +0 -4
- package/dist/Tabs-AyJ_tKtV.cjs +0 -4
- package/dist/ToggleButtonGroup-BGZ43Mpb.cjs +0 -140
- package/dist/Tooltip-BLQHNepC.cjs +0 -4
- package/dist/useSlotProps-C9tsxDNg.js +0 -45
- package/dist/useSlotProps-CvOxvhyy.cjs +0 -1
- package/dist/useTheme-BA7tMglY.js +0 -11
- package/dist/useThemeProps-BTfGtNci.js +0 -17
|
@@ -1,89 +1,78 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { u as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { u as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
d: "M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"
|
|
26
|
-
}), "KeyboardArrowDown"), ln = ue(/* @__PURE__ */ v("path", {
|
|
27
|
-
d: "M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"
|
|
28
|
-
}), "KeyboardArrowRight"), an = ue(/* @__PURE__ */ v("path", {
|
|
29
|
-
d: "M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92"
|
|
30
|
-
}), "Share");
|
|
31
|
-
function cn(e) {
|
|
32
|
-
return it("MuiRichTreeView", e);
|
|
1
|
+
import { jsx as S, jsxs as je } from "react/jsx-runtime";
|
|
2
|
+
import { B as yt } from "../../Box-GMNejc_m.js";
|
|
3
|
+
import * as E from "react";
|
|
4
|
+
import { useState as Ct, useMemo as wt, useEffect as Rt } from "react";
|
|
5
|
+
import { buildItemDataMap as St, findItemPath as Pt, getItemId as vt } from "./utils.es.js";
|
|
6
|
+
import { treeContainerStyle as kt } from "./style.es.js";
|
|
7
|
+
import { c as Mt, T as Dt, g as $e, a as _e, b as Ne, d as se, f as Ot, e as Vt, h as At, i as he, j as ge, k as Ft, l as oe, u as H, m as Ke, n as Lt, o as jt, p as Ue, q as $t, r as _t, s as Nt, t as Kt, v as O, C as Ut } from "../../CustomTreeItem-CyfVhVMC.js";
|
|
8
|
+
import { _ as C } from "../../ButtonBase-CU1npQuI.js";
|
|
9
|
+
import { H as Bt, G as zt, I as Be, P as a, n as ne } from "../../generateUtilityClasses-EXBFO7eY.js";
|
|
10
|
+
import { a as A } from "../../TransitionGroupContext-DbLioz_6.js";
|
|
11
|
+
import { u as U } from "../../useEventCallback-BAQJJ3ye.js";
|
|
12
|
+
import { o as qt } from "../../ownerDocument-CUrv0DIK.js";
|
|
13
|
+
import { u as Ht } from "../../index-D_xl88AE.js";
|
|
14
|
+
import { C as Xt } from "../../Checkbox-CtRSDqOe.js";
|
|
15
|
+
import { w as xe } from "../../warning-C8W811fV.js";
|
|
16
|
+
import { u as Ee } from "../../useForkRef-C_4o__cU.js";
|
|
17
|
+
import { u as N } from "../../useSlotProps-U2Iu6E0j.js";
|
|
18
|
+
import { r as _, e as Fe } from "../../resolveComponentProps-CIdMNno4.js";
|
|
19
|
+
import { s as ie, c as ze, f as qe } from "../../DefaultPropsProvider-CQixa6JQ.js";
|
|
20
|
+
import { C as Wt } from "../../Collapse-wS8A5zc5.js";
|
|
21
|
+
import { u as Gt } from "../../unsupportedProp-BuVD30Gh.js";
|
|
22
|
+
import { e as Jt } from "../../elementTypeAcceptingRef-B04tk6ag.js";
|
|
23
|
+
function Yt(e) {
|
|
24
|
+
return Bt("MuiRichTreeView", e);
|
|
33
25
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
isControlled: t[u] !== void 0,
|
|
45
|
-
getDefaultValue: c.getDefaultValue
|
|
46
|
-
}, m[u] = c.getDefaultValue(t);
|
|
26
|
+
zt("MuiRichTreeView", ["root"]);
|
|
27
|
+
const Qt = (e, t) => {
|
|
28
|
+
const n = E.useRef({}), [r, l] = E.useState(() => {
|
|
29
|
+
const g = {};
|
|
30
|
+
return e.forEach((p) => {
|
|
31
|
+
p.models && Object.entries(p.models).forEach(([m, f]) => {
|
|
32
|
+
n.current[m] = {
|
|
33
|
+
isControlled: t[m] !== void 0,
|
|
34
|
+
getDefaultValue: f.getDefaultValue
|
|
35
|
+
}, g[m] = f.getDefaultValue(t);
|
|
47
36
|
});
|
|
48
|
-
}),
|
|
49
|
-
}),
|
|
50
|
-
const
|
|
51
|
-
return [
|
|
52
|
-
value:
|
|
53
|
-
setControlledValue: (
|
|
54
|
-
|
|
55
|
-
[
|
|
37
|
+
}), g;
|
|
38
|
+
}), h = Object.fromEntries(Object.entries(n.current).map(([g, p]) => {
|
|
39
|
+
const m = t[g] ?? r[g];
|
|
40
|
+
return [g, {
|
|
41
|
+
value: m,
|
|
42
|
+
setControlledValue: (f) => {
|
|
43
|
+
p.isControlled || l((o) => C({}, o, {
|
|
44
|
+
[g]: f
|
|
56
45
|
}));
|
|
57
46
|
}
|
|
58
47
|
}];
|
|
59
48
|
}));
|
|
60
|
-
return process.env.NODE_ENV !== "production" && Object.entries(n.current).forEach(([
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
49
|
+
return process.env.NODE_ENV !== "production" && Object.entries(n.current).forEach(([g, p]) => {
|
|
50
|
+
const m = t[g], f = p.getDefaultValue(t);
|
|
51
|
+
E.useEffect(() => {
|
|
52
|
+
p.isControlled !== (m !== void 0) && console.error([`MUI X: A component is changing the ${p.isControlled ? "" : "un"}controlled ${g} state of TreeView to be ${p.isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${g} 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
53
|
`));
|
|
65
|
-
}, [
|
|
54
|
+
}, [m]);
|
|
66
55
|
const {
|
|
67
|
-
current:
|
|
68
|
-
} =
|
|
69
|
-
|
|
70
|
-
!
|
|
56
|
+
current: o
|
|
57
|
+
} = E.useRef(f);
|
|
58
|
+
E.useEffect(() => {
|
|
59
|
+
!p.isControlled && o !== f && console.error([`MUI X: A component is changing the default ${g} state of an uncontrolled TreeView after being initialized. To suppress this warning opt to use a controlled TreeView.`].join(`
|
|
71
60
|
`));
|
|
72
|
-
}, [JSON.stringify(
|
|
73
|
-
}),
|
|
61
|
+
}, [JSON.stringify(f)]);
|
|
62
|
+
}), h;
|
|
74
63
|
};
|
|
75
|
-
class
|
|
64
|
+
class Zt {
|
|
76
65
|
constructor() {
|
|
77
66
|
this.maxListeners = 20, this.warnOnce = !1, this.events = {};
|
|
78
67
|
}
|
|
79
|
-
on(t, n,
|
|
80
|
-
let
|
|
81
|
-
if (
|
|
68
|
+
on(t, n, r = {}) {
|
|
69
|
+
let l = this.events[t];
|
|
70
|
+
if (l || (l = {
|
|
82
71
|
highPriority: /* @__PURE__ */ new Map(),
|
|
83
72
|
regular: /* @__PURE__ */ new Map()
|
|
84
|
-
}, this.events[t] =
|
|
85
|
-
const
|
|
86
|
-
|
|
73
|
+
}, this.events[t] = l), r.isFirst ? l.highPriority.set(n, !0) : l.regular.set(n, !0), process.env.NODE_ENV !== "production") {
|
|
74
|
+
const h = l.highPriority.size + l.regular.size;
|
|
75
|
+
h > this.maxListeners && !this.warnOnce && (this.warnOnce = !0, console.warn([`Possible EventEmitter memory leak detected. ${h} ${t} listeners added.`].join(`
|
|
87
76
|
`)));
|
|
88
77
|
}
|
|
89
78
|
}
|
|
@@ -94,32 +83,32 @@ class un {
|
|
|
94
83
|
this.events = {};
|
|
95
84
|
}
|
|
96
85
|
emit(t, ...n) {
|
|
97
|
-
const
|
|
98
|
-
if (!
|
|
86
|
+
const r = this.events[t];
|
|
87
|
+
if (!r)
|
|
99
88
|
return;
|
|
100
|
-
const
|
|
101
|
-
for (let
|
|
102
|
-
const
|
|
103
|
-
|
|
89
|
+
const l = Array.from(r.highPriority.keys()), h = Array.from(r.regular.keys());
|
|
90
|
+
for (let g = l.length - 1; g >= 0; g -= 1) {
|
|
91
|
+
const p = l[g];
|
|
92
|
+
r.highPriority.has(p) && p.apply(this, n);
|
|
104
93
|
}
|
|
105
|
-
for (let
|
|
106
|
-
const
|
|
107
|
-
|
|
94
|
+
for (let g = 0; g < h.length; g += 1) {
|
|
95
|
+
const p = h[g];
|
|
96
|
+
r.regular.has(p) && p.apply(this, n);
|
|
108
97
|
}
|
|
109
98
|
}
|
|
110
99
|
once(t, n) {
|
|
111
|
-
const
|
|
112
|
-
this.on(t, function
|
|
113
|
-
|
|
100
|
+
const r = this;
|
|
101
|
+
this.on(t, function l(...h) {
|
|
102
|
+
r.removeListener(t, l), n.apply(r, h);
|
|
114
103
|
});
|
|
115
104
|
}
|
|
116
105
|
}
|
|
117
|
-
const
|
|
118
|
-
const [e] =
|
|
119
|
-
const [
|
|
120
|
-
|
|
121
|
-
}, [e]), n =
|
|
122
|
-
e.removeListener(
|
|
106
|
+
const en = (e) => e.isPropagationStopped !== void 0, He = () => {
|
|
107
|
+
const [e] = E.useState(() => new Zt()), t = E.useCallback((...r) => {
|
|
108
|
+
const [l, h, g = {}] = r;
|
|
109
|
+
g.defaultMuiPrevented = !1, !(en(g) && g.isPropagationStopped()) && e.emit(l, h, g);
|
|
110
|
+
}, [e]), n = E.useCallback((r, l) => (e.on(r, l), () => {
|
|
111
|
+
e.removeListener(r, l);
|
|
123
112
|
}), [e]);
|
|
124
113
|
return {
|
|
125
114
|
instance: {
|
|
@@ -128,8 +117,8 @@ const pn = (e) => e.isPropagationStopped !== void 0, dt = () => {
|
|
|
128
117
|
}
|
|
129
118
|
};
|
|
130
119
|
};
|
|
131
|
-
|
|
132
|
-
const
|
|
120
|
+
He.params = {};
|
|
121
|
+
const Xe = ({
|
|
133
122
|
plugins: e
|
|
134
123
|
}) => {
|
|
135
124
|
const t = new Set(e);
|
|
@@ -139,208 +128,202 @@ const ut = ({
|
|
|
139
128
|
}
|
|
140
129
|
};
|
|
141
130
|
};
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const fn = () => (nt += 1, `mui-tree-view-${nt}`), Ke = ({
|
|
145
|
-
id: e,
|
|
146
|
-
treeId: t = "",
|
|
147
|
-
itemId: n
|
|
148
|
-
}) => e ?? `${t}-${n}`, _e = ({
|
|
131
|
+
Xe.params = {};
|
|
132
|
+
const Te = ({
|
|
149
133
|
params: e,
|
|
150
134
|
state: t,
|
|
151
135
|
setState: n
|
|
152
136
|
}) => {
|
|
153
|
-
|
|
154
|
-
n((
|
|
155
|
-
id: C({},
|
|
156
|
-
treeId: e.id ??
|
|
137
|
+
E.useEffect(() => {
|
|
138
|
+
n((l) => l.id.treeId === e.id && l.id.treeId !== void 0 ? l : C({}, l, {
|
|
139
|
+
id: C({}, l.id, {
|
|
140
|
+
treeId: e.id ?? Mt()
|
|
157
141
|
})
|
|
158
142
|
}));
|
|
159
143
|
}, [n, e.id]);
|
|
160
|
-
const
|
|
144
|
+
const r = e.id ?? t.id.treeId;
|
|
161
145
|
return {
|
|
162
146
|
getRootProps: () => ({
|
|
163
|
-
id:
|
|
147
|
+
id: r
|
|
164
148
|
}),
|
|
165
149
|
contextValue: {
|
|
166
|
-
treeId:
|
|
150
|
+
treeId: r
|
|
167
151
|
}
|
|
168
152
|
};
|
|
169
153
|
};
|
|
170
|
-
|
|
154
|
+
Te.params = {
|
|
171
155
|
id: !0
|
|
172
156
|
};
|
|
173
|
-
|
|
157
|
+
Te.getInitialState = ({
|
|
174
158
|
id: e
|
|
175
159
|
}) => ({
|
|
176
160
|
id: {
|
|
177
161
|
treeId: e ?? void 0
|
|
178
162
|
}
|
|
179
163
|
});
|
|
180
|
-
const
|
|
164
|
+
const tn = [He, Xe, Te], nn = ["slots", "slotProps", "apiRef", "experimentalFeatures"], on = (e) => {
|
|
181
165
|
let {
|
|
182
166
|
props: {
|
|
183
167
|
slots: t,
|
|
184
168
|
slotProps: n,
|
|
185
|
-
apiRef:
|
|
186
|
-
experimentalFeatures:
|
|
169
|
+
apiRef: r,
|
|
170
|
+
experimentalFeatures: l
|
|
187
171
|
},
|
|
188
|
-
plugins:
|
|
189
|
-
} = e,
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
Object.assign(
|
|
172
|
+
plugins: h
|
|
173
|
+
} = e, g = A(e.props, nn);
|
|
174
|
+
const p = {};
|
|
175
|
+
h.forEach((u) => {
|
|
176
|
+
Object.assign(p, u.params);
|
|
193
177
|
});
|
|
194
|
-
const
|
|
195
|
-
Object.keys(
|
|
196
|
-
const
|
|
197
|
-
|
|
178
|
+
const m = {}, f = {};
|
|
179
|
+
Object.keys(g).forEach((u) => {
|
|
180
|
+
const b = g[u];
|
|
181
|
+
p[u] ? m[u] = b : f[u] = b;
|
|
198
182
|
});
|
|
199
|
-
const
|
|
200
|
-
params:
|
|
201
|
-
experimentalFeatures:
|
|
202
|
-
}) :
|
|
183
|
+
const o = l ?? {}, s = h.reduce((u, b) => b.getDefaultizedParams ? b.getDefaultizedParams({
|
|
184
|
+
params: u,
|
|
185
|
+
experimentalFeatures: o
|
|
186
|
+
}) : u, m);
|
|
203
187
|
return {
|
|
204
|
-
apiRef:
|
|
205
|
-
forwardedProps:
|
|
188
|
+
apiRef: r,
|
|
189
|
+
forwardedProps: f,
|
|
206
190
|
pluginParams: s,
|
|
207
191
|
slots: t ?? {},
|
|
208
192
|
slotProps: n ?? {},
|
|
209
|
-
experimentalFeatures:
|
|
193
|
+
experimentalFeatures: o
|
|
210
194
|
};
|
|
211
|
-
},
|
|
195
|
+
}, rn = ({
|
|
212
196
|
plugins: e,
|
|
213
197
|
instance: t,
|
|
214
198
|
publicAPI: n,
|
|
215
|
-
rootRef:
|
|
199
|
+
rootRef: r
|
|
216
200
|
}) => ({
|
|
217
|
-
runItemPlugins: (
|
|
218
|
-
let
|
|
219
|
-
const
|
|
220
|
-
e.forEach((
|
|
221
|
-
if (!
|
|
201
|
+
runItemPlugins: (p) => {
|
|
202
|
+
let m = null, f = null;
|
|
203
|
+
const o = [], s = {};
|
|
204
|
+
e.forEach((x) => {
|
|
205
|
+
if (!x.itemPlugin)
|
|
222
206
|
return;
|
|
223
|
-
const
|
|
224
|
-
props:
|
|
225
|
-
rootRef:
|
|
226
|
-
contentRef:
|
|
207
|
+
const c = x.itemPlugin({
|
|
208
|
+
props: p,
|
|
209
|
+
rootRef: m,
|
|
210
|
+
contentRef: f
|
|
227
211
|
});
|
|
228
|
-
|
|
229
|
-
s[
|
|
212
|
+
c != null && c.rootRef && (m = c.rootRef), c != null && c.contentRef && (f = c.contentRef), c != null && c.propsEnhancers && (o.push(c.propsEnhancers), Object.keys(c.propsEnhancers).forEach((i) => {
|
|
213
|
+
s[i] = !0;
|
|
230
214
|
}));
|
|
231
215
|
});
|
|
232
|
-
const
|
|
233
|
-
const
|
|
234
|
-
return
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
}),
|
|
238
|
-
},
|
|
216
|
+
const u = (x) => (c) => {
|
|
217
|
+
const i = {};
|
|
218
|
+
return o.forEach((d) => {
|
|
219
|
+
const I = d[x];
|
|
220
|
+
I != null && Object.assign(i, I(c));
|
|
221
|
+
}), i;
|
|
222
|
+
}, b = Object.fromEntries(Object.keys(s).map((x) => [x, u(x)]));
|
|
239
223
|
return {
|
|
240
|
-
contentRef:
|
|
241
|
-
rootRef:
|
|
242
|
-
propsEnhancers:
|
|
224
|
+
contentRef: f,
|
|
225
|
+
rootRef: m,
|
|
226
|
+
propsEnhancers: b
|
|
243
227
|
};
|
|
244
228
|
},
|
|
245
229
|
wrapItem: ({
|
|
246
|
-
itemId:
|
|
247
|
-
children:
|
|
230
|
+
itemId: p,
|
|
231
|
+
children: m
|
|
248
232
|
}) => {
|
|
249
|
-
let
|
|
250
|
-
for (let
|
|
251
|
-
const s = e[
|
|
252
|
-
s.wrapItem && (
|
|
253
|
-
itemId:
|
|
254
|
-
children:
|
|
233
|
+
let f = m;
|
|
234
|
+
for (let o = e.length - 1; o >= 0; o -= 1) {
|
|
235
|
+
const s = e[o];
|
|
236
|
+
s.wrapItem && (f = s.wrapItem({
|
|
237
|
+
itemId: p,
|
|
238
|
+
children: f,
|
|
255
239
|
instance: t
|
|
256
240
|
}));
|
|
257
241
|
}
|
|
258
|
-
return
|
|
242
|
+
return f;
|
|
259
243
|
},
|
|
260
244
|
wrapRoot: ({
|
|
261
|
-
children:
|
|
245
|
+
children: p
|
|
262
246
|
}) => {
|
|
263
|
-
let
|
|
264
|
-
for (let
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
children:
|
|
247
|
+
let m = p;
|
|
248
|
+
for (let f = e.length - 1; f >= 0; f -= 1) {
|
|
249
|
+
const o = e[f];
|
|
250
|
+
o.wrapRoot && (m = o.wrapRoot({
|
|
251
|
+
children: m,
|
|
268
252
|
instance: t
|
|
269
253
|
}));
|
|
270
254
|
}
|
|
271
|
-
return
|
|
255
|
+
return m;
|
|
272
256
|
},
|
|
273
257
|
instance: t,
|
|
274
|
-
rootRef:
|
|
258
|
+
rootRef: r,
|
|
275
259
|
publicAPI: n
|
|
276
260
|
});
|
|
277
|
-
function
|
|
278
|
-
const t =
|
|
261
|
+
function sn(e) {
|
|
262
|
+
const t = E.useRef({});
|
|
279
263
|
return e ? (e.current == null && (e.current = {}), e.current) : t.current;
|
|
280
264
|
}
|
|
281
|
-
const
|
|
265
|
+
const ln = ({
|
|
282
266
|
plugins: e,
|
|
283
267
|
rootRef: t,
|
|
284
268
|
props: n
|
|
285
269
|
}) => {
|
|
286
|
-
const
|
|
287
|
-
pluginParams:
|
|
288
|
-
forwardedProps:
|
|
289
|
-
apiRef:
|
|
290
|
-
experimentalFeatures:
|
|
291
|
-
slots:
|
|
292
|
-
slotProps:
|
|
293
|
-
} =
|
|
294
|
-
plugins:
|
|
270
|
+
const r = [...tn, ...e], {
|
|
271
|
+
pluginParams: l,
|
|
272
|
+
forwardedProps: h,
|
|
273
|
+
apiRef: g,
|
|
274
|
+
experimentalFeatures: p,
|
|
275
|
+
slots: m,
|
|
276
|
+
slotProps: f
|
|
277
|
+
} = on({
|
|
278
|
+
plugins: r,
|
|
295
279
|
props: n
|
|
296
|
-
}),
|
|
297
|
-
plugins:
|
|
298
|
-
instance:
|
|
299
|
-
publicAPI:
|
|
300
|
-
rootRef:
|
|
301
|
-
}), [
|
|
302
|
-
const
|
|
303
|
-
return
|
|
304
|
-
|
|
305
|
-
}),
|
|
306
|
-
}),
|
|
307
|
-
const
|
|
308
|
-
instance:
|
|
309
|
-
params:
|
|
310
|
-
slots:
|
|
311
|
-
slotProps:
|
|
312
|
-
experimentalFeatures:
|
|
313
|
-
state:
|
|
314
|
-
setState:
|
|
315
|
-
rootRef:
|
|
316
|
-
models:
|
|
317
|
-
plugins:
|
|
280
|
+
}), o = Qt(r, l), u = E.useRef({}).current, b = sn(g), x = E.useRef(null), c = Ee(x, t), i = rn({
|
|
281
|
+
plugins: r,
|
|
282
|
+
instance: u,
|
|
283
|
+
publicAPI: b,
|
|
284
|
+
rootRef: x
|
|
285
|
+
}), [d, I] = E.useState(() => {
|
|
286
|
+
const R = {};
|
|
287
|
+
return r.forEach((v) => {
|
|
288
|
+
v.getInitialState && Object.assign(R, v.getInitialState(l));
|
|
289
|
+
}), R;
|
|
290
|
+
}), T = [], P = (R) => {
|
|
291
|
+
const v = R({
|
|
292
|
+
instance: u,
|
|
293
|
+
params: l,
|
|
294
|
+
slots: m,
|
|
295
|
+
slotProps: f,
|
|
296
|
+
experimentalFeatures: p,
|
|
297
|
+
state: d,
|
|
298
|
+
setState: I,
|
|
299
|
+
rootRef: x,
|
|
300
|
+
models: o,
|
|
301
|
+
plugins: r
|
|
318
302
|
});
|
|
319
|
-
|
|
303
|
+
v.getRootProps && T.push(v.getRootProps), v.publicAPI && Object.assign(b, v.publicAPI), v.instance && Object.assign(u, v.instance), v.contextValue && Object.assign(i, v.contextValue);
|
|
320
304
|
};
|
|
321
|
-
return
|
|
322
|
-
getRootProps: (
|
|
323
|
-
const
|
|
305
|
+
return r.forEach(P), {
|
|
306
|
+
getRootProps: (R = {}) => {
|
|
307
|
+
const v = C({
|
|
324
308
|
role: "tree"
|
|
325
|
-
},
|
|
326
|
-
ref:
|
|
309
|
+
}, h, R, {
|
|
310
|
+
ref: c
|
|
327
311
|
});
|
|
328
|
-
return
|
|
329
|
-
Object.assign(
|
|
330
|
-
}),
|
|
312
|
+
return T.forEach((F) => {
|
|
313
|
+
Object.assign(v, F(R));
|
|
314
|
+
}), v;
|
|
331
315
|
},
|
|
332
|
-
rootRef:
|
|
333
|
-
contextValue:
|
|
334
|
-
instance:
|
|
316
|
+
rootRef: c,
|
|
317
|
+
contextValue: i,
|
|
318
|
+
instance: u
|
|
335
319
|
};
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
function yn(e) {
|
|
320
|
+
};
|
|
321
|
+
function an(e) {
|
|
339
322
|
const {
|
|
340
323
|
value: t,
|
|
341
324
|
children: n
|
|
342
325
|
} = e;
|
|
343
|
-
return /* @__PURE__ */
|
|
326
|
+
return /* @__PURE__ */ S(Dt.Provider, {
|
|
344
327
|
value: t,
|
|
345
328
|
children: t.wrapRoot({
|
|
346
329
|
children: n,
|
|
@@ -348,189 +331,181 @@ function yn(e) {
|
|
|
348
331
|
})
|
|
349
332
|
});
|
|
350
333
|
}
|
|
351
|
-
const
|
|
352
|
-
const e = w.useContext(Be);
|
|
353
|
-
if (e == null)
|
|
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
|
-
`));
|
|
356
|
-
return e;
|
|
357
|
-
}, Tn = (e, t, n) => {
|
|
334
|
+
const cn = (e, t, n) => {
|
|
358
335
|
e.$$publishEvent(t, n);
|
|
359
|
-
},
|
|
336
|
+
}, K = "__TREE_VIEW_ROOT_PARENT_ID__", un = (e) => {
|
|
360
337
|
const t = {};
|
|
361
|
-
return e.forEach((n,
|
|
362
|
-
t[n] =
|
|
338
|
+
return e.forEach((n, r) => {
|
|
339
|
+
t[n] = r;
|
|
363
340
|
}), t;
|
|
364
|
-
},
|
|
365
|
-
process.env.NODE_ENV !== "production" && (Pe.displayName = "TreeViewItemDepthContext");
|
|
366
|
-
const En = ["children"], pt = ({
|
|
341
|
+
}, dn = ["children"], We = ({
|
|
367
342
|
items: e,
|
|
368
343
|
isItemDisabled: t,
|
|
369
344
|
getItemLabel: n,
|
|
370
|
-
getItemId:
|
|
345
|
+
getItemId: r
|
|
371
346
|
}) => {
|
|
372
|
-
const
|
|
373
|
-
[
|
|
374
|
-
},
|
|
375
|
-
var
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", "An item was provided without id in the `items` prop:", JSON.stringify(
|
|
347
|
+
const l = {}, h = {}, g = {
|
|
348
|
+
[K]: []
|
|
349
|
+
}, p = (f, o, s) => {
|
|
350
|
+
var c, i;
|
|
351
|
+
const u = r ? r(f) : f.id;
|
|
352
|
+
if (u == null)
|
|
353
|
+
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(f)].join(`
|
|
379
354
|
`));
|
|
380
|
-
if (
|
|
381
|
-
throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", `Two items were provided with the same id in the \`items\` prop: "${
|
|
355
|
+
if (l[u] != null)
|
|
356
|
+
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: "${u}"`].join(`
|
|
382
357
|
`));
|
|
383
|
-
const
|
|
384
|
-
if (
|
|
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(
|
|
358
|
+
const b = n ? n(f) : f.label;
|
|
359
|
+
if (b == null)
|
|
360
|
+
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(f)].join(`
|
|
386
361
|
`));
|
|
387
|
-
|
|
388
|
-
id:
|
|
389
|
-
label:
|
|
362
|
+
l[u] = {
|
|
363
|
+
id: u,
|
|
364
|
+
label: b,
|
|
390
365
|
parentId: s,
|
|
391
366
|
idAttribute: void 0,
|
|
392
|
-
expandable: !!((
|
|
393
|
-
disabled: t ? t(
|
|
394
|
-
depth:
|
|
395
|
-
},
|
|
396
|
-
const
|
|
397
|
-
|
|
367
|
+
expandable: !!((c = f.children) != null && c.length),
|
|
368
|
+
disabled: t ? t(f) : !1,
|
|
369
|
+
depth: o
|
|
370
|
+
}, h[u] = f;
|
|
371
|
+
const x = s ?? K;
|
|
372
|
+
g[x] || (g[x] = []), g[x].push(u), (i = f.children) == null || i.forEach((d) => p(d, o + 1, u));
|
|
398
373
|
};
|
|
399
|
-
e.forEach((
|
|
400
|
-
const
|
|
401
|
-
return Object.keys(
|
|
402
|
-
|
|
374
|
+
e.forEach((f) => p(f, 0, null));
|
|
375
|
+
const m = {};
|
|
376
|
+
return Object.keys(g).forEach((f) => {
|
|
377
|
+
m[f] = un(g[f]);
|
|
403
378
|
}), {
|
|
404
|
-
itemMetaMap:
|
|
405
|
-
itemMap:
|
|
406
|
-
itemOrderedChildrenIds:
|
|
407
|
-
itemChildrenIndexes:
|
|
379
|
+
itemMetaMap: l,
|
|
380
|
+
itemMap: h,
|
|
381
|
+
itemOrderedChildrenIds: g,
|
|
382
|
+
itemChildrenIndexes: m
|
|
408
383
|
};
|
|
409
|
-
},
|
|
384
|
+
}, X = ({
|
|
410
385
|
instance: e,
|
|
411
386
|
params: t,
|
|
412
387
|
state: n,
|
|
413
|
-
setState:
|
|
414
|
-
experimentalFeatures:
|
|
388
|
+
setState: r,
|
|
389
|
+
experimentalFeatures: l
|
|
415
390
|
}) => {
|
|
416
|
-
const
|
|
417
|
-
const
|
|
418
|
-
const
|
|
419
|
-
return
|
|
391
|
+
const h = E.useCallback((d) => n.items.itemMetaMap[d], [n.items.itemMetaMap]), g = E.useCallback((d) => n.items.itemMap[d], [n.items.itemMap]), p = E.useCallback(() => {
|
|
392
|
+
const d = (I) => {
|
|
393
|
+
const T = n.items.itemMap[I], P = A(T, dn), y = n.items.itemOrderedChildrenIds[I];
|
|
394
|
+
return y && (P.children = y.map(d)), P;
|
|
420
395
|
};
|
|
421
|
-
return n.items.itemOrderedChildrenIds[
|
|
422
|
-
}, [n.items.itemMap, n.items.itemOrderedChildrenIds]),
|
|
423
|
-
if (
|
|
396
|
+
return n.items.itemOrderedChildrenIds[K].map(d);
|
|
397
|
+
}, [n.items.itemMap, n.items.itemOrderedChildrenIds]), m = E.useCallback((d) => {
|
|
398
|
+
if (d == null)
|
|
424
399
|
return !1;
|
|
425
|
-
let
|
|
426
|
-
if (!
|
|
400
|
+
let I = e.getItemMeta(d);
|
|
401
|
+
if (!I)
|
|
427
402
|
return !1;
|
|
428
|
-
if (
|
|
403
|
+
if (I.disabled)
|
|
429
404
|
return !0;
|
|
430
|
-
for (;
|
|
431
|
-
if (
|
|
405
|
+
for (; I.parentId != null; )
|
|
406
|
+
if (I = e.getItemMeta(I.parentId), I.disabled)
|
|
432
407
|
return !0;
|
|
433
408
|
return !1;
|
|
434
|
-
}, [e]),
|
|
435
|
-
const
|
|
436
|
-
return n.items.itemChildrenIndexes[
|
|
437
|
-
}, [e, n.items.itemChildrenIndexes]),
|
|
438
|
-
const
|
|
439
|
-
return
|
|
409
|
+
}, [e]), f = E.useCallback((d) => {
|
|
410
|
+
const I = e.getItemMeta(d).parentId ?? K;
|
|
411
|
+
return n.items.itemChildrenIndexes[I][d];
|
|
412
|
+
}, [e, n.items.itemChildrenIndexes]), o = E.useCallback((d) => n.items.itemOrderedChildrenIds[d ?? K] ?? [], [n.items.itemOrderedChildrenIds]), s = (d) => {
|
|
413
|
+
const I = e.getItemMeta(d);
|
|
414
|
+
return I == null ? null : document.getElementById($e({
|
|
440
415
|
treeId: n.id.treeId,
|
|
441
|
-
itemId:
|
|
442
|
-
id:
|
|
416
|
+
itemId: d,
|
|
417
|
+
id: I.idAttribute
|
|
443
418
|
}));
|
|
444
|
-
},
|
|
445
|
-
|
|
446
|
-
}, []),
|
|
447
|
-
return
|
|
448
|
-
e.areItemUpdatesPrevented() ||
|
|
449
|
-
const
|
|
419
|
+
}, u = (d) => t.disabledItemsFocusable ? !0 : !e.isItemDisabled(d), b = E.useRef(!1), x = E.useCallback(() => {
|
|
420
|
+
b.current = !0;
|
|
421
|
+
}, []), c = E.useCallback(() => b.current, []);
|
|
422
|
+
return E.useEffect(() => {
|
|
423
|
+
e.areItemUpdatesPrevented() || r((d) => {
|
|
424
|
+
const I = We({
|
|
450
425
|
items: t.items,
|
|
451
426
|
isItemDisabled: t.isItemDisabled,
|
|
452
427
|
getItemId: t.getItemId,
|
|
453
428
|
getItemLabel: t.getItemLabel
|
|
454
429
|
});
|
|
455
|
-
return Object.values(
|
|
456
|
-
|
|
457
|
-
id:
|
|
430
|
+
return Object.values(d.items.itemMetaMap).forEach((T) => {
|
|
431
|
+
I.itemMetaMap[T.id] || cn(e, "removeItem", {
|
|
432
|
+
id: T.id
|
|
458
433
|
});
|
|
459
|
-
}), C({},
|
|
460
|
-
items:
|
|
434
|
+
}), C({}, d, {
|
|
435
|
+
items: I
|
|
461
436
|
});
|
|
462
437
|
});
|
|
463
|
-
}, [e,
|
|
438
|
+
}, [e, r, t.items, t.isItemDisabled, t.getItemId, t.getItemLabel]), {
|
|
464
439
|
getRootProps: () => ({
|
|
465
440
|
style: {
|
|
466
441
|
"--TreeView-itemChildrenIndentation": typeof t.itemChildrenIndentation == "number" ? `${t.itemChildrenIndentation}px` : t.itemChildrenIndentation
|
|
467
442
|
}
|
|
468
443
|
}),
|
|
469
444
|
publicAPI: {
|
|
470
|
-
getItem:
|
|
445
|
+
getItem: g,
|
|
471
446
|
getItemDOMElement: s,
|
|
472
|
-
getItemTree:
|
|
473
|
-
getItemOrderedChildrenIds:
|
|
447
|
+
getItemTree: p,
|
|
448
|
+
getItemOrderedChildrenIds: o
|
|
474
449
|
},
|
|
475
450
|
instance: {
|
|
476
|
-
getItemMeta:
|
|
477
|
-
getItem:
|
|
478
|
-
getItemTree:
|
|
451
|
+
getItemMeta: h,
|
|
452
|
+
getItem: g,
|
|
453
|
+
getItemTree: p,
|
|
479
454
|
getItemsToRender: () => {
|
|
480
|
-
const
|
|
481
|
-
var
|
|
482
|
-
const
|
|
455
|
+
const d = (I) => {
|
|
456
|
+
var P;
|
|
457
|
+
const T = n.items.itemMetaMap[I];
|
|
483
458
|
return {
|
|
484
|
-
label:
|
|
485
|
-
itemId:
|
|
486
|
-
id:
|
|
487
|
-
children: (
|
|
459
|
+
label: T.label,
|
|
460
|
+
itemId: T.id,
|
|
461
|
+
id: T.idAttribute,
|
|
462
|
+
children: (P = n.items.itemOrderedChildrenIds[I]) == null ? void 0 : P.map(d)
|
|
488
463
|
};
|
|
489
464
|
};
|
|
490
|
-
return n.items.itemOrderedChildrenIds[
|
|
465
|
+
return n.items.itemOrderedChildrenIds[K].map(d);
|
|
491
466
|
},
|
|
492
|
-
getItemIndex:
|
|
467
|
+
getItemIndex: f,
|
|
493
468
|
getItemDOMElement: s,
|
|
494
|
-
getItemOrderedChildrenIds:
|
|
495
|
-
isItemDisabled:
|
|
496
|
-
isItemNavigable:
|
|
497
|
-
preventItemUpdates:
|
|
498
|
-
areItemUpdatesPrevented:
|
|
469
|
+
getItemOrderedChildrenIds: o,
|
|
470
|
+
isItemDisabled: m,
|
|
471
|
+
isItemNavigable: u,
|
|
472
|
+
preventItemUpdates: x,
|
|
473
|
+
areItemUpdatesPrevented: c
|
|
499
474
|
},
|
|
500
475
|
contextValue: {
|
|
501
476
|
items: {
|
|
502
477
|
onItemClick: t.onItemClick,
|
|
503
478
|
disabledItemsFocusable: t.disabledItemsFocusable,
|
|
504
|
-
indentationAtItemLevel:
|
|
479
|
+
indentationAtItemLevel: l.indentationAtItemLevel ?? !1
|
|
505
480
|
}
|
|
506
481
|
}
|
|
507
482
|
};
|
|
508
483
|
};
|
|
509
|
-
|
|
510
|
-
items:
|
|
484
|
+
X.getInitialState = (e) => ({
|
|
485
|
+
items: We({
|
|
511
486
|
items: e.items,
|
|
512
487
|
isItemDisabled: e.isItemDisabled,
|
|
513
488
|
getItemId: e.getItemId,
|
|
514
489
|
getItemLabel: e.getItemLabel
|
|
515
490
|
})
|
|
516
491
|
});
|
|
517
|
-
|
|
492
|
+
X.getDefaultizedParams = ({
|
|
518
493
|
params: e
|
|
519
494
|
}) => C({}, e, {
|
|
520
495
|
disabledItemsFocusable: e.disabledItemsFocusable ?? !1,
|
|
521
496
|
itemChildrenIndentation: e.itemChildrenIndentation ?? "12px"
|
|
522
497
|
});
|
|
523
|
-
|
|
498
|
+
X.wrapRoot = ({
|
|
524
499
|
children: e,
|
|
525
500
|
instance: t
|
|
526
|
-
}) => /* @__PURE__ */
|
|
501
|
+
}) => /* @__PURE__ */ S(_e.Provider, {
|
|
527
502
|
value: (n) => {
|
|
528
|
-
var
|
|
529
|
-
return ((
|
|
503
|
+
var r;
|
|
504
|
+
return ((r = t.getItemMeta(n)) == null ? void 0 : r.depth) ?? 0;
|
|
530
505
|
},
|
|
531
506
|
children: e
|
|
532
507
|
});
|
|
533
|
-
|
|
508
|
+
X.params = {
|
|
534
509
|
disabledItemsFocusable: !0,
|
|
535
510
|
items: !0,
|
|
536
511
|
isItemDisabled: !0,
|
|
@@ -539,239 +514,157 @@ he.params = {
|
|
|
539
514
|
onItemClick: !0,
|
|
540
515
|
itemChildrenIndentation: !0
|
|
541
516
|
};
|
|
542
|
-
const
|
|
517
|
+
const le = ({
|
|
543
518
|
instance: e,
|
|
544
519
|
params: t,
|
|
545
520
|
models: n
|
|
546
521
|
}) => {
|
|
547
|
-
const
|
|
522
|
+
const r = E.useMemo(() => {
|
|
548
523
|
const s = /* @__PURE__ */ new Map();
|
|
549
|
-
return n.expandedItems.value.forEach((
|
|
550
|
-
s.set(
|
|
524
|
+
return n.expandedItems.value.forEach((u) => {
|
|
525
|
+
s.set(u, !0);
|
|
551
526
|
}), s;
|
|
552
|
-
}, [n.expandedItems.value]),
|
|
553
|
-
var
|
|
554
|
-
(
|
|
555
|
-
},
|
|
556
|
-
var
|
|
557
|
-
return !!((
|
|
558
|
-
}, [e]),
|
|
559
|
-
const
|
|
560
|
-
e.setItemExpansion(s,
|
|
561
|
-
}),
|
|
562
|
-
if (e.isItemExpanded(
|
|
527
|
+
}, [n.expandedItems.value]), l = (s, u) => {
|
|
528
|
+
var b;
|
|
529
|
+
(b = t.onExpandedItemsChange) == null || b.call(t, s, u), n.expandedItems.setControlledValue(u);
|
|
530
|
+
}, h = E.useCallback((s) => r.has(s), [r]), g = E.useCallback((s) => {
|
|
531
|
+
var u;
|
|
532
|
+
return !!((u = e.getItemMeta(s)) != null && u.expandable);
|
|
533
|
+
}, [e]), p = U((s, u) => {
|
|
534
|
+
const b = e.isItemExpanded(u);
|
|
535
|
+
e.setItemExpansion(s, u, !b);
|
|
536
|
+
}), m = U((s, u, b) => {
|
|
537
|
+
if (e.isItemExpanded(u) === b)
|
|
563
538
|
return;
|
|
564
|
-
let
|
|
565
|
-
|
|
566
|
-
}),
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
t.onItemExpansionToggle(s,
|
|
570
|
-
}),
|
|
571
|
-
},
|
|
539
|
+
let c;
|
|
540
|
+
b ? c = [u].concat(n.expandedItems.value) : c = n.expandedItems.value.filter((i) => i !== u), t.onItemExpansionToggle && t.onItemExpansionToggle(s, u, b), l(s, c);
|
|
541
|
+
}), f = (s, u) => {
|
|
542
|
+
const b = e.getItemMeta(u), c = e.getItemOrderedChildrenIds(b.parentId).filter((d) => e.isItemExpandable(d) && !e.isItemExpanded(d)), i = n.expandedItems.value.concat(c);
|
|
543
|
+
c.length > 0 && (t.onItemExpansionToggle && c.forEach((d) => {
|
|
544
|
+
t.onItemExpansionToggle(s, d, !0);
|
|
545
|
+
}), l(s, i));
|
|
546
|
+
}, o = E.useMemo(() => t.expansionTrigger ? t.expansionTrigger : e.isTreeViewEditable ? "iconContainer" : "content", [t.expansionTrigger, e.isTreeViewEditable]);
|
|
572
547
|
return {
|
|
573
548
|
publicAPI: {
|
|
574
|
-
setItemExpansion:
|
|
549
|
+
setItemExpansion: m
|
|
575
550
|
},
|
|
576
551
|
instance: {
|
|
577
|
-
isItemExpanded:
|
|
578
|
-
isItemExpandable:
|
|
579
|
-
setItemExpansion:
|
|
580
|
-
toggleItemExpansion:
|
|
581
|
-
expandAllSiblings:
|
|
552
|
+
isItemExpanded: h,
|
|
553
|
+
isItemExpandable: g,
|
|
554
|
+
setItemExpansion: m,
|
|
555
|
+
toggleItemExpansion: p,
|
|
556
|
+
expandAllSiblings: f
|
|
582
557
|
},
|
|
583
558
|
contextValue: {
|
|
584
559
|
expansion: {
|
|
585
|
-
expansionTrigger:
|
|
560
|
+
expansionTrigger: o
|
|
586
561
|
}
|
|
587
562
|
}
|
|
588
563
|
};
|
|
589
564
|
};
|
|
590
|
-
|
|
565
|
+
le.models = {
|
|
591
566
|
expandedItems: {
|
|
592
567
|
getDefaultValue: (e) => e.defaultExpandedItems
|
|
593
568
|
}
|
|
594
569
|
};
|
|
595
|
-
const
|
|
596
|
-
|
|
570
|
+
const fn = [];
|
|
571
|
+
le.getDefaultizedParams = ({
|
|
597
572
|
params: e
|
|
598
573
|
}) => C({}, e, {
|
|
599
|
-
defaultExpandedItems: e.defaultExpandedItems ??
|
|
574
|
+
defaultExpandedItems: e.defaultExpandedItems ?? fn
|
|
600
575
|
});
|
|
601
|
-
|
|
576
|
+
le.params = {
|
|
602
577
|
expandedItems: !0,
|
|
603
578
|
defaultExpandedItems: !0,
|
|
604
579
|
onExpandedItemsChange: !0,
|
|
605
580
|
onItemExpansionToggle: !0,
|
|
606
581
|
expansionTrigger: !0
|
|
607
582
|
};
|
|
608
|
-
const
|
|
609
|
-
let n = t.length - 1;
|
|
610
|
-
for (; n >= 0 && !e.isItemNavigable(t[n]); )
|
|
611
|
-
n -= 1;
|
|
612
|
-
if (n !== -1)
|
|
613
|
-
return t[n];
|
|
614
|
-
}, mt = (e, t) => {
|
|
615
|
-
const n = e.getItemMeta(t), o = e.getItemOrderedChildrenIds(n.parentId), i = e.getItemIndex(t);
|
|
616
|
-
if (i === 0)
|
|
617
|
-
return n.parentId;
|
|
618
|
-
let g = i - 1;
|
|
619
|
-
for (; !e.isItemNavigable(o[g]) && g >= 0; )
|
|
620
|
-
g -= 1;
|
|
621
|
-
if (g === -1)
|
|
622
|
-
return n.parentId == null ? null : mt(e, n.parentId);
|
|
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
|
-
return m;
|
|
627
|
-
}, we = (e, t) => {
|
|
628
|
-
if (e.isItemExpanded(t)) {
|
|
629
|
-
const o = e.getItemOrderedChildrenIds(t).find(e.isItemNavigable);
|
|
630
|
-
if (o != null)
|
|
631
|
-
return o;
|
|
632
|
-
}
|
|
633
|
-
let n = e.getItemMeta(t);
|
|
634
|
-
for (; n != null; ) {
|
|
635
|
-
const o = e.getItemOrderedChildrenIds(n.parentId), i = e.getItemIndex(n.id);
|
|
636
|
-
if (i < o.length - 1) {
|
|
637
|
-
let g = i + 1;
|
|
638
|
-
for (; !e.isItemNavigable(o[g]) && g < o.length - 1; )
|
|
639
|
-
g += 1;
|
|
640
|
-
if (e.isItemNavigable(o[g]))
|
|
641
|
-
return o[g];
|
|
642
|
-
}
|
|
643
|
-
n = e.getItemMeta(n.parentId);
|
|
644
|
-
}
|
|
645
|
-
return null;
|
|
646
|
-
}, It = (e) => {
|
|
647
|
-
let t = null;
|
|
648
|
-
for (; t == null || e.isItemExpanded(t); ) {
|
|
649
|
-
const n = e.getItemOrderedChildrenIds(t), o = ft(e, n);
|
|
650
|
-
if (o == null)
|
|
651
|
-
return t;
|
|
652
|
-
t = o;
|
|
653
|
-
}
|
|
654
|
-
return t;
|
|
655
|
-
}, ge = (e) => e.getItemOrderedChildrenIds(null).find(e.isItemNavigable), gt = (e, t, n) => {
|
|
656
|
-
if (t === n)
|
|
657
|
-
return [t, n];
|
|
658
|
-
const o = e.getItemMeta(t), i = e.getItemMeta(n);
|
|
659
|
-
if (o.parentId === i.id || i.parentId === o.id)
|
|
660
|
-
return i.parentId === o.id ? [o.id, i.id] : [i.id, o.id];
|
|
661
|
-
const g = [o.id], m = [i.id];
|
|
662
|
-
let a = o.parentId, u = i.parentId, c = m.indexOf(a) !== -1, r = g.indexOf(u) !== -1, s = !0, f = !0;
|
|
663
|
-
for (; !r && !c; )
|
|
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
|
-
for (; c != null; ) {
|
|
673
|
-
const r = e.getItemOrderedChildrenIds(c.parentId), s = e.getItemIndex(c.id);
|
|
674
|
-
if (s < r.length - 1)
|
|
675
|
-
return r[s + 1];
|
|
676
|
-
c = e.getItemMeta(c.parentId);
|
|
677
|
-
}
|
|
678
|
-
throw new Error("Invalid range");
|
|
679
|
-
}, [i, g] = gt(e, t, n), m = [i];
|
|
680
|
-
let a = i;
|
|
681
|
-
for (; a !== g; )
|
|
682
|
-
a = o(a), e.isItemDisabled(a) || m.push(a);
|
|
683
|
-
return m;
|
|
684
|
-
}, vn = (e) => {
|
|
685
|
-
let t = ge(e);
|
|
686
|
-
const n = [];
|
|
687
|
-
for (; t != null; )
|
|
688
|
-
n.push(t), t = we(e, t);
|
|
689
|
-
return n;
|
|
690
|
-
}, be = (e, t) => t !== e.closest('*[role="treeitem"]'), Re = (e) => Array.isArray(e) ? e : e != null ? [e] : [], Fe = (e) => {
|
|
583
|
+
const re = (e) => Array.isArray(e) ? e : e != null ? [e] : [], be = (e) => {
|
|
691
584
|
const t = {};
|
|
692
585
|
return e.forEach((n) => {
|
|
693
586
|
t[n] = !0;
|
|
694
587
|
}), t;
|
|
695
|
-
},
|
|
588
|
+
}, ae = ({
|
|
696
589
|
instance: e,
|
|
697
590
|
params: t,
|
|
698
591
|
models: n
|
|
699
592
|
}) => {
|
|
700
|
-
const
|
|
701
|
-
const
|
|
702
|
-
return Array.isArray(n.selectedItems.value) ? n.selectedItems.value.forEach((
|
|
703
|
-
|
|
704
|
-
}) : n.selectedItems.value != null &&
|
|
705
|
-
}, [n.selectedItems.value]),
|
|
593
|
+
const r = E.useRef(null), l = E.useRef({}), h = E.useMemo(() => {
|
|
594
|
+
const c = /* @__PURE__ */ new Map();
|
|
595
|
+
return Array.isArray(n.selectedItems.value) ? n.selectedItems.value.forEach((i) => {
|
|
596
|
+
c.set(i, !0);
|
|
597
|
+
}) : n.selectedItems.value != null && c.set(n.selectedItems.value, !0), c;
|
|
598
|
+
}, [n.selectedItems.value]), g = (c, i) => {
|
|
706
599
|
if (t.onItemSelectionToggle)
|
|
707
600
|
if (t.multiSelect) {
|
|
708
|
-
const
|
|
709
|
-
|
|
710
|
-
t.onItemSelectionToggle(
|
|
711
|
-
}),
|
|
712
|
-
t.onItemSelectionToggle(
|
|
601
|
+
const d = i.filter((T) => !e.isItemSelected(T)), I = n.selectedItems.value.filter((T) => !i.includes(T));
|
|
602
|
+
d.forEach((T) => {
|
|
603
|
+
t.onItemSelectionToggle(c, T, !0);
|
|
604
|
+
}), I.forEach((T) => {
|
|
605
|
+
t.onItemSelectionToggle(c, T, !1);
|
|
713
606
|
});
|
|
714
|
-
} else
|
|
715
|
-
t.onSelectedItemsChange && t.onSelectedItemsChange(
|
|
716
|
-
},
|
|
717
|
-
event:
|
|
718
|
-
itemId:
|
|
719
|
-
keepExistingSelection:
|
|
720
|
-
shouldBeSelected:
|
|
607
|
+
} else i !== n.selectedItems.value && (n.selectedItems.value != null && t.onItemSelectionToggle(c, n.selectedItems.value, !1), i != null && t.onItemSelectionToggle(c, i, !0));
|
|
608
|
+
t.onSelectedItemsChange && t.onSelectedItemsChange(c, i), n.selectedItems.setControlledValue(i);
|
|
609
|
+
}, p = (c) => h.has(c), m = ({
|
|
610
|
+
event: c,
|
|
611
|
+
itemId: i,
|
|
612
|
+
keepExistingSelection: d = !1,
|
|
613
|
+
shouldBeSelected: I
|
|
721
614
|
}) => {
|
|
722
615
|
if (t.disableSelection)
|
|
723
616
|
return;
|
|
724
|
-
let
|
|
725
|
-
if (
|
|
726
|
-
const
|
|
727
|
-
|
|
617
|
+
let T;
|
|
618
|
+
if (d) {
|
|
619
|
+
const P = re(n.selectedItems.value), y = e.isItemSelected(i);
|
|
620
|
+
y && (I === !1 || I == null) ? T = P.filter((R) => R !== i) : !y && (I === !0 || I == null) ? T = [i].concat(P) : T = P;
|
|
728
621
|
} else
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
},
|
|
622
|
+
I === !1 || I == null && e.isItemSelected(i) ? T = t.multiSelect ? [] : null : T = t.multiSelect ? [i] : i;
|
|
623
|
+
g(c, T), r.current = i, l.current = {};
|
|
624
|
+
}, f = (c, [i, d]) => {
|
|
732
625
|
if (t.disableSelection || !t.multiSelect)
|
|
733
626
|
return;
|
|
734
|
-
let
|
|
735
|
-
Object.keys(
|
|
736
|
-
const
|
|
737
|
-
|
|
627
|
+
let I = re(n.selectedItems.value).slice();
|
|
628
|
+
Object.keys(l.current).length > 0 && (I = I.filter((R) => !l.current[R]));
|
|
629
|
+
const T = be(I), P = At(e, i, d), y = P.filter((R) => !T[R]);
|
|
630
|
+
I = I.concat(y), g(c, I), l.current = be(P);
|
|
738
631
|
};
|
|
739
632
|
return {
|
|
740
633
|
getRootProps: () => ({
|
|
741
634
|
"aria-multiselectable": t.multiSelect
|
|
742
635
|
}),
|
|
743
636
|
publicAPI: {
|
|
744
|
-
selectItem:
|
|
637
|
+
selectItem: m
|
|
745
638
|
},
|
|
746
639
|
instance: {
|
|
747
|
-
isItemSelected:
|
|
748
|
-
selectItem:
|
|
749
|
-
selectAllNavigableItems: (
|
|
640
|
+
isItemSelected: p,
|
|
641
|
+
selectItem: m,
|
|
642
|
+
selectAllNavigableItems: (c) => {
|
|
750
643
|
if (t.disableSelection || !t.multiSelect)
|
|
751
644
|
return;
|
|
752
|
-
const
|
|
753
|
-
|
|
645
|
+
const i = Vt(e);
|
|
646
|
+
g(c, i), l.current = be(i);
|
|
754
647
|
},
|
|
755
|
-
expandSelectionRange: (
|
|
756
|
-
if (
|
|
757
|
-
const [
|
|
758
|
-
c
|
|
648
|
+
expandSelectionRange: (c, i) => {
|
|
649
|
+
if (r.current != null) {
|
|
650
|
+
const [d, I] = Ot(e, i, r.current);
|
|
651
|
+
f(c, [d, I]);
|
|
759
652
|
}
|
|
760
653
|
},
|
|
761
|
-
selectRangeFromStartToItem: (
|
|
762
|
-
c
|
|
654
|
+
selectRangeFromStartToItem: (c, i) => {
|
|
655
|
+
f(c, [se(e), i]);
|
|
763
656
|
},
|
|
764
|
-
selectRangeFromItemToEnd: (
|
|
765
|
-
c
|
|
657
|
+
selectRangeFromItemToEnd: (c, i) => {
|
|
658
|
+
f(c, [i, Ne(e)]);
|
|
766
659
|
},
|
|
767
|
-
selectItemFromArrowNavigation: (
|
|
660
|
+
selectItemFromArrowNavigation: (c, i, d) => {
|
|
768
661
|
if (t.disableSelection || !t.multiSelect)
|
|
769
662
|
return;
|
|
770
|
-
let
|
|
771
|
-
Object.keys(
|
|
772
|
-
[
|
|
773
|
-
[
|
|
774
|
-
}) : (
|
|
663
|
+
let I = re(n.selectedItems.value).slice();
|
|
664
|
+
Object.keys(l.current).length === 0 ? (I.push(d), l.current = {
|
|
665
|
+
[i]: !0,
|
|
666
|
+
[d]: !0
|
|
667
|
+
}) : (l.current[i] || (l.current = {}), l.current[d] ? (I = I.filter((T) => T !== i), delete l.current[i]) : (I.push(d), l.current[d] = !0)), g(c, I);
|
|
775
668
|
}
|
|
776
669
|
},
|
|
777
670
|
contextValue: {
|
|
@@ -783,21 +676,21 @@ const ft = (e, t) => {
|
|
|
783
676
|
}
|
|
784
677
|
};
|
|
785
678
|
};
|
|
786
|
-
|
|
679
|
+
ae.models = {
|
|
787
680
|
selectedItems: {
|
|
788
681
|
getDefaultValue: (e) => e.defaultSelectedItems
|
|
789
682
|
}
|
|
790
683
|
};
|
|
791
|
-
const
|
|
792
|
-
|
|
684
|
+
const pn = [];
|
|
685
|
+
ae.getDefaultizedParams = ({
|
|
793
686
|
params: e
|
|
794
687
|
}) => C({}, e, {
|
|
795
688
|
disableSelection: e.disableSelection ?? !1,
|
|
796
689
|
multiSelect: e.multiSelect ?? !1,
|
|
797
690
|
checkboxSelection: e.checkboxSelection ?? !1,
|
|
798
|
-
defaultSelectedItems: e.defaultSelectedItems ?? (e.multiSelect ?
|
|
691
|
+
defaultSelectedItems: e.defaultSelectedItems ?? (e.multiSelect ? pn : null)
|
|
799
692
|
});
|
|
800
|
-
|
|
693
|
+
ae.params = {
|
|
801
694
|
disableSelection: !0,
|
|
802
695
|
multiSelect: !0,
|
|
803
696
|
checkboxSelection: !0,
|
|
@@ -806,17 +699,17 @@ Me.params = {
|
|
|
806
699
|
onSelectedItemsChange: !0,
|
|
807
700
|
onItemSelectionToggle: !0
|
|
808
701
|
};
|
|
809
|
-
const
|
|
810
|
-
class
|
|
811
|
-
constructor(t =
|
|
812
|
-
this.timeouts = /* @__PURE__ */ new Map(), this.cleanupTimeout =
|
|
702
|
+
const Le = 1e3;
|
|
703
|
+
class mn {
|
|
704
|
+
constructor(t = Le) {
|
|
705
|
+
this.timeouts = /* @__PURE__ */ new Map(), this.cleanupTimeout = Le, this.cleanupTimeout = t;
|
|
813
706
|
}
|
|
814
|
-
register(t, n,
|
|
707
|
+
register(t, n, r) {
|
|
815
708
|
this.timeouts || (this.timeouts = /* @__PURE__ */ new Map());
|
|
816
|
-
const
|
|
817
|
-
typeof n == "function" && n(), this.timeouts.delete(
|
|
709
|
+
const l = setTimeout(() => {
|
|
710
|
+
typeof n == "function" && n(), this.timeouts.delete(r.cleanupToken);
|
|
818
711
|
}, this.cleanupTimeout);
|
|
819
|
-
this.timeouts.set(
|
|
712
|
+
this.timeouts.set(r.cleanupToken, l);
|
|
820
713
|
}
|
|
821
714
|
unregister(t) {
|
|
822
715
|
const n = this.timeouts.get(t.cleanupToken);
|
|
@@ -830,14 +723,14 @@ class Sn {
|
|
|
830
723
|
}), this.timeouts = void 0);
|
|
831
724
|
}
|
|
832
725
|
}
|
|
833
|
-
class
|
|
726
|
+
class In {
|
|
834
727
|
constructor() {
|
|
835
728
|
this.registry = new FinalizationRegistry((t) => {
|
|
836
729
|
typeof t == "function" && t();
|
|
837
730
|
});
|
|
838
731
|
}
|
|
839
|
-
register(t, n,
|
|
840
|
-
this.registry.register(t, n,
|
|
732
|
+
register(t, n, r) {
|
|
733
|
+
this.registry.register(t, n, r);
|
|
841
734
|
}
|
|
842
735
|
unregister(t) {
|
|
843
736
|
this.registry.unregister(t);
|
|
@@ -846,264 +739,162 @@ class Mn {
|
|
|
846
739
|
reset() {
|
|
847
740
|
}
|
|
848
741
|
}
|
|
849
|
-
class
|
|
742
|
+
class gn {
|
|
850
743
|
}
|
|
851
|
-
function
|
|
744
|
+
function bn(e) {
|
|
852
745
|
let t = 0;
|
|
853
|
-
return function(
|
|
854
|
-
e.registry === null && (e.registry = typeof FinalizationRegistry < "u" ? new
|
|
855
|
-
const [
|
|
856
|
-
|
|
857
|
-
const
|
|
858
|
-
if (!
|
|
859
|
-
const
|
|
860
|
-
var
|
|
861
|
-
|
|
746
|
+
return function(r, l, h) {
|
|
747
|
+
e.registry === null && (e.registry = typeof FinalizationRegistry < "u" ? new In() : new mn());
|
|
748
|
+
const [g] = E.useState(new gn()), p = E.useRef(null), m = E.useRef(void 0);
|
|
749
|
+
m.current = h;
|
|
750
|
+
const f = E.useRef(null);
|
|
751
|
+
if (!p.current && m.current) {
|
|
752
|
+
const o = (s, u) => {
|
|
753
|
+
var b;
|
|
754
|
+
u.defaultMuiPrevented || (b = m.current) == null || b.call(m, s, u);
|
|
862
755
|
};
|
|
863
|
-
|
|
756
|
+
p.current = r.$$subscribeEvent(l, o), t += 1, f.current = {
|
|
864
757
|
cleanupToken: t
|
|
865
758
|
}, e.registry.register(
|
|
866
|
-
|
|
759
|
+
g,
|
|
867
760
|
// The callback below will be called once this reference stops being retained
|
|
868
761
|
() => {
|
|
869
762
|
var s;
|
|
870
|
-
(s =
|
|
763
|
+
(s = p.current) == null || s.call(p), p.current = null, f.current = null;
|
|
871
764
|
},
|
|
872
|
-
|
|
765
|
+
f.current
|
|
873
766
|
);
|
|
874
|
-
} else !
|
|
875
|
-
|
|
876
|
-
if (!
|
|
877
|
-
const
|
|
878
|
-
var
|
|
879
|
-
|
|
767
|
+
} else !m.current && p.current && (p.current(), p.current = null, f.current && (e.registry.unregister(f.current), f.current = null));
|
|
768
|
+
E.useEffect(() => {
|
|
769
|
+
if (!p.current && m.current) {
|
|
770
|
+
const o = (s, u) => {
|
|
771
|
+
var b;
|
|
772
|
+
u.defaultMuiPrevented || (b = m.current) == null || b.call(m, s, u);
|
|
880
773
|
};
|
|
881
|
-
|
|
774
|
+
p.current = r.$$subscribeEvent(l, o);
|
|
882
775
|
}
|
|
883
|
-
return
|
|
884
|
-
var
|
|
885
|
-
(
|
|
776
|
+
return f.current && e.registry && (e.registry.unregister(f.current), f.current = null), () => {
|
|
777
|
+
var o;
|
|
778
|
+
(o = p.current) == null || o.call(p), p.current = null;
|
|
886
779
|
};
|
|
887
|
-
}, [
|
|
780
|
+
}, [r, l]);
|
|
888
781
|
};
|
|
889
782
|
}
|
|
890
|
-
const
|
|
783
|
+
const hn = {
|
|
891
784
|
registry: null
|
|
892
|
-
},
|
|
785
|
+
}, xn = bn(hn), Ge = (e = document) => {
|
|
893
786
|
const t = e.activeElement;
|
|
894
|
-
return t ? t.shadowRoot ?
|
|
895
|
-
},
|
|
896
|
-
let n =
|
|
897
|
-
if (!e.isItemNavigable(
|
|
787
|
+
return t ? t.shadowRoot ? Ge(t.shadowRoot) : t : null;
|
|
788
|
+
}, En = (e, t) => {
|
|
789
|
+
let n = re(t).find((r) => {
|
|
790
|
+
if (!e.isItemNavigable(r))
|
|
898
791
|
return !1;
|
|
899
|
-
const
|
|
900
|
-
return
|
|
792
|
+
const l = e.getItemMeta(r);
|
|
793
|
+
return l && (l.parentId == null || e.isItemExpanded(l.parentId));
|
|
901
794
|
});
|
|
902
|
-
return n == null && (n =
|
|
903
|
-
},
|
|
795
|
+
return n == null && (n = se(e)), n;
|
|
796
|
+
}, ye = ({
|
|
904
797
|
instance: e,
|
|
905
798
|
params: t,
|
|
906
799
|
state: n,
|
|
907
|
-
setState:
|
|
908
|
-
models:
|
|
909
|
-
rootRef:
|
|
800
|
+
setState: r,
|
|
801
|
+
models: l,
|
|
802
|
+
rootRef: h
|
|
910
803
|
}) => {
|
|
911
|
-
const
|
|
912
|
-
const
|
|
913
|
-
n.focusedItemId !==
|
|
914
|
-
focusedItemId:
|
|
804
|
+
const g = En(e, l.selectedItems.value), p = U((i) => {
|
|
805
|
+
const d = typeof i == "function" ? i(n.focusedItemId) : i;
|
|
806
|
+
n.focusedItemId !== d && r((I) => C({}, I, {
|
|
807
|
+
focusedItemId: d
|
|
915
808
|
}));
|
|
916
|
-
}),
|
|
917
|
-
const
|
|
918
|
-
return
|
|
919
|
-
}, s = (
|
|
920
|
-
const
|
|
921
|
-
|
|
922
|
-
},
|
|
923
|
-
|
|
924
|
-
}),
|
|
809
|
+
}), m = E.useCallback(() => !!h.current && h.current.contains(Ge(qt(h.current))), [h]), f = E.useCallback((i) => n.focusedItemId === i && m(), [n.focusedItemId, m]), o = (i) => {
|
|
810
|
+
const d = e.getItemMeta(i);
|
|
811
|
+
return d && (d.parentId == null || e.isItemExpanded(d.parentId));
|
|
812
|
+
}, s = (i, d) => {
|
|
813
|
+
const I = e.getItemDOMElement(d);
|
|
814
|
+
I && I.focus(), p(d), t.onItemFocus && t.onItemFocus(i, d);
|
|
815
|
+
}, u = U((i, d) => {
|
|
816
|
+
o(d) && s(i, d);
|
|
817
|
+
}), b = U(() => {
|
|
925
818
|
if (n.focusedItemId == null)
|
|
926
819
|
return;
|
|
927
820
|
if (e.getItemMeta(n.focusedItemId)) {
|
|
928
|
-
const
|
|
929
|
-
|
|
821
|
+
const d = e.getItemDOMElement(n.focusedItemId);
|
|
822
|
+
d && d.blur();
|
|
930
823
|
}
|
|
931
|
-
|
|
932
|
-
}),
|
|
933
|
-
|
|
934
|
-
id:
|
|
824
|
+
p(null);
|
|
825
|
+
}), x = (i) => i === g;
|
|
826
|
+
xn(e, "removeItem", ({
|
|
827
|
+
id: i
|
|
935
828
|
}) => {
|
|
936
|
-
n.focusedItemId ===
|
|
829
|
+
n.focusedItemId === i && s(null, g);
|
|
937
830
|
});
|
|
938
|
-
const
|
|
939
|
-
var
|
|
940
|
-
(
|
|
831
|
+
const c = (i) => (d) => {
|
|
832
|
+
var I;
|
|
833
|
+
(I = i.onFocus) == null || I.call(i, d), !d.defaultMuiPrevented && d.target === d.currentTarget && s(d, g);
|
|
941
834
|
};
|
|
942
835
|
return {
|
|
943
|
-
getRootProps: (
|
|
944
|
-
onFocus:
|
|
836
|
+
getRootProps: (i) => ({
|
|
837
|
+
onFocus: c(i)
|
|
945
838
|
}),
|
|
946
839
|
publicAPI: {
|
|
947
|
-
focusItem:
|
|
840
|
+
focusItem: u
|
|
948
841
|
},
|
|
949
842
|
instance: {
|
|
950
|
-
isItemFocused:
|
|
951
|
-
canItemBeTabbed:
|
|
952
|
-
focusItem:
|
|
953
|
-
removeFocusedItem:
|
|
843
|
+
isItemFocused: f,
|
|
844
|
+
canItemBeTabbed: x,
|
|
845
|
+
focusItem: u,
|
|
846
|
+
removeFocusedItem: b
|
|
954
847
|
}
|
|
955
848
|
};
|
|
956
849
|
};
|
|
957
|
-
|
|
850
|
+
ye.getInitialState = () => ({
|
|
958
851
|
focusedItemId: null
|
|
959
852
|
});
|
|
960
|
-
|
|
853
|
+
ye.params = {
|
|
961
854
|
onItemFocus: !0
|
|
962
855
|
};
|
|
963
|
-
|
|
964
|
-
props: e
|
|
965
|
-
}) => {
|
|
966
|
-
const {
|
|
967
|
-
instance: t
|
|
968
|
-
} = ie(), {
|
|
969
|
-
label: n,
|
|
970
|
-
itemId: o
|
|
971
|
-
} = e, [i, g] = w.useState(n), m = t.isItemBeingEdited(o);
|
|
972
|
-
return w.useEffect(() => {
|
|
973
|
-
m || g(n);
|
|
974
|
-
}, [m, n]), {
|
|
975
|
-
propsEnhancers: {
|
|
976
|
-
labelInput: ({
|
|
977
|
-
externalEventHandlers: a,
|
|
978
|
-
interactions: u
|
|
979
|
-
}) => t.isItemEditable(o) ? {
|
|
980
|
-
value: i ?? "",
|
|
981
|
-
"data-element": "labelInput",
|
|
982
|
-
onChange: (l) => {
|
|
983
|
-
var h;
|
|
984
|
-
(h = a.onChange) == null || h.call(a, l), g(l.target.value);
|
|
985
|
-
},
|
|
986
|
-
onKeyDown: (l) => {
|
|
987
|
-
var I;
|
|
988
|
-
if ((I = a.onKeyDown) == null || I.call(a, l), l.defaultMuiPrevented)
|
|
989
|
-
return;
|
|
990
|
-
const h = l.target;
|
|
991
|
-
l.key === "Enter" && h.value ? u.handleSaveItemLabel(l, h.value) : l.key === "Escape" && u.handleCancelItemLabelEditing(l);
|
|
992
|
-
},
|
|
993
|
-
onBlur: (l) => {
|
|
994
|
-
var h;
|
|
995
|
-
(h = a.onBlur) == null || h.call(a, l), !l.defaultMuiPrevented && l.target.value && u.handleSaveItemLabel(l, l.target.value);
|
|
996
|
-
},
|
|
997
|
-
autoFocus: !0,
|
|
998
|
-
type: "text"
|
|
999
|
-
} : {}
|
|
1000
|
-
}
|
|
1001
|
-
};
|
|
1002
|
-
}, K = ({
|
|
1003
|
-
instance: e,
|
|
1004
|
-
state: t,
|
|
1005
|
-
setState: n,
|
|
1006
|
-
params: o
|
|
1007
|
-
}) => {
|
|
1008
|
-
const i = w.useRef(t.editedItemId), g = (s) => i.current === s, m = (s) => {
|
|
1009
|
-
n((f) => C({}, f, {
|
|
1010
|
-
editedItemId: s
|
|
1011
|
-
})), i.current = s;
|
|
1012
|
-
}, a = (s) => s === t.editedItemId, u = !!o.isItemEditable, c = (s) => {
|
|
1013
|
-
if (s == null || !u)
|
|
1014
|
-
return !1;
|
|
1015
|
-
const f = e.getItem(s);
|
|
1016
|
-
return f ? typeof o.isItemEditable == "function" ? o.isItemEditable(f) : !!o.isItemEditable : !1;
|
|
1017
|
-
}, r = (s, f) => {
|
|
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.", s].join(`
|
|
1020
|
-
`));
|
|
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
|
-
label: f
|
|
1028
|
-
})
|
|
1029
|
-
})
|
|
1030
|
-
})
|
|
1031
|
-
}) : l;
|
|
1032
|
-
}), o.onItemLabelChange && o.onItemLabelChange(s, f);
|
|
1033
|
-
};
|
|
1034
|
-
return {
|
|
1035
|
-
instance: {
|
|
1036
|
-
setEditedItemId: m,
|
|
1037
|
-
isItemBeingEdited: a,
|
|
1038
|
-
updateItemLabel: r,
|
|
1039
|
-
isItemEditable: c,
|
|
1040
|
-
isTreeViewEditable: u,
|
|
1041
|
-
isItemBeingEditedRef: g
|
|
1042
|
-
},
|
|
1043
|
-
publicAPI: {
|
|
1044
|
-
updateItemLabel: r
|
|
1045
|
-
}
|
|
1046
|
-
};
|
|
1047
|
-
};
|
|
1048
|
-
K.itemPlugin = Vn;
|
|
1049
|
-
K.getDefaultizedParams = ({
|
|
1050
|
-
params: e,
|
|
1051
|
-
experimentalFeatures: t
|
|
1052
|
-
}) => {
|
|
1053
|
-
const n = t == null ? void 0 : t.labelEditing;
|
|
1054
|
-
return process.env.NODE_ENV !== "production" && e.isItemEditable && !n && ve(["MUI X: The label editing feature requires the `labelEditing` experimental feature to be enabled.", "You can do it by passing `experimentalFeatures={{ labelEditing: true}}` to the Rich Tree View Pro component.", "Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/editing/"]), C({}, e, {
|
|
1055
|
-
isItemEditable: n ? e.isItemEditable ?? !1 : !1
|
|
1056
|
-
});
|
|
1057
|
-
};
|
|
1058
|
-
K.getInitialState = () => ({
|
|
1059
|
-
editedItemId: null
|
|
1060
|
-
});
|
|
1061
|
-
K.params = {
|
|
1062
|
-
onItemLabelChange: !0,
|
|
1063
|
-
isItemEditable: !0
|
|
1064
|
-
};
|
|
1065
|
-
function Fn(e) {
|
|
856
|
+
function Tn(e) {
|
|
1066
857
|
return !!e && e.length === 1 && !!e.match(/\S/);
|
|
1067
858
|
}
|
|
1068
|
-
const
|
|
859
|
+
const Je = ({
|
|
1069
860
|
instance: e,
|
|
1070
861
|
params: t,
|
|
1071
862
|
state: n
|
|
1072
863
|
}) => {
|
|
1073
|
-
const
|
|
1074
|
-
|
|
864
|
+
const r = Ht(), l = E.useRef({}), h = U((o) => {
|
|
865
|
+
l.current = o(l.current);
|
|
1075
866
|
});
|
|
1076
|
-
|
|
867
|
+
E.useEffect(() => {
|
|
1077
868
|
if (e.areItemUpdatesPrevented())
|
|
1078
869
|
return;
|
|
1079
|
-
const
|
|
1080
|
-
|
|
870
|
+
const o = {}, s = (u) => {
|
|
871
|
+
o[u.id] = u.label.substring(0, 1).toLowerCase();
|
|
1081
872
|
};
|
|
1082
|
-
Object.values(n.items.itemMetaMap).forEach(s),
|
|
873
|
+
Object.values(n.items.itemMetaMap).forEach(s), l.current = o;
|
|
1083
874
|
}, [n.items.itemMetaMap, t.getItemId, e]);
|
|
1084
|
-
const
|
|
1085
|
-
const
|
|
1086
|
-
const
|
|
1087
|
-
return
|
|
875
|
+
const g = (o, s) => {
|
|
876
|
+
const u = s.toLowerCase(), b = (d) => {
|
|
877
|
+
const I = ge(e, d);
|
|
878
|
+
return I === null ? se(e) : I;
|
|
1088
879
|
};
|
|
1089
|
-
let
|
|
1090
|
-
const
|
|
1091
|
-
for (;
|
|
1092
|
-
|
|
1093
|
-
return
|
|
1094
|
-
},
|
|
880
|
+
let x = null, c = b(o);
|
|
881
|
+
const i = {};
|
|
882
|
+
for (; x == null && !i[c]; )
|
|
883
|
+
l.current[c] === u ? x = c : (i[c] = !0, c = b(c));
|
|
884
|
+
return x;
|
|
885
|
+
}, p = (o) => !t.disableSelection && !e.isItemDisabled(o), m = (o) => !e.isItemDisabled(o) && e.isItemExpandable(o);
|
|
1095
886
|
return {
|
|
1096
887
|
instance: {
|
|
1097
|
-
updateFirstCharMap:
|
|
1098
|
-
handleItemKeyDown: (
|
|
1099
|
-
if (
|
|
888
|
+
updateFirstCharMap: h,
|
|
889
|
+
handleItemKeyDown: (o, s) => {
|
|
890
|
+
if (o.defaultMuiPrevented || o.altKey || he(o.target, o.currentTarget))
|
|
1100
891
|
return;
|
|
1101
|
-
const
|
|
892
|
+
const u = o.ctrlKey || o.metaKey, b = o.key;
|
|
1102
893
|
switch (!0) {
|
|
1103
894
|
// Select the item when pressing "Space"
|
|
1104
|
-
case (
|
|
1105
|
-
|
|
1106
|
-
event:
|
|
895
|
+
case (b === " " && p(s)): {
|
|
896
|
+
o.preventDefault(), t.multiSelect && o.shiftKey ? e.expandSelectionRange(o, s) : e.selectItem({
|
|
897
|
+
event: o,
|
|
1107
898
|
itemId: s,
|
|
1108
899
|
keepExistingSelection: t.multiSelect,
|
|
1109
900
|
shouldBeSelected: t.multiSelect ? void 0 : !0
|
|
@@ -1112,79 +903,79 @@ const ht = ({
|
|
|
1112
903
|
}
|
|
1113
904
|
// If the focused item has children, we expand it.
|
|
1114
905
|
// If the focused item has no children, we select it.
|
|
1115
|
-
case
|
|
1116
|
-
|
|
1117
|
-
event:
|
|
906
|
+
case b === "Enter": {
|
|
907
|
+
oe(e, H) && e.isItemEditable(s) && !e.isItemBeingEdited(s) ? e.setEditedItemId(s) : m(s) ? (e.toggleItemExpansion(o, s), o.preventDefault()) : p(s) && (t.multiSelect ? (o.preventDefault(), e.selectItem({
|
|
908
|
+
event: o,
|
|
1118
909
|
itemId: s,
|
|
1119
910
|
keepExistingSelection: !0
|
|
1120
911
|
})) : e.isItemSelected(s) || (e.selectItem({
|
|
1121
|
-
event:
|
|
912
|
+
event: o,
|
|
1122
913
|
itemId: s
|
|
1123
|
-
}),
|
|
914
|
+
}), o.preventDefault()));
|
|
1124
915
|
break;
|
|
1125
916
|
}
|
|
1126
917
|
// Focus the next focusable item
|
|
1127
|
-
case
|
|
1128
|
-
const
|
|
1129
|
-
|
|
918
|
+
case b === "ArrowDown": {
|
|
919
|
+
const x = ge(e, s);
|
|
920
|
+
x && (o.preventDefault(), e.focusItem(o, x), t.multiSelect && o.shiftKey && p(x) && e.selectItemFromArrowNavigation(o, s, x));
|
|
1130
921
|
break;
|
|
1131
922
|
}
|
|
1132
923
|
// Focuses the previous focusable item
|
|
1133
|
-
case
|
|
1134
|
-
const
|
|
1135
|
-
|
|
924
|
+
case b === "ArrowUp": {
|
|
925
|
+
const x = Ft(e, s);
|
|
926
|
+
x && (o.preventDefault(), e.focusItem(o, x), t.multiSelect && o.shiftKey && p(x) && e.selectItemFromArrowNavigation(o, s, x));
|
|
1136
927
|
break;
|
|
1137
928
|
}
|
|
1138
929
|
// If the focused item is expanded, we move the focus to its first child
|
|
1139
930
|
// If the focused item is collapsed and has children, we expand it
|
|
1140
|
-
case (
|
|
1141
|
-
if (
|
|
931
|
+
case (b === "ArrowRight" && !r || b === "ArrowLeft" && r): {
|
|
932
|
+
if (u)
|
|
1142
933
|
return;
|
|
1143
934
|
if (e.isItemExpanded(s)) {
|
|
1144
|
-
const
|
|
1145
|
-
|
|
1146
|
-
} else
|
|
935
|
+
const x = ge(e, s);
|
|
936
|
+
x && (e.focusItem(o, x), o.preventDefault());
|
|
937
|
+
} else m(s) && (e.toggleItemExpansion(o, s), o.preventDefault());
|
|
1147
938
|
break;
|
|
1148
939
|
}
|
|
1149
940
|
// If the focused item is expanded, we collapse it
|
|
1150
941
|
// If the focused item is collapsed and has a parent, we move the focus to this parent
|
|
1151
|
-
case (
|
|
1152
|
-
if (
|
|
942
|
+
case (b === "ArrowLeft" && !r || b === "ArrowRight" && r): {
|
|
943
|
+
if (u)
|
|
1153
944
|
return;
|
|
1154
|
-
if (
|
|
1155
|
-
e.toggleItemExpansion(
|
|
945
|
+
if (m(s) && e.isItemExpanded(s))
|
|
946
|
+
e.toggleItemExpansion(o, s), o.preventDefault();
|
|
1156
947
|
else {
|
|
1157
|
-
const
|
|
1158
|
-
|
|
948
|
+
const x = e.getItemMeta(s).parentId;
|
|
949
|
+
x && (e.focusItem(o, x), o.preventDefault());
|
|
1159
950
|
}
|
|
1160
951
|
break;
|
|
1161
952
|
}
|
|
1162
953
|
// Focuses the first item in the tree
|
|
1163
|
-
case
|
|
1164
|
-
|
|
954
|
+
case b === "Home": {
|
|
955
|
+
p(s) && t.multiSelect && u && o.shiftKey ? e.selectRangeFromStartToItem(o, s) : e.focusItem(o, se(e)), o.preventDefault();
|
|
1165
956
|
break;
|
|
1166
957
|
}
|
|
1167
958
|
// Focuses the last item in the tree
|
|
1168
|
-
case
|
|
1169
|
-
|
|
959
|
+
case b === "End": {
|
|
960
|
+
p(s) && t.multiSelect && u && o.shiftKey ? e.selectRangeFromItemToEnd(o, s) : e.focusItem(o, Ne(e)), o.preventDefault();
|
|
1170
961
|
break;
|
|
1171
962
|
}
|
|
1172
963
|
// Expand all siblings that are at the same level as the focused item
|
|
1173
|
-
case
|
|
1174
|
-
e.expandAllSiblings(
|
|
964
|
+
case b === "*": {
|
|
965
|
+
e.expandAllSiblings(o, s), o.preventDefault();
|
|
1175
966
|
break;
|
|
1176
967
|
}
|
|
1177
968
|
// Multi select behavior when pressing Ctrl + a
|
|
1178
969
|
// Selects all the items
|
|
1179
|
-
case (String.fromCharCode(
|
|
1180
|
-
e.selectAllNavigableItems(
|
|
970
|
+
case (String.fromCharCode(o.keyCode) === "A" && u && t.multiSelect && !t.disableSelection): {
|
|
971
|
+
e.selectAllNavigableItems(o), o.preventDefault();
|
|
1181
972
|
break;
|
|
1182
973
|
}
|
|
1183
974
|
// Type-ahead
|
|
1184
975
|
// TODO: Support typing multiple characters
|
|
1185
|
-
case (!
|
|
1186
|
-
const
|
|
1187
|
-
|
|
976
|
+
case (!u && !o.shiftKey && Tn(b)): {
|
|
977
|
+
const x = g(s, b);
|
|
978
|
+
x != null && (e.focusItem(o, x), o.preventDefault());
|
|
1188
979
|
break;
|
|
1189
980
|
}
|
|
1190
981
|
}
|
|
@@ -1192,8 +983,8 @@ const ht = ({
|
|
|
1192
983
|
}
|
|
1193
984
|
};
|
|
1194
985
|
};
|
|
1195
|
-
|
|
1196
|
-
const
|
|
986
|
+
Je.params = {};
|
|
987
|
+
const Ye = ({
|
|
1197
988
|
slots: e,
|
|
1198
989
|
slotProps: t
|
|
1199
990
|
}) => ({
|
|
@@ -1212,221 +1003,144 @@ const xt = ({
|
|
|
1212
1003
|
}
|
|
1213
1004
|
}
|
|
1214
1005
|
});
|
|
1215
|
-
|
|
1216
|
-
const
|
|
1217
|
-
function
|
|
1006
|
+
Ye.params = {};
|
|
1007
|
+
const yn = [X, le, ae, ye, Je, Ye, H];
|
|
1008
|
+
function Qe(e) {
|
|
1218
1009
|
const {
|
|
1219
1010
|
instance: t,
|
|
1220
1011
|
items: {
|
|
1221
1012
|
onItemClick: n
|
|
1222
1013
|
},
|
|
1223
1014
|
selection: {
|
|
1224
|
-
multiSelect:
|
|
1225
|
-
checkboxSelection:
|
|
1226
|
-
disableSelection:
|
|
1015
|
+
multiSelect: r,
|
|
1016
|
+
checkboxSelection: l,
|
|
1017
|
+
disableSelection: h
|
|
1227
1018
|
},
|
|
1228
1019
|
expansion: {
|
|
1229
|
-
expansionTrigger:
|
|
1020
|
+
expansionTrigger: g
|
|
1230
1021
|
}
|
|
1231
|
-
} =
|
|
1022
|
+
} = Ke(), p = t.isItemExpandable(e), m = t.isItemExpanded(e), f = t.isItemFocused(e), o = t.isItemSelected(e), s = t.isItemDisabled(e), u = t != null && t.isItemBeingEdited ? t == null ? void 0 : t.isItemBeingEdited(e) : !1, b = t.isItemEditable ? t.isItemEditable(e) : !1, x = (y) => {
|
|
1232
1023
|
if (!s) {
|
|
1233
|
-
|
|
1234
|
-
const
|
|
1235
|
-
|
|
1024
|
+
f || t.focusItem(y, e);
|
|
1025
|
+
const R = r && (y.shiftKey || y.ctrlKey || y.metaKey);
|
|
1026
|
+
p && !(R && t.isItemExpanded(e)) && t.toggleItemExpansion(y, e);
|
|
1236
1027
|
}
|
|
1237
|
-
},
|
|
1238
|
-
s || (
|
|
1239
|
-
event:
|
|
1028
|
+
}, c = (y) => {
|
|
1029
|
+
s || (f || t.focusItem(y, e), r && (y.shiftKey || y.ctrlKey || y.metaKey) ? y.shiftKey ? t.expandSelectionRange(y, e) : t.selectItem({
|
|
1030
|
+
event: y,
|
|
1240
1031
|
itemId: e,
|
|
1241
1032
|
keepExistingSelection: !0
|
|
1242
1033
|
}) : t.selectItem({
|
|
1243
|
-
event:
|
|
1034
|
+
event: y,
|
|
1244
1035
|
itemId: e,
|
|
1245
1036
|
shouldBeSelected: !0
|
|
1246
1037
|
}));
|
|
1247
|
-
},
|
|
1248
|
-
if (
|
|
1038
|
+
}, i = (y) => {
|
|
1039
|
+
if (h || s)
|
|
1249
1040
|
return;
|
|
1250
|
-
const
|
|
1251
|
-
|
|
1252
|
-
event:
|
|
1041
|
+
const R = y.nativeEvent.shiftKey;
|
|
1042
|
+
r && R ? t.expandSelectionRange(y, e) : t.selectItem({
|
|
1043
|
+
event: y,
|
|
1253
1044
|
itemId: e,
|
|
1254
|
-
keepExistingSelection:
|
|
1255
|
-
shouldBeSelected:
|
|
1045
|
+
keepExistingSelection: r,
|
|
1046
|
+
shouldBeSelected: y.target.checked
|
|
1256
1047
|
});
|
|
1257
|
-
},
|
|
1258
|
-
(
|
|
1259
|
-
},
|
|
1260
|
-
|
|
1048
|
+
}, d = (y) => {
|
|
1049
|
+
(y.shiftKey || y.ctrlKey || y.metaKey || s) && y.preventDefault();
|
|
1050
|
+
}, I = () => {
|
|
1051
|
+
oe(t, H) && t.isItemEditable(e) && (t.isItemBeingEdited(e) ? t.setEditedItemId(null) : t.setEditedItemId(e));
|
|
1261
1052
|
};
|
|
1262
1053
|
return {
|
|
1263
1054
|
disabled: s,
|
|
1264
|
-
expanded:
|
|
1265
|
-
selected:
|
|
1266
|
-
focused:
|
|
1267
|
-
editable:
|
|
1268
|
-
editing:
|
|
1269
|
-
disableSelection:
|
|
1270
|
-
checkboxSelection:
|
|
1271
|
-
handleExpansion:
|
|
1272
|
-
handleSelection:
|
|
1273
|
-
handleCheckboxSelection:
|
|
1055
|
+
expanded: m,
|
|
1056
|
+
selected: o,
|
|
1057
|
+
focused: f,
|
|
1058
|
+
editable: b,
|
|
1059
|
+
editing: u,
|
|
1060
|
+
disableSelection: h,
|
|
1061
|
+
checkboxSelection: l,
|
|
1062
|
+
handleExpansion: x,
|
|
1063
|
+
handleSelection: c,
|
|
1064
|
+
handleCheckboxSelection: i,
|
|
1274
1065
|
handleContentClick: n,
|
|
1275
|
-
preventSelection:
|
|
1276
|
-
expansionTrigger:
|
|
1277
|
-
toggleItemEditing:
|
|
1278
|
-
handleSaveItemLabel: (
|
|
1279
|
-
|
|
1066
|
+
preventSelection: d,
|
|
1067
|
+
expansionTrigger: g,
|
|
1068
|
+
toggleItemEditing: I,
|
|
1069
|
+
handleSaveItemLabel: (y, R) => {
|
|
1070
|
+
oe(t, H) && t.isItemBeingEditedRef(e) && (t.updateItemLabel(e, R), I(), t.focusItem(y, e));
|
|
1280
1071
|
},
|
|
1281
|
-
handleCancelItemLabelEditing: (
|
|
1282
|
-
|
|
1072
|
+
handleCancelItemLabelEditing: (y) => {
|
|
1073
|
+
oe(t, H) && t.isItemBeingEditedRef(e) && (I(), t.focusItem(y, e));
|
|
1283
1074
|
}
|
|
1284
1075
|
};
|
|
1285
1076
|
}
|
|
1286
|
-
const
|
|
1287
|
-
name: "MuiTreeItem2DragAndDropOverlay",
|
|
1288
|
-
slot: "Root",
|
|
1289
|
-
overridesResolver: (e, t) => t.root,
|
|
1290
|
-
shouldForwardProp: (e) => pe(e) && e !== "action"
|
|
1291
|
-
})(({
|
|
1292
|
-
theme: e
|
|
1293
|
-
}) => ({
|
|
1294
|
-
position: "absolute",
|
|
1295
|
-
left: 0,
|
|
1296
|
-
display: "flex",
|
|
1297
|
-
top: 0,
|
|
1298
|
-
bottom: 0,
|
|
1299
|
-
right: 0,
|
|
1300
|
-
pointerEvents: "none",
|
|
1301
|
-
variants: [{
|
|
1302
|
-
props: {
|
|
1303
|
-
action: "make-child"
|
|
1304
|
-
},
|
|
1305
|
-
style: {
|
|
1306
|
-
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
|
|
1307
|
-
borderRadius: e.shape.borderRadius,
|
|
1308
|
-
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.darkChannel} / ${e.vars.palette.action.focusOpacity})` : J(e.palette.primary.dark, e.palette.action.focusOpacity)
|
|
1309
|
-
}
|
|
1310
|
-
}, {
|
|
1311
|
-
props: {
|
|
1312
|
-
action: "reorder-above"
|
|
1313
|
-
},
|
|
1314
|
-
style: {
|
|
1315
|
-
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
|
|
1316
|
-
borderTop: `1px solid ${(e.vars || e).palette.action.active}`
|
|
1317
|
-
}
|
|
1318
|
-
}, {
|
|
1319
|
-
props: {
|
|
1320
|
-
action: "reorder-below"
|
|
1321
|
-
},
|
|
1322
|
-
style: {
|
|
1323
|
-
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
|
|
1324
|
-
borderBottom: `1px solid ${(e.vars || e).palette.action.active}`
|
|
1325
|
-
}
|
|
1326
|
-
}, {
|
|
1327
|
-
props: {
|
|
1328
|
-
action: "move-to-parent"
|
|
1329
|
-
},
|
|
1330
|
-
style: {
|
|
1331
|
-
marginLeft: "calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",
|
|
1332
|
-
borderBottom: `1px solid ${(e.vars || e).palette.action.active}`
|
|
1333
|
-
}
|
|
1334
|
-
}]
|
|
1335
|
-
}));
|
|
1336
|
-
function ze(e) {
|
|
1337
|
-
return e.action == null ? null : /* @__PURE__ */ v(Nn, C({}, e));
|
|
1338
|
-
}
|
|
1339
|
-
process.env.NODE_ENV !== "production" && (ze.propTypes = {
|
|
1340
|
-
// ----------------------------- Warning --------------------------------
|
|
1341
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1342
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
1343
|
-
// ----------------------------------------------------------------------
|
|
1344
|
-
action: d.oneOf(["make-child", "move-to-parent", "reorder-above", "reorder-below"]),
|
|
1345
|
-
style: d.object
|
|
1346
|
-
});
|
|
1347
|
-
const Tt = _("input", {
|
|
1348
|
-
name: "MuiTreeItem2",
|
|
1349
|
-
slot: "LabelInput",
|
|
1350
|
-
overridesResolver: (e, t) => t.labelInput
|
|
1351
|
-
})(({
|
|
1352
|
-
theme: e
|
|
1353
|
-
}) => C({}, e.typography.body1, {
|
|
1354
|
-
width: "100%",
|
|
1355
|
-
backgroundColor: e.palette.background.paper,
|
|
1356
|
-
borderRadius: e.shape.borderRadius,
|
|
1357
|
-
border: "none",
|
|
1358
|
-
padding: "0 2px",
|
|
1359
|
-
boxSizing: "border-box",
|
|
1360
|
-
"&:focus": {
|
|
1361
|
-
outline: `1px solid ${e.palette.primary.main}`
|
|
1362
|
-
}
|
|
1363
|
-
})), jn = ["classes", "className", "displayIcon", "expansionIcon", "icon", "label", "itemId", "onClick", "onMouseDown", "dragAndDropOverlayProps", "labelInputProps"], qe = /* @__PURE__ */ w.forwardRef(function(t, n) {
|
|
1077
|
+
const Cn = ["classes", "className", "displayIcon", "expansionIcon", "icon", "label", "itemId", "onClick", "onMouseDown", "dragAndDropOverlayProps", "labelInputProps"], Ce = /* @__PURE__ */ E.forwardRef(function(t, n) {
|
|
1364
1078
|
const {
|
|
1365
|
-
classes:
|
|
1366
|
-
className:
|
|
1367
|
-
displayIcon:
|
|
1368
|
-
expansionIcon:
|
|
1369
|
-
icon:
|
|
1370
|
-
label:
|
|
1371
|
-
itemId:
|
|
1372
|
-
onClick:
|
|
1079
|
+
classes: r,
|
|
1080
|
+
className: l,
|
|
1081
|
+
displayIcon: h,
|
|
1082
|
+
expansionIcon: g,
|
|
1083
|
+
icon: p,
|
|
1084
|
+
label: m,
|
|
1085
|
+
itemId: f,
|
|
1086
|
+
onClick: o,
|
|
1373
1087
|
onMouseDown: s,
|
|
1374
|
-
dragAndDropOverlayProps:
|
|
1375
|
-
labelInputProps:
|
|
1376
|
-
} = t,
|
|
1377
|
-
disabled:
|
|
1378
|
-
expanded:
|
|
1379
|
-
selected:
|
|
1380
|
-
focused:
|
|
1381
|
-
editing:
|
|
1382
|
-
editable:
|
|
1383
|
-
disableSelection:
|
|
1384
|
-
checkboxSelection:
|
|
1385
|
-
handleExpansion:
|
|
1386
|
-
handleSelection:
|
|
1387
|
-
handleCheckboxSelection:
|
|
1388
|
-
handleContentClick:
|
|
1389
|
-
preventSelection:
|
|
1390
|
-
expansionTrigger:
|
|
1391
|
-
toggleItemEditing:
|
|
1392
|
-
} =
|
|
1393
|
-
|
|
1394
|
-
},
|
|
1395
|
-
var
|
|
1396
|
-
|
|
1397
|
-
},
|
|
1398
|
-
|
|
1088
|
+
dragAndDropOverlayProps: u,
|
|
1089
|
+
labelInputProps: b
|
|
1090
|
+
} = t, x = A(t, Cn), {
|
|
1091
|
+
disabled: c,
|
|
1092
|
+
expanded: i,
|
|
1093
|
+
selected: d,
|
|
1094
|
+
focused: I,
|
|
1095
|
+
editing: T,
|
|
1096
|
+
editable: P,
|
|
1097
|
+
disableSelection: y,
|
|
1098
|
+
checkboxSelection: R,
|
|
1099
|
+
handleExpansion: v,
|
|
1100
|
+
handleSelection: F,
|
|
1101
|
+
handleCheckboxSelection: B,
|
|
1102
|
+
handleContentClick: V,
|
|
1103
|
+
preventSelection: L,
|
|
1104
|
+
expansionTrigger: W,
|
|
1105
|
+
toggleItemEditing: G
|
|
1106
|
+
} = Qe(f), j = p || g || h, J = E.useRef(null), ce = (M) => {
|
|
1107
|
+
L(M), s && s(M);
|
|
1108
|
+
}, ue = (M) => {
|
|
1109
|
+
var Y;
|
|
1110
|
+
V == null || V(M, f), !((Y = J.current) != null && Y.contains(M.target)) && (W === "content" && v(M), R || F(M), o && o(M));
|
|
1111
|
+
}, de = (M) => {
|
|
1112
|
+
M.defaultMuiPrevented || G();
|
|
1399
1113
|
};
|
|
1400
1114
|
return (
|
|
1401
1115
|
/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions -- Key event is handled by the TreeView */
|
|
1402
|
-
/* @__PURE__ */
|
|
1403
|
-
className:
|
|
1404
|
-
onClick:
|
|
1405
|
-
onMouseDown:
|
|
1116
|
+
/* @__PURE__ */ je("div", C({}, x, {
|
|
1117
|
+
className: Be(r.root, l, i && r.expanded, d && r.selected, I && r.focused, c && r.disabled, T && r.editing, P && r.editable),
|
|
1118
|
+
onClick: ue,
|
|
1119
|
+
onMouseDown: ce,
|
|
1406
1120
|
ref: n,
|
|
1407
|
-
children: [/* @__PURE__ */
|
|
1408
|
-
className:
|
|
1409
|
-
children:
|
|
1410
|
-
}),
|
|
1411
|
-
className:
|
|
1412
|
-
checked:
|
|
1413
|
-
onChange:
|
|
1414
|
-
disabled:
|
|
1415
|
-
ref:
|
|
1121
|
+
children: [/* @__PURE__ */ S("div", {
|
|
1122
|
+
className: r.iconContainer,
|
|
1123
|
+
children: j
|
|
1124
|
+
}), R && /* @__PURE__ */ S(Xt, {
|
|
1125
|
+
className: r.checkbox,
|
|
1126
|
+
checked: d,
|
|
1127
|
+
onChange: B,
|
|
1128
|
+
disabled: c || y,
|
|
1129
|
+
ref: J,
|
|
1416
1130
|
tabIndex: -1
|
|
1417
|
-
}),
|
|
1418
|
-
className:
|
|
1419
|
-
})) : /* @__PURE__ */
|
|
1420
|
-
className:
|
|
1421
|
-
},
|
|
1422
|
-
onDoubleClick:
|
|
1131
|
+
}), T ? /* @__PURE__ */ S(Lt, C({}, b, {
|
|
1132
|
+
className: r.labelInput
|
|
1133
|
+
})) : /* @__PURE__ */ S("div", C({
|
|
1134
|
+
className: r.label
|
|
1135
|
+
}, P && {
|
|
1136
|
+
onDoubleClick: de
|
|
1423
1137
|
}, {
|
|
1424
|
-
children:
|
|
1425
|
-
})),
|
|
1138
|
+
children: m
|
|
1139
|
+
})), u && /* @__PURE__ */ S(jt, C({}, u))]
|
|
1426
1140
|
}))
|
|
1427
1141
|
);
|
|
1428
1142
|
});
|
|
1429
|
-
process.env.NODE_ENV !== "production" && (
|
|
1143
|
+
process.env.NODE_ENV !== "production" && (Ce.propTypes = {
|
|
1430
1144
|
// ----------------------------- Warning --------------------------------
|
|
1431
1145
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1432
1146
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -1434,77 +1148,47 @@ process.env.NODE_ENV !== "production" && (qe.propTypes = {
|
|
|
1434
1148
|
/**
|
|
1435
1149
|
* Override or extend the styles applied to the component.
|
|
1436
1150
|
*/
|
|
1437
|
-
classes:
|
|
1438
|
-
className:
|
|
1151
|
+
classes: a.object.isRequired,
|
|
1152
|
+
className: a.string,
|
|
1439
1153
|
/**
|
|
1440
1154
|
* The icon to display next to the Tree Item's label. Either a parent or end icon.
|
|
1441
1155
|
*/
|
|
1442
|
-
displayIcon:
|
|
1443
|
-
dragAndDropOverlayProps:
|
|
1444
|
-
action:
|
|
1445
|
-
style:
|
|
1156
|
+
displayIcon: a.node,
|
|
1157
|
+
dragAndDropOverlayProps: a.shape({
|
|
1158
|
+
action: a.oneOf(["make-child", "move-to-parent", "reorder-above", "reorder-below"]),
|
|
1159
|
+
style: a.object
|
|
1446
1160
|
}),
|
|
1447
1161
|
/**
|
|
1448
1162
|
* The icon to display next to the Tree Item's label. Either an expansion or collapse icon.
|
|
1449
1163
|
*/
|
|
1450
|
-
expansionIcon:
|
|
1164
|
+
expansionIcon: a.node,
|
|
1451
1165
|
/**
|
|
1452
1166
|
* The icon to display next to the Tree Item's label.
|
|
1453
1167
|
*/
|
|
1454
|
-
icon:
|
|
1168
|
+
icon: a.node,
|
|
1455
1169
|
/**
|
|
1456
1170
|
* The id of the item.
|
|
1457
1171
|
*/
|
|
1458
|
-
itemId:
|
|
1172
|
+
itemId: a.string.isRequired,
|
|
1459
1173
|
/**
|
|
1460
1174
|
* The Tree Item label.
|
|
1461
1175
|
*/
|
|
1462
|
-
label:
|
|
1463
|
-
labelInputProps:
|
|
1464
|
-
autoFocus:
|
|
1465
|
-
"data-element":
|
|
1466
|
-
onBlur:
|
|
1467
|
-
onChange:
|
|
1468
|
-
onKeyDown:
|
|
1469
|
-
type:
|
|
1470
|
-
value:
|
|
1176
|
+
label: a.node,
|
|
1177
|
+
labelInputProps: a.shape({
|
|
1178
|
+
autoFocus: a.oneOf([!0]),
|
|
1179
|
+
"data-element": a.oneOf(["labelInput"]),
|
|
1180
|
+
onBlur: a.func,
|
|
1181
|
+
onChange: a.func,
|
|
1182
|
+
onKeyDown: a.func,
|
|
1183
|
+
type: a.oneOf(["text"]),
|
|
1184
|
+
value: a.string
|
|
1471
1185
|
})
|
|
1472
1186
|
});
|
|
1473
|
-
|
|
1474
|
-
return it("MuiTreeItem", e);
|
|
1475
|
-
}
|
|
1476
|
-
const W = st("MuiTreeItem", ["root", "groupTransition", "content", "expanded", "selected", "focused", "disabled", "iconContainer", "label", "checkbox", "labelInput", "editable", "editing", "dragAndDropOverlay"]), Et = ue(/* @__PURE__ */ v("path", {
|
|
1477
|
-
d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
|
|
1478
|
-
}), "TreeViewExpandIcon"), wt = ue(/* @__PURE__ */ v("path", {
|
|
1479
|
-
d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
|
|
1480
|
-
}), "TreeViewCollapseIcon");
|
|
1481
|
-
function ke(e) {
|
|
1482
|
-
const {
|
|
1483
|
-
children: t,
|
|
1484
|
-
itemId: n
|
|
1485
|
-
} = e, {
|
|
1486
|
-
wrapItem: o,
|
|
1487
|
-
instance: i
|
|
1488
|
-
} = ie();
|
|
1489
|
-
return o({
|
|
1490
|
-
children: t,
|
|
1491
|
-
itemId: n,
|
|
1492
|
-
instance: i
|
|
1493
|
-
});
|
|
1494
|
-
}
|
|
1495
|
-
ke.propTypes = {
|
|
1496
|
-
// ----------------------------- Warning --------------------------------
|
|
1497
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1498
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
1499
|
-
// ----------------------------------------------------------------------
|
|
1500
|
-
children: d.node,
|
|
1501
|
-
itemId: d.string.isRequired
|
|
1502
|
-
};
|
|
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) => {
|
|
1187
|
+
const wn = ["children", "className", "slots", "slotProps", "ContentComponent", "ContentProps", "itemId", "id", "label", "onClick", "onMouseDown", "onFocus", "onBlur", "onKeyDown"], Rn = ["ownerState"], Sn = ["ownerState"], Pn = ["ownerState"], vn = Ue(), kn = (e) => {
|
|
1504
1188
|
const {
|
|
1505
1189
|
classes: t
|
|
1506
1190
|
} = e;
|
|
1507
|
-
return
|
|
1191
|
+
return ze({
|
|
1508
1192
|
root: ["root"],
|
|
1509
1193
|
content: ["content"],
|
|
1510
1194
|
expanded: ["expanded"],
|
|
@@ -1518,8 +1202,8 @@ const Kn = ["children", "className", "slots", "slotProps", "ContentComponent", "
|
|
|
1518
1202
|
editing: ["editing"],
|
|
1519
1203
|
editable: ["editable"],
|
|
1520
1204
|
groupTransition: ["groupTransition"]
|
|
1521
|
-
},
|
|
1522
|
-
},
|
|
1205
|
+
}, Kt, t);
|
|
1206
|
+
}, Mn = ie("li", {
|
|
1523
1207
|
name: "MuiTreeItem",
|
|
1524
1208
|
slot: "Root",
|
|
1525
1209
|
overridesResolver: (e, t) => t.root
|
|
@@ -1528,15 +1212,15 @@ const Kn = ["children", "className", "slots", "slotProps", "ContentComponent", "
|
|
|
1528
1212
|
margin: 0,
|
|
1529
1213
|
padding: 0,
|
|
1530
1214
|
outline: 0
|
|
1531
|
-
}),
|
|
1215
|
+
}), Dn = ie(Ce, {
|
|
1532
1216
|
name: "MuiTreeItem",
|
|
1533
1217
|
slot: "Content",
|
|
1534
1218
|
overridesResolver: (e, t) => [t.content, t.iconContainer && {
|
|
1535
|
-
[`& .${
|
|
1219
|
+
[`& .${O.iconContainer}`]: t.iconContainer
|
|
1536
1220
|
}, t.label && {
|
|
1537
|
-
[`& .${
|
|
1221
|
+
[`& .${O.label}`]: t.label
|
|
1538
1222
|
}],
|
|
1539
|
-
shouldForwardProp: (e) =>
|
|
1223
|
+
shouldForwardProp: (e) => qe(e) && e !== "indentationAtItemLevel"
|
|
1540
1224
|
})(({
|
|
1541
1225
|
theme: e
|
|
1542
1226
|
}) => ({
|
|
@@ -1558,27 +1242,27 @@ const Kn = ["children", "className", "slots", "slotProps", "ContentComponent", "
|
|
|
1558
1242
|
backgroundColor: "transparent"
|
|
1559
1243
|
}
|
|
1560
1244
|
},
|
|
1561
|
-
[`&.${
|
|
1245
|
+
[`&.${O.disabled}`]: {
|
|
1562
1246
|
opacity: (e.vars || e).palette.action.disabledOpacity,
|
|
1563
1247
|
backgroundColor: "transparent"
|
|
1564
1248
|
},
|
|
1565
|
-
[`&.${
|
|
1249
|
+
[`&.${O.focused}`]: {
|
|
1566
1250
|
backgroundColor: (e.vars || e).palette.action.focus
|
|
1567
1251
|
},
|
|
1568
|
-
[`&.${
|
|
1569
|
-
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` :
|
|
1252
|
+
[`&.${O.selected}`]: {
|
|
1253
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : ne(e.palette.primary.main, e.palette.action.selectedOpacity),
|
|
1570
1254
|
"&:hover": {
|
|
1571
|
-
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` :
|
|
1255
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : ne(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
|
|
1572
1256
|
// Reset on touch devices, it doesn't add specificity
|
|
1573
1257
|
"@media (hover: none)": {
|
|
1574
|
-
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` :
|
|
1258
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : ne(e.palette.primary.main, e.palette.action.selectedOpacity)
|
|
1575
1259
|
}
|
|
1576
1260
|
},
|
|
1577
|
-
[`&.${
|
|
1578
|
-
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` :
|
|
1261
|
+
[`&.${O.focused}`]: {
|
|
1262
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : ne(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
|
|
1579
1263
|
}
|
|
1580
1264
|
},
|
|
1581
|
-
[`& .${
|
|
1265
|
+
[`& .${O.iconContainer}`]: {
|
|
1582
1266
|
width: 16,
|
|
1583
1267
|
display: "flex",
|
|
1584
1268
|
flexShrink: 0,
|
|
@@ -1587,7 +1271,7 @@ const Kn = ["children", "className", "slots", "slotProps", "ContentComponent", "
|
|
|
1587
1271
|
fontSize: 18
|
|
1588
1272
|
}
|
|
1589
1273
|
},
|
|
1590
|
-
[`& .${
|
|
1274
|
+
[`& .${O.label}`]: C({
|
|
1591
1275
|
width: "100%",
|
|
1592
1276
|
boxSizing: "border-box",
|
|
1593
1277
|
// prevent width + padding to overflow
|
|
@@ -1595,7 +1279,7 @@ const Kn = ["children", "className", "slots", "slotProps", "ContentComponent", "
|
|
|
1595
1279
|
minWidth: 0,
|
|
1596
1280
|
position: "relative"
|
|
1597
1281
|
}, e.typography.body1),
|
|
1598
|
-
[`& .${
|
|
1282
|
+
[`& .${O.checkbox}`]: {
|
|
1599
1283
|
padding: 0
|
|
1600
1284
|
},
|
|
1601
1285
|
variants: [{
|
|
@@ -1606,11 +1290,11 @@ const Kn = ["children", "className", "slots", "slotProps", "ContentComponent", "
|
|
|
1606
1290
|
paddingLeft: `calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`
|
|
1607
1291
|
}
|
|
1608
1292
|
}]
|
|
1609
|
-
})),
|
|
1293
|
+
})), On = ie(Wt, {
|
|
1610
1294
|
name: "MuiTreeItem",
|
|
1611
1295
|
slot: "GroupTransition",
|
|
1612
1296
|
overridesResolver: (e, t) => t.groupTransition,
|
|
1613
|
-
shouldForwardProp: (e) =>
|
|
1297
|
+
shouldForwardProp: (e) => qe(e) && e !== "indentationAtItemLevel"
|
|
1614
1298
|
})({
|
|
1615
1299
|
margin: 0,
|
|
1616
1300
|
padding: 0,
|
|
@@ -1623,190 +1307,190 @@ const Kn = ["children", "className", "slots", "slotProps", "ContentComponent", "
|
|
|
1623
1307
|
paddingLeft: 0
|
|
1624
1308
|
}
|
|
1625
1309
|
}]
|
|
1626
|
-
}),
|
|
1627
|
-
var
|
|
1310
|
+
}), Ze = /* @__PURE__ */ E.forwardRef(function(t, n) {
|
|
1311
|
+
var ke, Me, De, Oe;
|
|
1628
1312
|
const {
|
|
1629
|
-
icons:
|
|
1630
|
-
runItemPlugins:
|
|
1313
|
+
icons: r,
|
|
1314
|
+
runItemPlugins: l,
|
|
1631
1315
|
items: {
|
|
1632
|
-
disabledItemsFocusable:
|
|
1633
|
-
indentationAtItemLevel:
|
|
1316
|
+
disabledItemsFocusable: h,
|
|
1317
|
+
indentationAtItemLevel: g
|
|
1634
1318
|
},
|
|
1635
1319
|
selection: {
|
|
1636
|
-
disableSelection:
|
|
1320
|
+
disableSelection: p
|
|
1637
1321
|
},
|
|
1638
1322
|
expansion: {
|
|
1639
|
-
expansionTrigger:
|
|
1323
|
+
expansionTrigger: m
|
|
1640
1324
|
},
|
|
1641
|
-
treeId:
|
|
1642
|
-
instance:
|
|
1643
|
-
} =
|
|
1325
|
+
treeId: f,
|
|
1326
|
+
instance: o
|
|
1327
|
+
} = Ke(), s = E.useContext(_e), u = vn({
|
|
1644
1328
|
props: t,
|
|
1645
1329
|
name: "MuiTreeItem"
|
|
1646
1330
|
}), {
|
|
1647
|
-
children:
|
|
1648
|
-
className:
|
|
1649
|
-
slots:
|
|
1650
|
-
slotProps:
|
|
1651
|
-
ContentComponent:
|
|
1652
|
-
ContentProps:
|
|
1653
|
-
itemId:
|
|
1654
|
-
id:
|
|
1655
|
-
label:
|
|
1656
|
-
onClick:
|
|
1657
|
-
onMouseDown:
|
|
1658
|
-
onBlur:
|
|
1659
|
-
onKeyDown:
|
|
1660
|
-
} =
|
|
1661
|
-
expanded:
|
|
1662
|
-
focused:
|
|
1663
|
-
selected:
|
|
1664
|
-
disabled:
|
|
1665
|
-
editing:
|
|
1666
|
-
handleExpansion:
|
|
1667
|
-
handleCancelItemLabelEditing:
|
|
1668
|
-
handleSaveItemLabel:
|
|
1669
|
-
} =
|
|
1670
|
-
process.env.NODE_ENV !== "production" && (
|
|
1331
|
+
children: b,
|
|
1332
|
+
className: x,
|
|
1333
|
+
slots: c,
|
|
1334
|
+
slotProps: i,
|
|
1335
|
+
ContentComponent: d = Ce,
|
|
1336
|
+
ContentProps: I,
|
|
1337
|
+
itemId: T,
|
|
1338
|
+
id: P,
|
|
1339
|
+
label: y,
|
|
1340
|
+
onClick: R,
|
|
1341
|
+
onMouseDown: v,
|
|
1342
|
+
onBlur: F,
|
|
1343
|
+
onKeyDown: B
|
|
1344
|
+
} = u, V = A(u, wn), {
|
|
1345
|
+
expanded: L,
|
|
1346
|
+
focused: W,
|
|
1347
|
+
selected: G,
|
|
1348
|
+
disabled: j,
|
|
1349
|
+
editing: J,
|
|
1350
|
+
handleExpansion: ce,
|
|
1351
|
+
handleCancelItemLabelEditing: ue,
|
|
1352
|
+
handleSaveItemLabel: de
|
|
1353
|
+
} = Qe(T);
|
|
1354
|
+
process.env.NODE_ENV !== "production" && (u.ContentComponent && xe(["MUI X: The ContentComponent prop of the TreeItem component is deprecated and will be removed in the next major release.", "You can use the new TreeItem2 component or the new useTreeItem2 hook to customize the rendering of the content.", "For more detail, see https://mui.com/x/react-tree-view/tree-item-customization/."]), u.ContentProps && xe(["MUI X: The ContentProps prop of the TreeItem component is deprecated and will be removed in the next major release.", "You can use the new TreeItem2 component or the new useTreeItem2 hook to customize the rendering of the content.", "For more detail, see https://mui.com/x/react-tree-view/tree-item-customization/."]));
|
|
1671
1355
|
const {
|
|
1672
|
-
contentRef:
|
|
1673
|
-
rootRef:
|
|
1674
|
-
propsEnhancers:
|
|
1675
|
-
} =
|
|
1676
|
-
expandIcon: (
|
|
1677
|
-
collapseIcon: (
|
|
1678
|
-
endIcon: (
|
|
1679
|
-
icon:
|
|
1680
|
-
groupTransition:
|
|
1681
|
-
},
|
|
1682
|
-
expanded:
|
|
1683
|
-
focused:
|
|
1684
|
-
selected:
|
|
1685
|
-
disabled:
|
|
1686
|
-
indentationAtItemLevel:
|
|
1687
|
-
}),
|
|
1688
|
-
elementType:
|
|
1356
|
+
contentRef: M,
|
|
1357
|
+
rootRef: Y,
|
|
1358
|
+
propsEnhancers: D
|
|
1359
|
+
} = l(u), Q = E.useRef(null), we = E.useRef(null), nt = Ee(n, Y, Q), ot = Ee(I == null ? void 0 : I.ref, M, we), z = {
|
|
1360
|
+
expandIcon: (c == null ? void 0 : c.expandIcon) ?? r.slots.expandIcon ?? _t,
|
|
1361
|
+
collapseIcon: (c == null ? void 0 : c.collapseIcon) ?? r.slots.collapseIcon ?? $t,
|
|
1362
|
+
endIcon: (c == null ? void 0 : c.endIcon) ?? r.slots.endIcon,
|
|
1363
|
+
icon: c == null ? void 0 : c.icon,
|
|
1364
|
+
groupTransition: c == null ? void 0 : c.groupTransition
|
|
1365
|
+
}, Re = (w) => Array.isArray(w) ? w.length > 0 && w.some(Re) : !!w, Z = Re(b), fe = C({}, u, {
|
|
1366
|
+
expanded: L,
|
|
1367
|
+
focused: W,
|
|
1368
|
+
selected: G,
|
|
1369
|
+
disabled: j,
|
|
1370
|
+
indentationAtItemLevel: g
|
|
1371
|
+
}), k = kn(fe), Se = z.groupTransition ?? void 0, rt = N({
|
|
1372
|
+
elementType: Se,
|
|
1689
1373
|
ownerState: {},
|
|
1690
|
-
externalSlotProps:
|
|
1374
|
+
externalSlotProps: i == null ? void 0 : i.groupTransition,
|
|
1691
1375
|
additionalProps: C({
|
|
1692
1376
|
unmountOnExit: !0,
|
|
1693
|
-
in:
|
|
1377
|
+
in: L,
|
|
1694
1378
|
component: "ul",
|
|
1695
1379
|
role: "group"
|
|
1696
|
-
},
|
|
1380
|
+
}, g ? {
|
|
1697
1381
|
indentationAtItemLevel: !0
|
|
1698
1382
|
} : {}),
|
|
1699
|
-
className:
|
|
1700
|
-
}),
|
|
1701
|
-
|
|
1702
|
-
},
|
|
1703
|
-
elementType:
|
|
1383
|
+
className: k.groupTransition
|
|
1384
|
+
}), st = (w) => {
|
|
1385
|
+
m === "iconContainer" && ce(w);
|
|
1386
|
+
}, pe = L ? z.collapseIcon : z.expandIcon, it = N({
|
|
1387
|
+
elementType: pe,
|
|
1704
1388
|
ownerState: {},
|
|
1705
|
-
externalSlotProps: (
|
|
1389
|
+
externalSlotProps: (w) => L ? C({}, _(r.slotProps.collapseIcon, w), _(i == null ? void 0 : i.collapseIcon, w)) : C({}, _(r.slotProps.expandIcon, w), _(i == null ? void 0 : i.expandIcon, w)),
|
|
1706
1390
|
additionalProps: {
|
|
1707
|
-
onClick:
|
|
1391
|
+
onClick: st
|
|
1708
1392
|
}
|
|
1709
|
-
}),
|
|
1710
|
-
elementType:
|
|
1393
|
+
}), lt = A(it, Rn), at = Z && pe ? /* @__PURE__ */ S(pe, C({}, lt)) : null, me = Z ? void 0 : z.endIcon, ct = N({
|
|
1394
|
+
elementType: me,
|
|
1711
1395
|
ownerState: {},
|
|
1712
|
-
externalSlotProps: (
|
|
1713
|
-
}),
|
|
1714
|
-
elementType:
|
|
1396
|
+
externalSlotProps: (w) => Z ? {} : C({}, _(r.slotProps.endIcon, w), _(i == null ? void 0 : i.endIcon, w))
|
|
1397
|
+
}), ut = A(ct, Sn), dt = me ? /* @__PURE__ */ S(me, C({}, ut)) : null, Ie = z.icon, ft = N({
|
|
1398
|
+
elementType: Ie,
|
|
1715
1399
|
ownerState: {},
|
|
1716
|
-
externalSlotProps:
|
|
1717
|
-
}),
|
|
1718
|
-
let
|
|
1719
|
-
|
|
1720
|
-
function
|
|
1721
|
-
!
|
|
1400
|
+
externalSlotProps: i == null ? void 0 : i.icon
|
|
1401
|
+
}), pt = A(ft, Pn), mt = Ie ? /* @__PURE__ */ S(Ie, C({}, pt)) : null;
|
|
1402
|
+
let ee;
|
|
1403
|
+
G ? ee = !0 : p || j ? ee = void 0 : ee = !1;
|
|
1404
|
+
function It(w) {
|
|
1405
|
+
!W && (!j || h) && w.currentTarget === w.target && o.focusItem(w, T);
|
|
1722
1406
|
}
|
|
1723
|
-
function
|
|
1724
|
-
var
|
|
1725
|
-
|
|
1407
|
+
function gt(w) {
|
|
1408
|
+
var $, q, Ve, Ae;
|
|
1409
|
+
F == null || F(w), !(J || // 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
1410
|
// 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
|
-
|
|
1411
|
+
w.relatedTarget && he(w.relatedTarget, Q.current) && (w.target && ((q = ($ = w.target) == null ? void 0 : $.dataset) == null ? void 0 : q.element) === "labelInput" && he(w.target, Q.current) || ((Ae = (Ve = w.relatedTarget) == null ? void 0 : Ve.dataset) == null ? void 0 : Ae.element) === "labelInput")) && o.removeFocusedItem();
|
|
1728
1412
|
}
|
|
1729
|
-
const
|
|
1730
|
-
var
|
|
1731
|
-
|
|
1732
|
-
},
|
|
1733
|
-
itemId:
|
|
1734
|
-
treeId:
|
|
1735
|
-
id:
|
|
1736
|
-
}),
|
|
1737
|
-
rootRefObject:
|
|
1738
|
-
contentRefObject:
|
|
1413
|
+
const bt = (w) => {
|
|
1414
|
+
var $, q;
|
|
1415
|
+
B == null || B(w), ((q = ($ = w.target) == null ? void 0 : $.dataset) == null ? void 0 : q.element) !== "labelInput" && o.handleItemKeyDown(w, T);
|
|
1416
|
+
}, ht = $e({
|
|
1417
|
+
itemId: T,
|
|
1418
|
+
treeId: f,
|
|
1419
|
+
id: P
|
|
1420
|
+
}), xt = o.canItemBeTabbed(T) ? 0 : -1, te = {
|
|
1421
|
+
rootRefObject: Q,
|
|
1422
|
+
contentRefObject: we,
|
|
1739
1423
|
interactions: {
|
|
1740
|
-
handleSaveItemLabel:
|
|
1741
|
-
handleCancelItemLabelEditing:
|
|
1424
|
+
handleSaveItemLabel: de,
|
|
1425
|
+
handleCancelItemLabelEditing: ue
|
|
1742
1426
|
}
|
|
1743
|
-
},
|
|
1744
|
-
externalEventHandlers:
|
|
1745
|
-
}))) ?? {},
|
|
1746
|
-
externalEventHandlers:
|
|
1747
|
-
}))) ?? {},
|
|
1427
|
+
}, Et = ((ke = D.root) == null ? void 0 : ke.call(D, C({}, te, {
|
|
1428
|
+
externalEventHandlers: Fe(V)
|
|
1429
|
+
}))) ?? {}, Tt = ((Me = D.content) == null ? void 0 : Me.call(D, C({}, te, {
|
|
1430
|
+
externalEventHandlers: Fe(I)
|
|
1431
|
+
}))) ?? {}, Pe = ((De = D.dragAndDropOverlay) == null ? void 0 : De.call(D, C({}, te, {
|
|
1748
1432
|
externalEventHandlers: {}
|
|
1749
|
-
}))) ?? {},
|
|
1433
|
+
}))) ?? {}, ve = ((Oe = D.labelInput) == null ? void 0 : Oe.call(D, C({}, te, {
|
|
1750
1434
|
externalEventHandlers: {}
|
|
1751
1435
|
}))) ?? {};
|
|
1752
|
-
return /* @__PURE__ */
|
|
1753
|
-
itemId:
|
|
1754
|
-
children: /* @__PURE__ */
|
|
1755
|
-
className:
|
|
1436
|
+
return /* @__PURE__ */ S(Nt, {
|
|
1437
|
+
itemId: T,
|
|
1438
|
+
children: /* @__PURE__ */ je(Mn, C({
|
|
1439
|
+
className: Be(k.root, x),
|
|
1756
1440
|
role: "treeitem",
|
|
1757
|
-
"aria-expanded":
|
|
1758
|
-
"aria-selected":
|
|
1759
|
-
"aria-disabled":
|
|
1760
|
-
id:
|
|
1761
|
-
tabIndex:
|
|
1762
|
-
},
|
|
1763
|
-
ownerState:
|
|
1764
|
-
onFocus:
|
|
1765
|
-
onBlur:
|
|
1766
|
-
onKeyDown:
|
|
1767
|
-
ref:
|
|
1768
|
-
style:
|
|
1769
|
-
"--TreeView-itemDepth": typeof s == "function" ? s(
|
|
1770
|
-
}) :
|
|
1771
|
-
},
|
|
1772
|
-
children: [/* @__PURE__ */
|
|
1773
|
-
as:
|
|
1441
|
+
"aria-expanded": Z ? L : void 0,
|
|
1442
|
+
"aria-selected": ee,
|
|
1443
|
+
"aria-disabled": j || void 0,
|
|
1444
|
+
id: ht,
|
|
1445
|
+
tabIndex: xt
|
|
1446
|
+
}, V, {
|
|
1447
|
+
ownerState: fe,
|
|
1448
|
+
onFocus: It,
|
|
1449
|
+
onBlur: gt,
|
|
1450
|
+
onKeyDown: bt,
|
|
1451
|
+
ref: nt,
|
|
1452
|
+
style: g ? C({}, V.style, {
|
|
1453
|
+
"--TreeView-itemDepth": typeof s == "function" ? s(T) : s
|
|
1454
|
+
}) : V.style
|
|
1455
|
+
}, Et, {
|
|
1456
|
+
children: [/* @__PURE__ */ S(Dn, C({
|
|
1457
|
+
as: d,
|
|
1774
1458
|
classes: {
|
|
1775
|
-
root:
|
|
1776
|
-
expanded:
|
|
1777
|
-
selected:
|
|
1778
|
-
focused:
|
|
1779
|
-
disabled:
|
|
1780
|
-
editable:
|
|
1781
|
-
editing:
|
|
1782
|
-
iconContainer:
|
|
1783
|
-
label:
|
|
1784
|
-
labelInput:
|
|
1785
|
-
checkbox:
|
|
1459
|
+
root: k.content,
|
|
1460
|
+
expanded: k.expanded,
|
|
1461
|
+
selected: k.selected,
|
|
1462
|
+
focused: k.focused,
|
|
1463
|
+
disabled: k.disabled,
|
|
1464
|
+
editable: k.editable,
|
|
1465
|
+
editing: k.editing,
|
|
1466
|
+
iconContainer: k.iconContainer,
|
|
1467
|
+
label: k.label,
|
|
1468
|
+
labelInput: k.labelInput,
|
|
1469
|
+
checkbox: k.checkbox
|
|
1786
1470
|
},
|
|
1787
|
-
label:
|
|
1788
|
-
itemId:
|
|
1789
|
-
onClick:
|
|
1790
|
-
onMouseDown:
|
|
1791
|
-
icon:
|
|
1792
|
-
expansionIcon:
|
|
1793
|
-
displayIcon:
|
|
1794
|
-
ownerState:
|
|
1795
|
-
},
|
|
1796
|
-
dragAndDropOverlayProps:
|
|
1797
|
-
},
|
|
1798
|
-
labelInputProps:
|
|
1471
|
+
label: y,
|
|
1472
|
+
itemId: T,
|
|
1473
|
+
onClick: R,
|
|
1474
|
+
onMouseDown: v,
|
|
1475
|
+
icon: mt,
|
|
1476
|
+
expansionIcon: at,
|
|
1477
|
+
displayIcon: dt,
|
|
1478
|
+
ownerState: fe
|
|
1479
|
+
}, I, Tt, Pe.action == null ? {} : {
|
|
1480
|
+
dragAndDropOverlayProps: Pe
|
|
1481
|
+
}, ve.value == null ? {} : {
|
|
1482
|
+
labelInputProps: ve
|
|
1799
1483
|
}, {
|
|
1800
|
-
ref:
|
|
1801
|
-
})),
|
|
1802
|
-
as:
|
|
1803
|
-
},
|
|
1804
|
-
children:
|
|
1484
|
+
ref: ot
|
|
1485
|
+
})), b && /* @__PURE__ */ S(On, C({
|
|
1486
|
+
as: Se
|
|
1487
|
+
}, rt, {
|
|
1488
|
+
children: b
|
|
1805
1489
|
}))]
|
|
1806
1490
|
}))
|
|
1807
1491
|
});
|
|
1808
1492
|
});
|
|
1809
|
-
process.env.NODE_ENV !== "production" && (
|
|
1493
|
+
process.env.NODE_ENV !== "production" && (Ze.propTypes = {
|
|
1810
1494
|
// ----------------------------- Warning --------------------------------
|
|
1811
1495
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1812
1496
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -1814,115 +1498,115 @@ process.env.NODE_ENV !== "production" && (Rt.propTypes = {
|
|
|
1814
1498
|
/**
|
|
1815
1499
|
* The content of the component.
|
|
1816
1500
|
*/
|
|
1817
|
-
children:
|
|
1501
|
+
children: a.node,
|
|
1818
1502
|
/**
|
|
1819
1503
|
* Override or extend the styles applied to the component.
|
|
1820
1504
|
*/
|
|
1821
|
-
classes:
|
|
1822
|
-
className:
|
|
1505
|
+
classes: a.object,
|
|
1506
|
+
className: a.string,
|
|
1823
1507
|
/**
|
|
1824
1508
|
* The component used to render the content of the item.
|
|
1825
1509
|
* @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
1510
|
* @default TreeItemContent
|
|
1827
1511
|
*/
|
|
1828
|
-
ContentComponent:
|
|
1512
|
+
ContentComponent: Jt,
|
|
1829
1513
|
/**
|
|
1830
1514
|
* Props applied to ContentComponent.
|
|
1831
1515
|
* @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/.
|
|
1832
1516
|
*/
|
|
1833
|
-
ContentProps:
|
|
1517
|
+
ContentProps: a.object,
|
|
1834
1518
|
/**
|
|
1835
1519
|
* If `true`, the item is disabled.
|
|
1836
1520
|
* @default false
|
|
1837
1521
|
*/
|
|
1838
|
-
disabled:
|
|
1522
|
+
disabled: a.bool,
|
|
1839
1523
|
/**
|
|
1840
1524
|
* The id of the item.
|
|
1841
1525
|
*/
|
|
1842
|
-
itemId:
|
|
1526
|
+
itemId: a.string.isRequired,
|
|
1843
1527
|
/**
|
|
1844
1528
|
* The Tree Item label.
|
|
1845
1529
|
*/
|
|
1846
|
-
label:
|
|
1530
|
+
label: a.node,
|
|
1847
1531
|
/**
|
|
1848
1532
|
* This prop isn't supported.
|
|
1849
1533
|
* Use the `onItemFocus` callback on the tree if you need to monitor a item's focus.
|
|
1850
1534
|
*/
|
|
1851
|
-
onFocus:
|
|
1535
|
+
onFocus: Gt,
|
|
1852
1536
|
/**
|
|
1853
1537
|
* Callback fired when a key of the keyboard is pressed on the item.
|
|
1854
1538
|
*/
|
|
1855
|
-
onKeyDown:
|
|
1539
|
+
onKeyDown: a.func,
|
|
1856
1540
|
/**
|
|
1857
1541
|
* The props used for each component slot.
|
|
1858
1542
|
* @default {}
|
|
1859
1543
|
*/
|
|
1860
|
-
slotProps:
|
|
1544
|
+
slotProps: a.object,
|
|
1861
1545
|
/**
|
|
1862
1546
|
* Overridable component slots.
|
|
1863
1547
|
* @default {}
|
|
1864
1548
|
*/
|
|
1865
|
-
slots:
|
|
1549
|
+
slots: a.object,
|
|
1866
1550
|
/**
|
|
1867
1551
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1868
1552
|
*/
|
|
1869
|
-
sx:
|
|
1553
|
+
sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object])
|
|
1870
1554
|
});
|
|
1871
|
-
const
|
|
1872
|
-
function
|
|
1555
|
+
const Vn = ["ownerState"];
|
|
1556
|
+
function An({
|
|
1873
1557
|
slots: e,
|
|
1874
1558
|
slotProps: t,
|
|
1875
1559
|
label: n,
|
|
1876
|
-
id:
|
|
1877
|
-
itemId:
|
|
1878
|
-
itemsToRender:
|
|
1560
|
+
id: r,
|
|
1561
|
+
itemId: l,
|
|
1562
|
+
itemsToRender: h
|
|
1879
1563
|
}) {
|
|
1880
|
-
const
|
|
1881
|
-
elementType:
|
|
1564
|
+
const g = (e == null ? void 0 : e.item) ?? Ze, p = N({
|
|
1565
|
+
elementType: g,
|
|
1882
1566
|
externalSlotProps: t == null ? void 0 : t.item,
|
|
1883
1567
|
additionalProps: {
|
|
1884
|
-
itemId:
|
|
1885
|
-
id:
|
|
1568
|
+
itemId: l,
|
|
1569
|
+
id: r,
|
|
1886
1570
|
label: n
|
|
1887
1571
|
},
|
|
1888
1572
|
ownerState: {
|
|
1889
|
-
itemId:
|
|
1573
|
+
itemId: l,
|
|
1890
1574
|
label: n
|
|
1891
1575
|
}
|
|
1892
|
-
}),
|
|
1893
|
-
itemsToRender:
|
|
1576
|
+
}), m = A(p, Vn), f = E.useMemo(() => h ? /* @__PURE__ */ S(et, {
|
|
1577
|
+
itemsToRender: h,
|
|
1894
1578
|
slots: e,
|
|
1895
1579
|
slotProps: t
|
|
1896
|
-
}) : null, [
|
|
1897
|
-
return /* @__PURE__ */
|
|
1898
|
-
children:
|
|
1580
|
+
}) : null, [h, e, t]);
|
|
1581
|
+
return /* @__PURE__ */ S(g, C({}, m, {
|
|
1582
|
+
children: f
|
|
1899
1583
|
}));
|
|
1900
1584
|
}
|
|
1901
|
-
function
|
|
1585
|
+
function et(e) {
|
|
1902
1586
|
const {
|
|
1903
1587
|
itemsToRender: t,
|
|
1904
1588
|
slots: n,
|
|
1905
|
-
slotProps:
|
|
1589
|
+
slotProps: r
|
|
1906
1590
|
} = e;
|
|
1907
|
-
return /* @__PURE__ */
|
|
1908
|
-
children: t.map((
|
|
1591
|
+
return /* @__PURE__ */ S(E.Fragment, {
|
|
1592
|
+
children: t.map((l) => /* @__PURE__ */ S(An, {
|
|
1909
1593
|
slots: n,
|
|
1910
|
-
slotProps:
|
|
1911
|
-
label:
|
|
1912
|
-
id:
|
|
1913
|
-
itemId:
|
|
1914
|
-
itemsToRender:
|
|
1915
|
-
},
|
|
1594
|
+
slotProps: r,
|
|
1595
|
+
label: l.label,
|
|
1596
|
+
id: l.id,
|
|
1597
|
+
itemId: l.itemId,
|
|
1598
|
+
itemsToRender: l.children
|
|
1599
|
+
}, l.itemId))
|
|
1916
1600
|
});
|
|
1917
1601
|
}
|
|
1918
|
-
const
|
|
1602
|
+
const Fn = Ue(), Ln = (e) => {
|
|
1919
1603
|
const {
|
|
1920
1604
|
classes: t
|
|
1921
1605
|
} = e;
|
|
1922
|
-
return
|
|
1606
|
+
return ze({
|
|
1923
1607
|
root: ["root"]
|
|
1924
|
-
},
|
|
1925
|
-
},
|
|
1608
|
+
}, Yt, t);
|
|
1609
|
+
}, jn = ie("ul", {
|
|
1926
1610
|
name: "MuiRichTreeView",
|
|
1927
1611
|
slot: "Root",
|
|
1928
1612
|
overridesResolver: (e, t) => t.root
|
|
@@ -1932,42 +1616,42 @@ const Yn = je(), Zn = (e) => {
|
|
|
1932
1616
|
listStyle: "none",
|
|
1933
1617
|
outline: 0,
|
|
1934
1618
|
position: "relative"
|
|
1935
|
-
}),
|
|
1936
|
-
const
|
|
1619
|
+
}), tt = /* @__PURE__ */ E.forwardRef(function(t, n) {
|
|
1620
|
+
const r = Fn({
|
|
1937
1621
|
props: t,
|
|
1938
1622
|
name: "MuiRichTreeView"
|
|
1939
1623
|
});
|
|
1940
|
-
process.env.NODE_ENV !== "production" &&
|
|
1624
|
+
process.env.NODE_ENV !== "production" && r.children != null && xe(["MUI X: The Rich Tree View component does not support JSX children.", "If you want to add items, you need to use the `items` prop.", "Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/items/."]);
|
|
1941
1625
|
const {
|
|
1942
|
-
getRootProps:
|
|
1943
|
-
contextValue:
|
|
1944
|
-
instance:
|
|
1945
|
-
} =
|
|
1946
|
-
plugins:
|
|
1626
|
+
getRootProps: l,
|
|
1627
|
+
contextValue: h,
|
|
1628
|
+
instance: g
|
|
1629
|
+
} = ln({
|
|
1630
|
+
plugins: yn,
|
|
1947
1631
|
rootRef: n,
|
|
1948
|
-
props:
|
|
1632
|
+
props: r
|
|
1949
1633
|
}), {
|
|
1950
|
-
slots:
|
|
1951
|
-
slotProps:
|
|
1952
|
-
} =
|
|
1953
|
-
elementType:
|
|
1954
|
-
externalSlotProps:
|
|
1955
|
-
className:
|
|
1956
|
-
getSlotProps:
|
|
1957
|
-
ownerState:
|
|
1634
|
+
slots: p,
|
|
1635
|
+
slotProps: m
|
|
1636
|
+
} = r, f = Ln(r), o = (p == null ? void 0 : p.root) ?? jn, s = N({
|
|
1637
|
+
elementType: o,
|
|
1638
|
+
externalSlotProps: m == null ? void 0 : m.root,
|
|
1639
|
+
className: f.root,
|
|
1640
|
+
getSlotProps: l,
|
|
1641
|
+
ownerState: r
|
|
1958
1642
|
});
|
|
1959
|
-
return /* @__PURE__ */
|
|
1960
|
-
value:
|
|
1961
|
-
children: /* @__PURE__ */
|
|
1962
|
-
children: /* @__PURE__ */
|
|
1963
|
-
slots:
|
|
1964
|
-
slotProps:
|
|
1965
|
-
itemsToRender:
|
|
1643
|
+
return /* @__PURE__ */ S(an, {
|
|
1644
|
+
value: h,
|
|
1645
|
+
children: /* @__PURE__ */ S(o, C({}, s, {
|
|
1646
|
+
children: /* @__PURE__ */ S(et, {
|
|
1647
|
+
slots: p,
|
|
1648
|
+
slotProps: m,
|
|
1649
|
+
itemsToRender: g.getItemsToRender()
|
|
1966
1650
|
})
|
|
1967
1651
|
}))
|
|
1968
1652
|
});
|
|
1969
1653
|
});
|
|
1970
|
-
process.env.NODE_ENV !== "production" && (
|
|
1654
|
+
process.env.NODE_ENV !== "production" && (tt.propTypes = {
|
|
1971
1655
|
// ----------------------------- Warning --------------------------------
|
|
1972
1656
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1973
1657
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -1975,68 +1659,68 @@ process.env.NODE_ENV !== "production" && (Pt.propTypes = {
|
|
|
1975
1659
|
/**
|
|
1976
1660
|
* The ref object that allows Tree View manipulation. Can be instantiated with `useTreeViewApiRef()`.
|
|
1977
1661
|
*/
|
|
1978
|
-
apiRef:
|
|
1979
|
-
current:
|
|
1980
|
-
focusItem:
|
|
1981
|
-
getItem:
|
|
1982
|
-
getItemDOMElement:
|
|
1983
|
-
getItemOrderedChildrenIds:
|
|
1984
|
-
getItemTree:
|
|
1985
|
-
selectItem:
|
|
1986
|
-
setItemExpansion:
|
|
1987
|
-
updateItemLabel:
|
|
1662
|
+
apiRef: a.shape({
|
|
1663
|
+
current: a.shape({
|
|
1664
|
+
focusItem: a.func.isRequired,
|
|
1665
|
+
getItem: a.func.isRequired,
|
|
1666
|
+
getItemDOMElement: a.func.isRequired,
|
|
1667
|
+
getItemOrderedChildrenIds: a.func.isRequired,
|
|
1668
|
+
getItemTree: a.func.isRequired,
|
|
1669
|
+
selectItem: a.func.isRequired,
|
|
1670
|
+
setItemExpansion: a.func.isRequired,
|
|
1671
|
+
updateItemLabel: a.func.isRequired
|
|
1988
1672
|
})
|
|
1989
1673
|
}),
|
|
1990
1674
|
/**
|
|
1991
1675
|
* If `true`, the Tree View renders a checkbox at the left of its label that allows selecting it.
|
|
1992
1676
|
* @default false
|
|
1993
1677
|
*/
|
|
1994
|
-
checkboxSelection:
|
|
1678
|
+
checkboxSelection: a.bool,
|
|
1995
1679
|
/**
|
|
1996
1680
|
* Override or extend the styles applied to the component.
|
|
1997
1681
|
*/
|
|
1998
|
-
classes:
|
|
1999
|
-
className:
|
|
1682
|
+
classes: a.object,
|
|
1683
|
+
className: a.string,
|
|
2000
1684
|
/**
|
|
2001
1685
|
* Expanded item ids.
|
|
2002
1686
|
* Used when the item's expansion is not controlled.
|
|
2003
1687
|
* @default []
|
|
2004
1688
|
*/
|
|
2005
|
-
defaultExpandedItems:
|
|
1689
|
+
defaultExpandedItems: a.arrayOf(a.string),
|
|
2006
1690
|
/**
|
|
2007
1691
|
* Selected item ids. (Uncontrolled)
|
|
2008
1692
|
* When `multiSelect` is true this takes an array of strings; when false (default) a string.
|
|
2009
1693
|
* @default []
|
|
2010
1694
|
*/
|
|
2011
|
-
defaultSelectedItems:
|
|
1695
|
+
defaultSelectedItems: a.any,
|
|
2012
1696
|
/**
|
|
2013
1697
|
* If `true`, will allow focus on disabled items.
|
|
2014
1698
|
* @default false
|
|
2015
1699
|
*/
|
|
2016
|
-
disabledItemsFocusable:
|
|
1700
|
+
disabledItemsFocusable: a.bool,
|
|
2017
1701
|
/**
|
|
2018
1702
|
* If `true` selection is disabled.
|
|
2019
1703
|
* @default false
|
|
2020
1704
|
*/
|
|
2021
|
-
disableSelection:
|
|
1705
|
+
disableSelection: a.bool,
|
|
2022
1706
|
/**
|
|
2023
1707
|
* Expanded item ids.
|
|
2024
1708
|
* Used when the item's expansion is controlled.
|
|
2025
1709
|
*/
|
|
2026
|
-
expandedItems:
|
|
1710
|
+
expandedItems: a.arrayOf(a.string),
|
|
2027
1711
|
/**
|
|
2028
1712
|
* The slot that triggers the item's expansion when clicked.
|
|
2029
1713
|
* @default 'content'
|
|
2030
1714
|
*/
|
|
2031
|
-
expansionTrigger:
|
|
1715
|
+
expansionTrigger: a.oneOf(["content", "iconContainer"]),
|
|
2032
1716
|
/**
|
|
2033
1717
|
* Unstable features, breaking changes might be introduced.
|
|
2034
1718
|
* For each feature, if the flag is not explicitly set to `true`,
|
|
2035
1719
|
* the feature will be fully disabled and any property / method call will not have any effect.
|
|
2036
1720
|
*/
|
|
2037
|
-
experimentalFeatures:
|
|
2038
|
-
indentationAtItemLevel:
|
|
2039
|
-
labelEditing:
|
|
1721
|
+
experimentalFeatures: a.shape({
|
|
1722
|
+
indentationAtItemLevel: a.bool,
|
|
1723
|
+
labelEditing: a.bool
|
|
2040
1724
|
}),
|
|
2041
1725
|
/**
|
|
2042
1726
|
* Used to determine the id of a given item.
|
|
@@ -2046,7 +1730,7 @@ process.env.NODE_ENV !== "production" && (Pt.propTypes = {
|
|
|
2046
1730
|
* @returns {string} The id of the item.
|
|
2047
1731
|
* @default (item) => item.id
|
|
2048
1732
|
*/
|
|
2049
|
-
getItemId:
|
|
1733
|
+
getItemId: a.func,
|
|
2050
1734
|
/**
|
|
2051
1735
|
* Used to determine the string label for a given item.
|
|
2052
1736
|
*
|
|
@@ -2055,19 +1739,19 @@ process.env.NODE_ENV !== "production" && (Pt.propTypes = {
|
|
|
2055
1739
|
* @returns {string} The label of the item.
|
|
2056
1740
|
* @default (item) => item.label
|
|
2057
1741
|
*/
|
|
2058
|
-
getItemLabel:
|
|
1742
|
+
getItemLabel: a.func,
|
|
2059
1743
|
/**
|
|
2060
1744
|
* This prop is used to help implement the accessibility logic.
|
|
2061
1745
|
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
2062
1746
|
*/
|
|
2063
|
-
id:
|
|
1747
|
+
id: a.string,
|
|
2064
1748
|
/**
|
|
2065
1749
|
* Used to determine if a given item should be disabled.
|
|
2066
1750
|
* @template R
|
|
2067
1751
|
* @param {R} item The item to check.
|
|
2068
1752
|
* @returns {boolean} `true` if the item should be disabled.
|
|
2069
1753
|
*/
|
|
2070
|
-
isItemDisabled:
|
|
1754
|
+
isItemDisabled: a.func,
|
|
2071
1755
|
/**
|
|
2072
1756
|
* Determines if a given item is editable or not.
|
|
2073
1757
|
* Make sure to also enable the `labelEditing` experimental feature:
|
|
@@ -2077,810 +1761,126 @@ process.env.NODE_ENV !== "production" && (Pt.propTypes = {
|
|
|
2077
1761
|
* @param {R} item The item to check.
|
|
2078
1762
|
* @returns {boolean} `true` if the item is editable.
|
|
2079
1763
|
*/
|
|
2080
|
-
isItemEditable:
|
|
1764
|
+
isItemEditable: a.oneOfType([a.func, a.bool]),
|
|
2081
1765
|
/**
|
|
2082
1766
|
* Horizontal indentation between an item and its children.
|
|
2083
1767
|
* Examples: 24, "24px", "2rem", "2em".
|
|
2084
1768
|
* @default 12px
|
|
2085
1769
|
*/
|
|
2086
|
-
itemChildrenIndentation:
|
|
2087
|
-
items:
|
|
1770
|
+
itemChildrenIndentation: a.oneOfType([a.number, a.string]),
|
|
1771
|
+
items: a.array.isRequired,
|
|
2088
1772
|
/**
|
|
2089
1773
|
* If `true`, `ctrl` and `shift` will trigger multiselect.
|
|
2090
1774
|
* @default false
|
|
2091
1775
|
*/
|
|
2092
|
-
multiSelect:
|
|
1776
|
+
multiSelect: a.bool,
|
|
2093
1777
|
/**
|
|
2094
1778
|
* Callback fired when Tree Items are expanded/collapsed.
|
|
2095
1779
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
2096
1780
|
* @param {array} itemIds The ids of the expanded items.
|
|
2097
1781
|
*/
|
|
2098
|
-
onExpandedItemsChange:
|
|
1782
|
+
onExpandedItemsChange: a.func,
|
|
2099
1783
|
/**
|
|
2100
1784
|
* Callback fired when the `content` slot of a given Tree Item is clicked.
|
|
2101
1785
|
* @param {React.MouseEvent} event The DOM event that triggered the change.
|
|
2102
1786
|
* @param {string} itemId The id of the focused item.
|
|
2103
1787
|
*/
|
|
2104
|
-
onItemClick:
|
|
1788
|
+
onItemClick: a.func,
|
|
2105
1789
|
/**
|
|
2106
1790
|
* Callback fired when a Tree Item is expanded or collapsed.
|
|
2107
1791
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
2108
1792
|
* @param {array} itemId The itemId of the modified item.
|
|
2109
1793
|
* @param {array} isExpanded `true` if the item has just been expanded, `false` if it has just been collapsed.
|
|
2110
1794
|
*/
|
|
2111
|
-
onItemExpansionToggle:
|
|
1795
|
+
onItemExpansionToggle: a.func,
|
|
2112
1796
|
/**
|
|
2113
1797
|
* Callback fired when a given Tree Item is focused.
|
|
2114
1798
|
* @param {React.SyntheticEvent | null} event The DOM event that triggered the change. **Warning**: This is a generic event not a focus event.
|
|
2115
1799
|
* @param {string} itemId The id of the focused item.
|
|
2116
1800
|
*/
|
|
2117
|
-
onItemFocus:
|
|
1801
|
+
onItemFocus: a.func,
|
|
2118
1802
|
/**
|
|
2119
1803
|
* Callback fired when the label of an item changes.
|
|
2120
1804
|
* @param {TreeViewItemId} itemId The id of the item that was edited.
|
|
2121
1805
|
* @param {string} newLabel The new label of the items.
|
|
2122
1806
|
*/
|
|
2123
|
-
onItemLabelChange:
|
|
1807
|
+
onItemLabelChange: a.func,
|
|
2124
1808
|
/**
|
|
2125
1809
|
* Callback fired when a Tree Item is selected or deselected.
|
|
2126
1810
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
2127
1811
|
* @param {array} itemId The itemId of the modified item.
|
|
2128
1812
|
* @param {array} isSelected `true` if the item has just been selected, `false` if it has just been deselected.
|
|
2129
1813
|
*/
|
|
2130
|
-
onItemSelectionToggle:
|
|
1814
|
+
onItemSelectionToggle: a.func,
|
|
2131
1815
|
/**
|
|
2132
1816
|
* Callback fired when Tree Items are selected/deselected.
|
|
2133
1817
|
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
2134
1818
|
* @param {string[] | string} itemIds The ids of the selected items.
|
|
2135
1819
|
* When `multiSelect` is `true`, this is an array of strings; when false (default) a string.
|
|
2136
1820
|
*/
|
|
2137
|
-
onSelectedItemsChange:
|
|
1821
|
+
onSelectedItemsChange: a.func,
|
|
2138
1822
|
/**
|
|
2139
1823
|
* Selected item ids. (Controlled)
|
|
2140
1824
|
* When `multiSelect` is true this takes an array of strings; when false (default) a string.
|
|
2141
1825
|
*/
|
|
2142
|
-
selectedItems:
|
|
1826
|
+
selectedItems: a.any,
|
|
2143
1827
|
/**
|
|
2144
1828
|
* The props used for each component slot.
|
|
2145
1829
|
* @default {}
|
|
2146
1830
|
*/
|
|
2147
|
-
slotProps:
|
|
1831
|
+
slotProps: a.object,
|
|
2148
1832
|
/**
|
|
2149
1833
|
* Overridable component slots.
|
|
2150
1834
|
* @default {}
|
|
2151
1835
|
*/
|
|
2152
|
-
slots:
|
|
1836
|
+
slots: a.object,
|
|
2153
1837
|
/**
|
|
2154
1838
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
2155
1839
|
*/
|
|
2156
|
-
sx:
|
|
2157
|
-
});
|
|
2158
|
-
const St = (e) => Array.isArray(e) ? e.length > 0 && e.some(St) : !!e, eo = ({
|
|
2159
|
-
itemId: e,
|
|
2160
|
-
children: t
|
|
2161
|
-
}) => {
|
|
2162
|
-
const {
|
|
2163
|
-
instance: n,
|
|
2164
|
-
selection: {
|
|
2165
|
-
multiSelect: o
|
|
2166
|
-
},
|
|
2167
|
-
publicAPI: i
|
|
2168
|
-
} = ie(), g = {
|
|
2169
|
-
expandable: St(t),
|
|
2170
|
-
expanded: n.isItemExpanded(e),
|
|
2171
|
-
focused: n.isItemFocused(e),
|
|
2172
|
-
selected: n.isItemSelected(e),
|
|
2173
|
-
disabled: n.isItemDisabled(e),
|
|
2174
|
-
editing: n != null && n.isItemBeingEdited ? n == null ? void 0 : n.isItemBeingEdited(e) : !1,
|
|
2175
|
-
editable: n.isItemEditable ? n.isItemEditable(e) : !1
|
|
2176
|
-
}, m = (l) => {
|
|
2177
|
-
if (g.disabled)
|
|
2178
|
-
return;
|
|
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
|
-
if (g.disabled)
|
|
2184
|
-
return;
|
|
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
|
-
itemId: e,
|
|
2188
|
-
keepExistingSelection: !0
|
|
2189
|
-
}) : n.selectItem({
|
|
2190
|
-
event: l,
|
|
2191
|
-
itemId: e,
|
|
2192
|
-
shouldBeSelected: !0
|
|
2193
|
-
});
|
|
2194
|
-
}, u = (l) => {
|
|
2195
|
-
const h = l.nativeEvent.shiftKey;
|
|
2196
|
-
o && h ? n.expandSelectionRange(l, e) : n.selectItem({
|
|
2197
|
-
event: l,
|
|
2198
|
-
itemId: e,
|
|
2199
|
-
keepExistingSelection: o,
|
|
2200
|
-
shouldBeSelected: l.target.checked
|
|
2201
|
-
});
|
|
2202
|
-
}, c = () => {
|
|
2203
|
-
re(n, K) && n.isItemEditable(e) && (n.isItemBeingEdited(e) ? n.setEditedItemId(null) : n.setEditedItemId(e));
|
|
2204
|
-
};
|
|
2205
|
-
return {
|
|
2206
|
-
interactions: {
|
|
2207
|
-
handleExpansion: m,
|
|
2208
|
-
handleSelection: a,
|
|
2209
|
-
handleCheckboxSelection: u,
|
|
2210
|
-
toggleItemEditing: c,
|
|
2211
|
-
handleSaveItemLabel: (l, h) => {
|
|
2212
|
-
re(n, K) && n.isItemBeingEditedRef(e) && (n.updateItemLabel(e, h), c(), n.focusItem(l, e));
|
|
2213
|
-
},
|
|
2214
|
-
handleCancelItemLabelEditing: (l) => {
|
|
2215
|
-
re(n, K) && n.isItemBeingEditedRef(e) && (c(), n.focusItem(l, e));
|
|
2216
|
-
}
|
|
2217
|
-
},
|
|
2218
|
-
status: g,
|
|
2219
|
-
publicAPI: i
|
|
2220
|
-
};
|
|
2221
|
-
}, to = (e) => {
|
|
2222
|
-
const {
|
|
2223
|
-
runItemPlugins: t,
|
|
2224
|
-
items: {
|
|
2225
|
-
onItemClick: n,
|
|
2226
|
-
disabledItemsFocusable: o,
|
|
2227
|
-
indentationAtItemLevel: i
|
|
2228
|
-
},
|
|
2229
|
-
selection: {
|
|
2230
|
-
disableSelection: g,
|
|
2231
|
-
checkboxSelection: m
|
|
2232
|
-
},
|
|
2233
|
-
expansion: {
|
|
2234
|
-
expansionTrigger: a
|
|
2235
|
-
},
|
|
2236
|
-
treeId: u,
|
|
2237
|
-
instance: c,
|
|
2238
|
-
publicAPI: r
|
|
2239
|
-
} = ie(), s = w.useContext(Pe), {
|
|
2240
|
-
id: f,
|
|
2241
|
-
itemId: l,
|
|
2242
|
-
label: h,
|
|
2243
|
-
children: I,
|
|
2244
|
-
rootRef: p
|
|
2245
|
-
} = e, {
|
|
2246
|
-
rootRef: b,
|
|
2247
|
-
contentRef: x,
|
|
2248
|
-
propsEnhancers: R
|
|
2249
|
-
} = t(e), {
|
|
2250
|
-
interactions: M,
|
|
2251
|
-
status: E
|
|
2252
|
-
} = eo({
|
|
2253
|
-
itemId: l,
|
|
2254
|
-
children: I
|
|
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
|
-
id: f
|
|
2259
|
-
}), Q = c.canItemBeTabbed(l) ? 0 : -1, B = {
|
|
2260
|
-
rootRefObject: P,
|
|
2261
|
-
contentRefObject: D,
|
|
2262
|
-
interactions: M
|
|
2263
|
-
}, q = (T) => (y) => {
|
|
2264
|
-
var O;
|
|
2265
|
-
if ((O = T.onFocus) == null || O.call(T, y), y.defaultMuiPrevented)
|
|
2266
|
-
return;
|
|
2267
|
-
const S = !E.disabled || o;
|
|
2268
|
-
!E.focused && S && y.currentTarget === y.target && c.focusItem(y, l);
|
|
2269
|
-
}, X = (T) => (y) => {
|
|
2270
|
-
var O, F, oe, ye, Te;
|
|
2271
|
-
if ((O = T.onBlur) == null || O.call(T, y), y.defaultMuiPrevented)
|
|
2272
|
-
return;
|
|
2273
|
-
const S = c.getItemDOMElement(l);
|
|
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
|
-
// 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
|
-
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
|
-
}, ee = (T) => (y) => {
|
|
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, l);
|
|
2280
|
-
}, Y = (T) => (y) => {
|
|
2281
|
-
var S;
|
|
2282
|
-
(S = T.onDoubleClick) == null || S.call(T, y), !y.defaultMuiPrevented && M.toggleItemEditing();
|
|
2283
|
-
}, te = (T) => (y) => {
|
|
2284
|
-
var S, O;
|
|
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
|
-
}, A = (T) => (y) => {
|
|
2287
|
-
var S;
|
|
2288
|
-
(S = T.onMouseDown) == null || S.call(T, y), !y.defaultMuiPrevented && (y.shiftKey || y.ctrlKey || y.metaKey || E.disabled) && y.preventDefault();
|
|
2289
|
-
}, Z = (T) => (y) => {
|
|
2290
|
-
var S;
|
|
2291
|
-
(S = T.onChange) == null || S.call(T, y), !y.defaultMuiPrevented && (g || E.disabled || M.handleCheckboxSelection(y));
|
|
2292
|
-
}, L = (T) => (y) => {
|
|
2293
|
-
var S;
|
|
2294
|
-
(S = T.onClick) == null || S.call(T, y), !y.defaultMuiPrevented && a === "iconContainer" && M.handleExpansion(y);
|
|
2295
|
-
};
|
|
2296
|
-
return {
|
|
2297
|
-
getRootProps: (T = {}) => {
|
|
2298
|
-
var oe;
|
|
2299
|
-
const y = C({}, U(e), U(T));
|
|
2300
|
-
let S;
|
|
2301
|
-
E.selected ? S = !0 : g || E.disabled ? S = void 0 : S = !1;
|
|
2302
|
-
const O = C({}, y, {
|
|
2303
|
-
ref: N,
|
|
2304
|
-
role: "treeitem",
|
|
2305
|
-
tabIndex: Q,
|
|
2306
|
-
id: j,
|
|
2307
|
-
"aria-expanded": E.expandable ? E.expanded : void 0,
|
|
2308
|
-
"aria-selected": S,
|
|
2309
|
-
"aria-disabled": E.disabled || void 0
|
|
2310
|
-
}, T, {
|
|
2311
|
-
onFocus: q(y),
|
|
2312
|
-
onBlur: X(y),
|
|
2313
|
-
onKeyDown: ee(y)
|
|
2314
|
-
});
|
|
2315
|
-
i && (O.style = {
|
|
2316
|
-
"--TreeView-itemDepth": typeof s == "function" ? s(l) : s
|
|
2317
|
-
});
|
|
2318
|
-
const F = ((oe = R.root) == null ? void 0 : oe.call(R, C({}, B, {
|
|
2319
|
-
externalEventHandlers: y
|
|
2320
|
-
}))) ?? {};
|
|
2321
|
-
return C({}, O, F);
|
|
2322
|
-
},
|
|
2323
|
-
getContentProps: (T = {}) => {
|
|
2324
|
-
var F;
|
|
2325
|
-
const y = U(T), S = C({}, y, T, {
|
|
2326
|
-
ref: z,
|
|
2327
|
-
onClick: te(y),
|
|
2328
|
-
onMouseDown: A(y),
|
|
2329
|
-
status: E
|
|
2330
|
-
});
|
|
2331
|
-
i && (S.indentationAtItemLevel = !0);
|
|
2332
|
-
const O = ((F = R.content) == null ? void 0 : F.call(R, C({}, B, {
|
|
2333
|
-
externalEventHandlers: y
|
|
2334
|
-
}))) ?? {};
|
|
2335
|
-
return C({}, S, O);
|
|
2336
|
-
},
|
|
2337
|
-
getGroupTransitionProps: (T = {}) => {
|
|
2338
|
-
const y = U(T), S = C({}, y, {
|
|
2339
|
-
unmountOnExit: !0,
|
|
2340
|
-
component: "ul",
|
|
2341
|
-
role: "group",
|
|
2342
|
-
in: E.expanded,
|
|
2343
|
-
children: I
|
|
2344
|
-
}, T);
|
|
2345
|
-
return i && (S.indentationAtItemLevel = !0), S;
|
|
2346
|
-
},
|
|
2347
|
-
getIconContainerProps: (T = {}) => {
|
|
2348
|
-
const y = U(T);
|
|
2349
|
-
return C({}, y, T, {
|
|
2350
|
-
onClick: L(y)
|
|
2351
|
-
});
|
|
2352
|
-
},
|
|
2353
|
-
getCheckboxProps: (T = {}) => {
|
|
2354
|
-
const y = U(T);
|
|
2355
|
-
return C({}, y, {
|
|
2356
|
-
visible: m,
|
|
2357
|
-
ref: $,
|
|
2358
|
-
checked: E.selected,
|
|
2359
|
-
disabled: g || E.disabled,
|
|
2360
|
-
tabIndex: -1
|
|
2361
|
-
}, T, {
|
|
2362
|
-
onChange: Z(y)
|
|
2363
|
-
});
|
|
2364
|
-
},
|
|
2365
|
-
getLabelProps: (T = {}) => {
|
|
2366
|
-
const y = C({}, U(T)), S = C({}, y, {
|
|
2367
|
-
children: h
|
|
2368
|
-
}, T, {
|
|
2369
|
-
onDoubleClick: Y(y)
|
|
2370
|
-
});
|
|
2371
|
-
return c.isTreeViewEditable && (S.editable = E.editable), S;
|
|
2372
|
-
},
|
|
2373
|
-
getLabelInputProps: (T = {}) => {
|
|
2374
|
-
var O;
|
|
2375
|
-
const y = U(T), S = ((O = R.labelInput) == null ? void 0 : O.call(R, {
|
|
2376
|
-
rootRefObject: P,
|
|
2377
|
-
contentRefObject: D,
|
|
2378
|
-
externalEventHandlers: y,
|
|
2379
|
-
interactions: M
|
|
2380
|
-
})) ?? {};
|
|
2381
|
-
return C({}, T, S);
|
|
2382
|
-
},
|
|
2383
|
-
getDragAndDropOverlayProps: (T = {}) => {
|
|
2384
|
-
var O;
|
|
2385
|
-
const y = U(T), S = ((O = R.dragAndDropOverlay) == null ? void 0 : O.call(R, C({}, B, {
|
|
2386
|
-
externalEventHandlers: y
|
|
2387
|
-
}))) ?? {};
|
|
2388
|
-
return C({}, T, S);
|
|
2389
|
-
},
|
|
2390
|
-
rootRef: N,
|
|
2391
|
-
status: E,
|
|
2392
|
-
publicAPI: r
|
|
2393
|
-
};
|
|
2394
|
-
}, Mt = to;
|
|
2395
|
-
function kt(e) {
|
|
2396
|
-
const {
|
|
2397
|
-
slots: t,
|
|
2398
|
-
slotProps: n,
|
|
2399
|
-
status: o
|
|
2400
|
-
} = e, i = ie(), g = C({}, i.icons.slots, {
|
|
2401
|
-
expandIcon: i.icons.slots.expandIcon ?? Et,
|
|
2402
|
-
collapseIcon: i.icons.slots.collapseIcon ?? wt
|
|
2403
|
-
}), m = i.icons.slotProps;
|
|
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
|
-
// TODO: Add proper ownerState
|
|
2410
|
-
ownerState: {}
|
|
2411
|
-
});
|
|
2412
|
-
return u ? /* @__PURE__ */ v(u, C({}, c)) : null;
|
|
2413
|
-
}
|
|
2414
|
-
process.env.NODE_ENV !== "production" && (kt.propTypes = {
|
|
2415
|
-
// ----------------------------- Warning --------------------------------
|
|
2416
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
2417
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
2418
|
-
// ----------------------------------------------------------------------
|
|
2419
|
-
/**
|
|
2420
|
-
* The props used for each component slot.
|
|
2421
|
-
* @default {}
|
|
2422
|
-
*/
|
|
2423
|
-
slotProps: d.object,
|
|
2424
|
-
/**
|
|
2425
|
-
* Overridable component slots.
|
|
2426
|
-
* @default {}
|
|
2427
|
-
*/
|
|
2428
|
-
slots: d.object,
|
|
2429
|
-
status: d.shape({
|
|
2430
|
-
disabled: d.bool.isRequired,
|
|
2431
|
-
editable: d.bool.isRequired,
|
|
2432
|
-
editing: d.bool.isRequired,
|
|
2433
|
-
expandable: d.bool.isRequired,
|
|
2434
|
-
expanded: d.bool.isRequired,
|
|
2435
|
-
focused: d.bool.isRequired,
|
|
2436
|
-
selected: d.bool.isRequired
|
|
2437
|
-
}).isRequired
|
|
2438
|
-
});
|
|
2439
|
-
const no = ["visible"], oo = ["id", "itemId", "label", "disabled", "children", "slots", "slotProps"], ro = je(), Dt = _("li", {
|
|
2440
|
-
name: "MuiTreeItem2",
|
|
2441
|
-
slot: "Root",
|
|
2442
|
-
overridesResolver: (e, t) => t.root
|
|
2443
|
-
})({
|
|
2444
|
-
listStyle: "none",
|
|
2445
|
-
margin: 0,
|
|
2446
|
-
padding: 0,
|
|
2447
|
-
outline: 0
|
|
2448
|
-
}), Ot = _("div", {
|
|
2449
|
-
name: "MuiTreeItem2",
|
|
2450
|
-
slot: "Content",
|
|
2451
|
-
overridesResolver: (e, t) => t.content,
|
|
2452
|
-
shouldForwardProp: (e) => pe(e) && e !== "status" && e !== "indentationAtItemLevel"
|
|
2453
|
-
})(({
|
|
2454
|
-
theme: e
|
|
2455
|
-
}) => ({
|
|
2456
|
-
padding: e.spacing(0.5, 1),
|
|
2457
|
-
borderRadius: e.shape.borderRadius,
|
|
2458
|
-
width: "100%",
|
|
2459
|
-
boxSizing: "border-box",
|
|
2460
|
-
// prevent width + padding to overflow
|
|
2461
|
-
position: "relative",
|
|
2462
|
-
display: "flex",
|
|
2463
|
-
alignItems: "center",
|
|
2464
|
-
gap: e.spacing(1),
|
|
2465
|
-
cursor: "pointer",
|
|
2466
|
-
WebkitTapHighlightColor: "transparent",
|
|
2467
|
-
"&:hover": {
|
|
2468
|
-
backgroundColor: (e.vars || e).palette.action.hover,
|
|
2469
|
-
// Reset on touch devices, it doesn't add specificity
|
|
2470
|
-
"@media (hover: none)": {
|
|
2471
|
-
backgroundColor: "transparent"
|
|
2472
|
-
}
|
|
2473
|
-
},
|
|
2474
|
-
variants: [{
|
|
2475
|
-
props: {
|
|
2476
|
-
indentationAtItemLevel: !0
|
|
2477
|
-
},
|
|
2478
|
-
style: {
|
|
2479
|
-
paddingLeft: `calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`
|
|
2480
|
-
}
|
|
2481
|
-
}, {
|
|
2482
|
-
props: ({
|
|
2483
|
-
status: t
|
|
2484
|
-
}) => t.disabled,
|
|
2485
|
-
style: {
|
|
2486
|
-
opacity: (e.vars || e).palette.action.disabledOpacity,
|
|
2487
|
-
backgroundColor: "transparent"
|
|
2488
|
-
}
|
|
2489
|
-
}, {
|
|
2490
|
-
props: ({
|
|
2491
|
-
status: t
|
|
2492
|
-
}) => t.focused,
|
|
2493
|
-
style: {
|
|
2494
|
-
backgroundColor: (e.vars || e).palette.action.focus
|
|
2495
|
-
}
|
|
2496
|
-
}, {
|
|
2497
|
-
props: ({
|
|
2498
|
-
status: t
|
|
2499
|
-
}) => t.selected,
|
|
2500
|
-
style: {
|
|
2501
|
-
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : J(e.palette.primary.main, e.palette.action.selectedOpacity),
|
|
2502
|
-
"&:hover": {
|
|
2503
|
-
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : J(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
|
|
2504
|
-
// Reset on touch devices, it doesn't add specificity
|
|
2505
|
-
"@media (hover: none)": {
|
|
2506
|
-
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : J(e.palette.primary.main, e.palette.action.selectedOpacity)
|
|
2507
|
-
}
|
|
2508
|
-
}
|
|
2509
|
-
}
|
|
2510
|
-
}, {
|
|
2511
|
-
props: ({
|
|
2512
|
-
status: t
|
|
2513
|
-
}) => t.selected && t.focused,
|
|
2514
|
-
style: {
|
|
2515
|
-
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : J(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
|
|
2516
|
-
}
|
|
2517
|
-
}]
|
|
2518
|
-
})), At = _("div", {
|
|
2519
|
-
name: "MuiTreeItem2",
|
|
2520
|
-
slot: "Label",
|
|
2521
|
-
overridesResolver: (e, t) => t.label,
|
|
2522
|
-
shouldForwardProp: (e) => pe(e) && e !== "editable"
|
|
2523
|
-
})(({
|
|
2524
|
-
theme: e
|
|
2525
|
-
}) => C({
|
|
2526
|
-
width: "100%",
|
|
2527
|
-
boxSizing: "border-box",
|
|
2528
|
-
// prevent width + padding to overflow
|
|
2529
|
-
// fixes overflow - see https://github.com/mui/material-ui/issues/27372
|
|
2530
|
-
minWidth: 0,
|
|
2531
|
-
position: "relative",
|
|
2532
|
-
overflow: "hidden"
|
|
2533
|
-
}, e.typography.body1, {
|
|
2534
|
-
variants: [{
|
|
2535
|
-
props: ({
|
|
2536
|
-
editable: t
|
|
2537
|
-
}) => t,
|
|
2538
|
-
style: {
|
|
2539
|
-
paddingLeft: "2px"
|
|
2540
|
-
}
|
|
2541
|
-
}]
|
|
2542
|
-
})), Lt = _("div", {
|
|
2543
|
-
name: "MuiTreeItem2",
|
|
2544
|
-
slot: "IconContainer",
|
|
2545
|
-
overridesResolver: (e, t) => t.iconContainer
|
|
2546
|
-
})({
|
|
2547
|
-
width: 16,
|
|
2548
|
-
display: "flex",
|
|
2549
|
-
flexShrink: 0,
|
|
2550
|
-
justifyContent: "center",
|
|
2551
|
-
"& svg": {
|
|
2552
|
-
fontSize: 18
|
|
2553
|
-
}
|
|
2554
|
-
}), Vt = _(lt, {
|
|
2555
|
-
name: "MuiTreeItem2",
|
|
2556
|
-
slot: "GroupTransition",
|
|
2557
|
-
overridesResolver: (e, t) => t.groupTransition,
|
|
2558
|
-
shouldForwardProp: (e) => pe(e) && e !== "indentationAtItemLevel"
|
|
2559
|
-
})({
|
|
2560
|
-
margin: 0,
|
|
2561
|
-
padding: 0,
|
|
2562
|
-
paddingLeft: "var(--TreeView-itemChildrenIndentation)",
|
|
2563
|
-
variants: [{
|
|
2564
|
-
props: {
|
|
2565
|
-
indentationAtItemLevel: !0
|
|
2566
|
-
},
|
|
2567
|
-
style: {
|
|
2568
|
-
paddingLeft: 0
|
|
2569
|
-
}
|
|
2570
|
-
}]
|
|
2571
|
-
}), io = _(/* @__PURE__ */ w.forwardRef((e, t) => {
|
|
2572
|
-
const {
|
|
2573
|
-
visible: n
|
|
2574
|
-
} = e, o = G(e, no);
|
|
2575
|
-
return n ? /* @__PURE__ */ v(at, C({}, o, {
|
|
2576
|
-
ref: t
|
|
2577
|
-
})) : null;
|
|
2578
|
-
}), {
|
|
2579
|
-
name: "MuiTreeItem2",
|
|
2580
|
-
slot: "Checkbox",
|
|
2581
|
-
overridesResolver: (e, t) => t.checkbox
|
|
2582
|
-
})({
|
|
2583
|
-
padding: 0
|
|
2584
|
-
}), so = (e) => {
|
|
2585
|
-
const {
|
|
2586
|
-
classes: t
|
|
2587
|
-
} = e;
|
|
2588
|
-
return Ne({
|
|
2589
|
-
root: ["root"],
|
|
2590
|
-
content: ["content"],
|
|
2591
|
-
expanded: ["expanded"],
|
|
2592
|
-
editing: ["editing"],
|
|
2593
|
-
editable: ["editable"],
|
|
2594
|
-
selected: ["selected"],
|
|
2595
|
-
focused: ["focused"],
|
|
2596
|
-
disabled: ["disabled"],
|
|
2597
|
-
iconContainer: ["iconContainer"],
|
|
2598
|
-
checkbox: ["checkbox"],
|
|
2599
|
-
label: ["label"],
|
|
2600
|
-
groupTransition: ["groupTransition"],
|
|
2601
|
-
labelInput: ["labelInput"],
|
|
2602
|
-
dragAndDropOverlay: ["dragAndDropOverlay"]
|
|
2603
|
-
}, Ct, t);
|
|
2604
|
-
}, lo = /* @__PURE__ */ w.forwardRef(function(t, n) {
|
|
2605
|
-
const o = ro({
|
|
2606
|
-
props: t,
|
|
2607
|
-
name: "MuiTreeItem2"
|
|
2608
|
-
}), {
|
|
2609
|
-
id: i,
|
|
2610
|
-
itemId: g,
|
|
2611
|
-
label: m,
|
|
2612
|
-
disabled: a,
|
|
2613
|
-
children: u,
|
|
2614
|
-
slots: c = {},
|
|
2615
|
-
slotProps: r = {}
|
|
2616
|
-
} = o, s = G(o, oo), {
|
|
2617
|
-
getRootProps: f,
|
|
2618
|
-
getContentProps: l,
|
|
2619
|
-
getIconContainerProps: h,
|
|
2620
|
-
getCheckboxProps: I,
|
|
2621
|
-
getLabelProps: p,
|
|
2622
|
-
getGroupTransitionProps: b,
|
|
2623
|
-
getLabelInputProps: x,
|
|
2624
|
-
getDragAndDropOverlayProps: R,
|
|
2625
|
-
status: M
|
|
2626
|
-
} = Mt({
|
|
2627
|
-
id: i,
|
|
2628
|
-
itemId: g,
|
|
2629
|
-
children: u,
|
|
2630
|
-
label: m,
|
|
2631
|
-
disabled: a
|
|
2632
|
-
}), E = C({}, o, M), P = so(E), D = c.root ?? Dt, N = V({
|
|
2633
|
-
elementType: D,
|
|
2634
|
-
getSlotProps: f,
|
|
2635
|
-
externalForwardedProps: s,
|
|
2636
|
-
externalSlotProps: r.root,
|
|
2637
|
-
additionalProps: {
|
|
2638
|
-
ref: n
|
|
2639
|
-
},
|
|
2640
|
-
ownerState: {},
|
|
2641
|
-
className: P.root
|
|
2642
|
-
}), z = c.content ?? Ot, $ = V({
|
|
2643
|
-
elementType: z,
|
|
2644
|
-
getSlotProps: l,
|
|
2645
|
-
externalSlotProps: r.content,
|
|
2646
|
-
ownerState: {},
|
|
2647
|
-
className: $e(P.content, M.expanded && P.expanded, M.selected && P.selected, M.focused && P.focused, M.disabled && P.disabled, M.editing && P.editing, M.editable && P.editable)
|
|
2648
|
-
}), j = c.iconContainer ?? Lt, Q = V({
|
|
2649
|
-
elementType: j,
|
|
2650
|
-
getSlotProps: h,
|
|
2651
|
-
externalSlotProps: r.iconContainer,
|
|
2652
|
-
ownerState: {},
|
|
2653
|
-
className: P.iconContainer
|
|
2654
|
-
}), B = c.label ?? At, q = V({
|
|
2655
|
-
elementType: B,
|
|
2656
|
-
getSlotProps: p,
|
|
2657
|
-
externalSlotProps: r.label,
|
|
2658
|
-
ownerState: {},
|
|
2659
|
-
className: P.label
|
|
2660
|
-
}), X = c.checkbox ?? io, ee = V({
|
|
2661
|
-
elementType: X,
|
|
2662
|
-
getSlotProps: I,
|
|
2663
|
-
externalSlotProps: r.checkbox,
|
|
2664
|
-
ownerState: {},
|
|
2665
|
-
className: P.checkbox
|
|
2666
|
-
}), Y = c.groupTransition ?? void 0, te = V({
|
|
2667
|
-
elementType: Y,
|
|
2668
|
-
getSlotProps: b,
|
|
2669
|
-
externalSlotProps: r.groupTransition,
|
|
2670
|
-
ownerState: {},
|
|
2671
|
-
className: P.groupTransition
|
|
2672
|
-
}), A = c.labelInput ?? Tt, Z = V({
|
|
2673
|
-
elementType: A,
|
|
2674
|
-
getSlotProps: x,
|
|
2675
|
-
externalSlotProps: r.labelInput,
|
|
2676
|
-
ownerState: {},
|
|
2677
|
-
className: P.labelInput
|
|
2678
|
-
}), L = c.dragAndDropOverlay ?? ze, ne = V({
|
|
2679
|
-
elementType: L,
|
|
2680
|
-
getSlotProps: R,
|
|
2681
|
-
externalSlotProps: r.dragAndDropOverlay,
|
|
2682
|
-
ownerState: {},
|
|
2683
|
-
className: P.dragAndDropOverlay
|
|
2684
|
-
});
|
|
2685
|
-
return /* @__PURE__ */ v(ke, {
|
|
2686
|
-
itemId: g,
|
|
2687
|
-
children: /* @__PURE__ */ de(D, C({}, N, {
|
|
2688
|
-
children: [/* @__PURE__ */ de(z, C({}, $, {
|
|
2689
|
-
children: [/* @__PURE__ */ v(j, C({}, Q, {
|
|
2690
|
-
children: /* @__PURE__ */ v(kt, {
|
|
2691
|
-
status: M,
|
|
2692
|
-
slots: c,
|
|
2693
|
-
slotProps: r
|
|
2694
|
-
})
|
|
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
|
-
as: Y
|
|
2698
|
-
}, te))]
|
|
2699
|
-
}))
|
|
2700
|
-
});
|
|
2701
|
-
});
|
|
2702
|
-
process.env.NODE_ENV !== "production" && (lo.propTypes = {
|
|
2703
|
-
// ----------------------------- Warning --------------------------------
|
|
2704
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
2705
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
2706
|
-
// ----------------------------------------------------------------------
|
|
2707
|
-
/**
|
|
2708
|
-
* The content of the component.
|
|
2709
|
-
*/
|
|
2710
|
-
children: d.node,
|
|
2711
|
-
/**
|
|
2712
|
-
* Override or extend the styles applied to the component.
|
|
2713
|
-
*/
|
|
2714
|
-
classes: d.object,
|
|
2715
|
-
className: d.string,
|
|
2716
|
-
/**
|
|
2717
|
-
* If `true`, the item is disabled.
|
|
2718
|
-
* @default false
|
|
2719
|
-
*/
|
|
2720
|
-
disabled: d.bool,
|
|
2721
|
-
/**
|
|
2722
|
-
* The id attribute of the item. If not provided, it will be generated.
|
|
2723
|
-
*/
|
|
2724
|
-
id: d.string,
|
|
2725
|
-
/**
|
|
2726
|
-
* The id of the item.
|
|
2727
|
-
* Must be unique.
|
|
2728
|
-
*/
|
|
2729
|
-
itemId: d.string.isRequired,
|
|
2730
|
-
/**
|
|
2731
|
-
* The label of the item.
|
|
2732
|
-
*/
|
|
2733
|
-
label: d.node,
|
|
2734
|
-
/**
|
|
2735
|
-
* Callback fired when the item root is blurred.
|
|
2736
|
-
*/
|
|
2737
|
-
onBlur: d.func,
|
|
2738
|
-
/**
|
|
2739
|
-
* This prop isn't supported.
|
|
2740
|
-
* Use the `onItemFocus` callback on the tree if you need to monitor an item's focus.
|
|
2741
|
-
*/
|
|
2742
|
-
onFocus: ct,
|
|
2743
|
-
/**
|
|
2744
|
-
* Callback fired when a key is pressed on the keyboard and the tree is in focus.
|
|
2745
|
-
*/
|
|
2746
|
-
onKeyDown: d.func,
|
|
2747
|
-
/**
|
|
2748
|
-
* The props used for each component slot.
|
|
2749
|
-
* @default {}
|
|
2750
|
-
*/
|
|
2751
|
-
slotProps: d.object,
|
|
2752
|
-
/**
|
|
2753
|
-
* Overridable component slots.
|
|
2754
|
-
* @default {}
|
|
2755
|
-
*/
|
|
2756
|
-
slots: d.object
|
|
1840
|
+
sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object])
|
|
2757
1841
|
});
|
|
2758
|
-
|
|
2759
|
-
const co = (e, t) => {
|
|
2760
|
-
if (!e) return Ve;
|
|
2761
|
-
if (typeof e != "string") return e;
|
|
2762
|
-
switch (e) {
|
|
2763
|
-
case "SHARE":
|
|
2764
|
-
return an;
|
|
2765
|
-
case "TRASH":
|
|
2766
|
-
return Qt;
|
|
2767
|
-
case "CUSTOM":
|
|
2768
|
-
return t || Ve;
|
|
2769
|
-
case "FOLDER":
|
|
2770
|
-
default:
|
|
2771
|
-
return Ve;
|
|
2772
|
-
}
|
|
2773
|
-
}, uo = Yt(function(t, n) {
|
|
2774
|
-
const {
|
|
2775
|
-
id: o,
|
|
2776
|
-
itemId: i,
|
|
2777
|
-
label: g,
|
|
2778
|
-
disabled: m,
|
|
2779
|
-
children: a,
|
|
2780
|
-
itemData: u,
|
|
2781
|
-
iconColor: c = "primary"
|
|
2782
|
-
} = t, r = co(
|
|
2783
|
-
u == null ? void 0 : u.iconType,
|
|
2784
|
-
u == null ? void 0 : u.customIcon
|
|
2785
|
-
), {
|
|
2786
|
-
getRootProps: s,
|
|
2787
|
-
getContentProps: f,
|
|
2788
|
-
getLabelProps: l,
|
|
2789
|
-
getGroupTransitionProps: h,
|
|
2790
|
-
getIconContainerProps: I,
|
|
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
|
-
/* @__PURE__ */ de(
|
|
2795
|
-
Ot,
|
|
2796
|
-
{
|
|
2797
|
-
...f(),
|
|
2798
|
-
style: { display: "flex", alignItems: "center", width: "100%" },
|
|
2799
|
-
children: [
|
|
2800
|
-
/* @__PURE__ */ v(Lt, { ...I(), children: /* @__PURE__ */ v(r, { fontSize: "small", color: c }) }),
|
|
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
|
-
]
|
|
2804
|
-
}
|
|
2805
|
-
),
|
|
2806
|
-
a && /* @__PURE__ */ v(
|
|
2807
|
-
Vt,
|
|
2808
|
-
{
|
|
2809
|
-
...h(),
|
|
2810
|
-
style: p.expanded ? {
|
|
2811
|
-
borderLeft: "1px solid #bdbdbd",
|
|
2812
|
-
paddingLeft: "12px",
|
|
2813
|
-
marginLeft: "15px",
|
|
2814
|
-
marginTop: "4px",
|
|
2815
|
-
marginBottom: "4px"
|
|
2816
|
-
} : void 0
|
|
2817
|
-
}
|
|
2818
|
-
)
|
|
2819
|
-
] }) });
|
|
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 = ({
|
|
1842
|
+
const so = ({
|
|
2843
1843
|
items: e,
|
|
2844
1844
|
selectedItemId: t,
|
|
2845
1845
|
handleSelectedItemChange: n,
|
|
2846
|
-
iconColor:
|
|
1846
|
+
iconColor: r = "primary"
|
|
2847
1847
|
}) => {
|
|
2848
|
-
const [
|
|
2849
|
-
return
|
|
1848
|
+
const [l, h] = Ct([]), g = wt(() => St(e), [e]);
|
|
1849
|
+
return Rt(() => {
|
|
2850
1850
|
if (t) {
|
|
2851
|
-
const
|
|
2852
|
-
if (
|
|
2853
|
-
const
|
|
2854
|
-
|
|
2855
|
-
const s = [...
|
|
2856
|
-
let
|
|
2857
|
-
return
|
|
2858
|
-
s.includes(
|
|
2859
|
-
}),
|
|
1851
|
+
const m = Pt(e, t);
|
|
1852
|
+
if (m) {
|
|
1853
|
+
const f = m.slice(0, -1);
|
|
1854
|
+
h((o) => {
|
|
1855
|
+
const s = [...o];
|
|
1856
|
+
let u = !1;
|
|
1857
|
+
return f.forEach((b) => {
|
|
1858
|
+
s.includes(b) || (s.push(b), u = !0);
|
|
1859
|
+
}), u ? s : o;
|
|
2860
1860
|
});
|
|
2861
1861
|
}
|
|
2862
1862
|
}
|
|
2863
|
-
}, [t, e]), /* @__PURE__ */
|
|
2864
|
-
|
|
1863
|
+
}, [t, e]), /* @__PURE__ */ S(yt, { sx: kt, children: /* @__PURE__ */ S(
|
|
1864
|
+
tt,
|
|
2865
1865
|
{
|
|
2866
1866
|
items: e,
|
|
2867
1867
|
selectedItems: t,
|
|
2868
|
-
expandedItems:
|
|
2869
|
-
onExpandedItemsChange: (
|
|
2870
|
-
|
|
1868
|
+
expandedItems: l,
|
|
1869
|
+
onExpandedItemsChange: (m, f) => {
|
|
1870
|
+
h(f);
|
|
2871
1871
|
},
|
|
2872
1872
|
itemChildrenIndentation: "50px",
|
|
2873
1873
|
onSelectedItemsChange: n,
|
|
2874
|
-
getItemId:
|
|
1874
|
+
getItemId: vt,
|
|
2875
1875
|
slots: {
|
|
2876
|
-
item: (
|
|
2877
|
-
const
|
|
2878
|
-
return /* @__PURE__ */
|
|
2879
|
-
|
|
1876
|
+
item: (m) => {
|
|
1877
|
+
const f = m.itemId ? g[m.itemId] : void 0;
|
|
1878
|
+
return /* @__PURE__ */ S(
|
|
1879
|
+
Ut,
|
|
2880
1880
|
{
|
|
2881
|
-
...
|
|
2882
|
-
itemData:
|
|
2883
|
-
iconColor:
|
|
1881
|
+
...m,
|
|
1882
|
+
itemData: f,
|
|
1883
|
+
iconColor: r
|
|
2884
1884
|
}
|
|
2885
1885
|
);
|
|
2886
1886
|
}
|
|
@@ -2889,6 +1889,5 @@ const co = (e, t) => {
|
|
|
2889
1889
|
) });
|
|
2890
1890
|
};
|
|
2891
1891
|
export {
|
|
2892
|
-
|
|
2893
|
-
Lo as default
|
|
1892
|
+
so as default
|
|
2894
1893
|
};
|