@cgi-learning-hub/ui 1.4.0-dev.1741982096 → 1.4.0-dev.1741984172
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/CustomTreeItem-DgZ-fuHz.js +1002 -0
- package/dist/CustomTreeItem-GHUeoYTN.cjs +3 -0
- package/dist/{DatePicker-CHNHFeLy.js → DatePicker-DaT-qAZU.js} +12 -11
- package/dist/{DatePicker-BZ6G6Mxd.cjs → DatePicker-DkydayAf.cjs} +10 -10
- package/dist/{Menu-DTOOgx49.js → Menu-DSnqz2vn.js} +6 -5
- package/dist/Menu-i8E6r9PD.cjs +7 -0
- package/dist/{MenuItem-rnMlnHRT.js → MenuItem-NWsmBFYK.js} +1 -1
- package/dist/{MenuItem-CCjOFEgY.cjs → MenuItem-wiWkmrFx.cjs} +1 -1
- package/dist/Popper-BaxEpkdE.cjs +4 -0
- package/dist/{Popper-Cx071JBT.js → Popper-_C0wi25V.js} +9 -8
- package/dist/{Select-bVUll7Rd.js → Select-0z3QAnXt.js} +1 -1
- package/dist/{Select-CHq7l5LD.cjs → Select-lkqCWjKv.cjs} +1 -1
- package/dist/{Tabs-Cl4eoKT1.js → Tabs-BZR0EQUH.js} +2 -1
- package/dist/Tabs-Csp29aqN.cjs +4 -0
- package/dist/{TextField-VHCImaQP.js → TextField-CTpcZJul.js} +1 -1
- package/dist/{TextField-DQ2FvwDM.cjs → TextField-O962H25y.cjs} +1 -1
- package/dist/{ToggleButtonGroup-BGZ43Mpb.cjs → ToggleButtonGroup-BS5pAoPi.cjs} +29 -29
- package/dist/{ToggleButtonGroup--eIRTlqD.js → ToggleButtonGroup-CEUzgXdi.js} +118 -117
- package/dist/{Tooltip-BM3r5yvP.js → Tooltip--oCu4BBR.js} +2 -2
- package/dist/Tooltip-DJmbLjU6.cjs +4 -0
- 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/PasswordInput/PasswordInput.cjs.js +1 -1
- package/dist/components/PasswordInput/PasswordInput.es.js +1 -1
- 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 +948 -1949
- 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 +8 -8
- package/dist/components/stories/DatePicker.stories.cjs.js +1 -1
- package/dist/components/stories/DatePicker.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/Select.stories.cjs.js +1 -1
- package/dist/components/stories/Select.stories.es.js +2 -2
- package/dist/components/stories/TabList.stories.cjs.js +1 -1
- package/dist/components/stories/TabList.stories.es.js +1 -1
- 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 +1 -1
- package/dist/components/stories/TreeView.stories.cjs.js +2 -2
- package/dist/components/stories/TreeView.stories.d.ts +1 -1
- package/dist/components/stories/TreeView.stories.es.js +67 -76
- package/dist/index-BvBogk4x.js +22 -0
- package/dist/index-Cr54V0sz.cjs +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +8 -8
- package/dist/useSlotProps-BTRhbYwP.cjs +1 -0
- package/dist/useSlotProps-D6vB9uUw.js +25 -0
- package/package.json +1 -1
- package/dist/Menu-CGrqZ9-7.cjs +0 -7
- package/dist/Popper-AHwSSh80.cjs +0 -4
- package/dist/Tabs-AyJ_tKtV.cjs +0 -4
- package/dist/Tooltip-BLQHNepC.cjs +0 -4
- package/dist/useSlotProps-C9tsxDNg.js +0 -45
- package/dist/useSlotProps-CvOxvhyy.cjs +0 -1
|
@@ -0,0 +1,1002 @@
|
|
|
1
|
+
import { jsx as x, jsxs as W } from "react/jsx-runtime";
|
|
2
|
+
import * as R from "react";
|
|
3
|
+
import { forwardRef as Pe } from "react";
|
|
4
|
+
import { c as X } from "./createSvgIcon-K1Hd8ryN.js";
|
|
5
|
+
import { B as Re } from "./Box-DgqaLb7j.js";
|
|
6
|
+
import { _ as b } from "./ButtonBase-IZ_QjbpE.js";
|
|
7
|
+
import { w as Ee } from "./warning-C8W811fV.js";
|
|
8
|
+
import { u as le } from "./useForkRef-C_4o__cU.js";
|
|
9
|
+
import { e as D, r as de } from "./resolveComponentProps-CPmhKPdH.js";
|
|
10
|
+
import { getIconComponent as Oe } from "./components/TreeView/utils.es.js";
|
|
11
|
+
import { treeContentStyle as Se, arrowContainerStyle as De, expandedGroupStyle as ke } from "./components/TreeView/style.es.js";
|
|
12
|
+
import { n as B, P as y, H as Me, I as Le, G as Ne } from "./generateUtilityClasses-DotvgSDH.js";
|
|
13
|
+
import { a as ue } from "./TransitionGroupContext-DbLioz_6.js";
|
|
14
|
+
import { u as Ve } from "./useThemeProps-BTfGtNci.js";
|
|
15
|
+
import { s as M, f as Y, c as Ae } from "./DefaultPropsProvider-Cqcb4sws.js";
|
|
16
|
+
import { C as Be } from "./Collapse-CLl0D4CI.js";
|
|
17
|
+
import { C as Ke } from "./Checkbox-DgU-0k3O.js";
|
|
18
|
+
import { u as $e } from "./unsupportedProp-BuVD30Gh.js";
|
|
19
|
+
import { u as k } from "./useSlotProps-D6vB9uUw.js";
|
|
20
|
+
const Fe = X(/* @__PURE__ */ x("path", {
|
|
21
|
+
d: "M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"
|
|
22
|
+
}), "KeyboardArrowDown"), je = X(/* @__PURE__ */ x("path", {
|
|
23
|
+
d: "M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"
|
|
24
|
+
}), "KeyboardArrowRight");
|
|
25
|
+
function qe(e) {
|
|
26
|
+
return Ve;
|
|
27
|
+
}
|
|
28
|
+
let ce = 0;
|
|
29
|
+
const Lt = () => (ce += 1, `mui-tree-view-${ce}`), ze = ({
|
|
30
|
+
id: e,
|
|
31
|
+
treeId: t = "",
|
|
32
|
+
itemId: o
|
|
33
|
+
}) => e ?? `${t}-${o}`, be = /* @__PURE__ */ R.createContext(null);
|
|
34
|
+
process.env.NODE_ENV !== "production" && (be.displayName = "TreeViewContext");
|
|
35
|
+
const K = () => {
|
|
36
|
+
const e = R.useContext(be);
|
|
37
|
+
if (e == null)
|
|
38
|
+
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(`
|
|
39
|
+
`));
|
|
40
|
+
return e;
|
|
41
|
+
}, ge = /* @__PURE__ */ R.createContext(() => -1);
|
|
42
|
+
process.env.NODE_ENV !== "production" && (ge.displayName = "TreeViewItemDepthContext");
|
|
43
|
+
const me = (e, t) => {
|
|
44
|
+
let o = t.length - 1;
|
|
45
|
+
for (; o >= 0 && !e.isItemNavigable(t[o]); )
|
|
46
|
+
o -= 1;
|
|
47
|
+
if (o !== -1)
|
|
48
|
+
return t[o];
|
|
49
|
+
}, _e = (e, t) => {
|
|
50
|
+
const o = e.getItemMeta(t), a = e.getItemOrderedChildrenIds(o.parentId), c = e.getItemIndex(t);
|
|
51
|
+
if (c === 0)
|
|
52
|
+
return o.parentId;
|
|
53
|
+
let l = c - 1;
|
|
54
|
+
for (; !e.isItemNavigable(a[l]) && l >= 0; )
|
|
55
|
+
l -= 1;
|
|
56
|
+
if (l === -1)
|
|
57
|
+
return o.parentId == null ? null : _e(e, o.parentId);
|
|
58
|
+
let m = a[l], s = me(e, e.getItemOrderedChildrenIds(m));
|
|
59
|
+
for (; e.isItemExpanded(m) && s != null; )
|
|
60
|
+
m = s, s = e.getItemOrderedChildrenIds(m).find(e.isItemNavigable);
|
|
61
|
+
return m;
|
|
62
|
+
}, Ue = (e, t) => {
|
|
63
|
+
if (e.isItemExpanded(t)) {
|
|
64
|
+
const a = e.getItemOrderedChildrenIds(t).find(e.isItemNavigable);
|
|
65
|
+
if (a != null)
|
|
66
|
+
return a;
|
|
67
|
+
}
|
|
68
|
+
let o = e.getItemMeta(t);
|
|
69
|
+
for (; o != null; ) {
|
|
70
|
+
const a = e.getItemOrderedChildrenIds(o.parentId), c = e.getItemIndex(o.id);
|
|
71
|
+
if (c < a.length - 1) {
|
|
72
|
+
let l = c + 1;
|
|
73
|
+
for (; !e.isItemNavigable(a[l]) && l < a.length - 1; )
|
|
74
|
+
l += 1;
|
|
75
|
+
if (e.isItemNavigable(a[l]))
|
|
76
|
+
return a[l];
|
|
77
|
+
}
|
|
78
|
+
o = e.getItemMeta(o.parentId);
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}, Nt = (e) => {
|
|
82
|
+
let t = null;
|
|
83
|
+
for (; t == null || e.isItemExpanded(t); ) {
|
|
84
|
+
const o = e.getItemOrderedChildrenIds(t), a = me(e, o);
|
|
85
|
+
if (a == null)
|
|
86
|
+
return t;
|
|
87
|
+
t = a;
|
|
88
|
+
}
|
|
89
|
+
return t;
|
|
90
|
+
}, Ge = (e) => e.getItemOrderedChildrenIds(null).find(e.isItemNavigable), We = (e, t, o) => {
|
|
91
|
+
if (t === o)
|
|
92
|
+
return [t, o];
|
|
93
|
+
const a = e.getItemMeta(t), c = e.getItemMeta(o);
|
|
94
|
+
if (a.parentId === c.id || c.parentId === a.id)
|
|
95
|
+
return c.parentId === a.id ? [a.id, c.id] : [c.id, a.id];
|
|
96
|
+
const l = [a.id], m = [c.id];
|
|
97
|
+
let s = a.parentId, u = c.parentId, p = m.indexOf(s) !== -1, I = l.indexOf(u) !== -1, g = !0, T = !0;
|
|
98
|
+
for (; !I && !p; )
|
|
99
|
+
g && (l.push(s), p = m.indexOf(s) !== -1, g = s !== null, !p && g && (s = e.getItemMeta(s).parentId)), T && !p && (m.push(u), I = l.indexOf(u) !== -1, T = u !== null, !I && T && (u = e.getItemMeta(u).parentId));
|
|
100
|
+
const r = p ? s : u, f = e.getItemOrderedChildrenIds(r), E = l[l.indexOf(r) - 1], S = m[m.indexOf(r) - 1];
|
|
101
|
+
return f.indexOf(E) < f.indexOf(S) ? [t, o] : [o, t];
|
|
102
|
+
}, Vt = (e, t, o) => {
|
|
103
|
+
const a = (u) => {
|
|
104
|
+
if (e.isItemExpandable(u) && e.isItemExpanded(u))
|
|
105
|
+
return e.getItemOrderedChildrenIds(u)[0];
|
|
106
|
+
let p = e.getItemMeta(u);
|
|
107
|
+
for (; p != null; ) {
|
|
108
|
+
const I = e.getItemOrderedChildrenIds(p.parentId), g = e.getItemIndex(p.id);
|
|
109
|
+
if (g < I.length - 1)
|
|
110
|
+
return I[g + 1];
|
|
111
|
+
p = e.getItemMeta(p.parentId);
|
|
112
|
+
}
|
|
113
|
+
throw new Error("Invalid range");
|
|
114
|
+
}, [c, l] = We(e, t, o), m = [c];
|
|
115
|
+
let s = c;
|
|
116
|
+
for (; s !== l; )
|
|
117
|
+
s = a(s), e.isItemDisabled(s) || m.push(s);
|
|
118
|
+
return m;
|
|
119
|
+
}, At = (e) => {
|
|
120
|
+
let t = Ge(e);
|
|
121
|
+
const o = [];
|
|
122
|
+
for (; t != null; )
|
|
123
|
+
o.push(t), t = Ue(e, t);
|
|
124
|
+
return o;
|
|
125
|
+
}, pe = (e, t) => t !== e.closest('*[role="treeitem"]'), ne = (e, t) => e.getAvailablePlugins().has(t), Xe = ({
|
|
126
|
+
props: e
|
|
127
|
+
}) => {
|
|
128
|
+
const {
|
|
129
|
+
instance: t
|
|
130
|
+
} = K(), {
|
|
131
|
+
label: o,
|
|
132
|
+
itemId: a
|
|
133
|
+
} = e, [c, l] = R.useState(o), m = t.isItemBeingEdited(a);
|
|
134
|
+
return R.useEffect(() => {
|
|
135
|
+
m || l(o);
|
|
136
|
+
}, [m, o]), {
|
|
137
|
+
propsEnhancers: {
|
|
138
|
+
labelInput: ({
|
|
139
|
+
externalEventHandlers: s,
|
|
140
|
+
interactions: u
|
|
141
|
+
}) => t.isItemEditable(a) ? {
|
|
142
|
+
value: c ?? "",
|
|
143
|
+
"data-element": "labelInput",
|
|
144
|
+
onChange: (r) => {
|
|
145
|
+
var f;
|
|
146
|
+
(f = s.onChange) == null || f.call(s, r), l(r.target.value);
|
|
147
|
+
},
|
|
148
|
+
onKeyDown: (r) => {
|
|
149
|
+
var E;
|
|
150
|
+
if ((E = s.onKeyDown) == null || E.call(s, r), r.defaultMuiPrevented)
|
|
151
|
+
return;
|
|
152
|
+
const f = r.target;
|
|
153
|
+
r.key === "Enter" && f.value ? u.handleSaveItemLabel(r, f.value) : r.key === "Escape" && u.handleCancelItemLabelEditing(r);
|
|
154
|
+
},
|
|
155
|
+
onBlur: (r) => {
|
|
156
|
+
var f;
|
|
157
|
+
(f = s.onBlur) == null || f.call(s, r), !r.defaultMuiPrevented && r.target.value && u.handleSaveItemLabel(r, r.target.value);
|
|
158
|
+
},
|
|
159
|
+
autoFocus: !0,
|
|
160
|
+
type: "text"
|
|
161
|
+
} : {}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
}, L = ({
|
|
165
|
+
instance: e,
|
|
166
|
+
state: t,
|
|
167
|
+
setState: o,
|
|
168
|
+
params: a
|
|
169
|
+
}) => {
|
|
170
|
+
const c = R.useRef(t.editedItemId), l = (g) => c.current === g, m = (g) => {
|
|
171
|
+
o((T) => b({}, T, {
|
|
172
|
+
editedItemId: g
|
|
173
|
+
})), c.current = g;
|
|
174
|
+
}, s = (g) => g === t.editedItemId, u = !!a.isItemEditable, p = (g) => {
|
|
175
|
+
if (g == null || !u)
|
|
176
|
+
return !1;
|
|
177
|
+
const T = e.getItem(g);
|
|
178
|
+
return T ? typeof a.isItemEditable == "function" ? a.isItemEditable(T) : !!a.isItemEditable : !1;
|
|
179
|
+
}, I = (g, T) => {
|
|
180
|
+
if (!T)
|
|
181
|
+
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.", g].join(`
|
|
182
|
+
`));
|
|
183
|
+
o((r) => {
|
|
184
|
+
const f = r.items.itemMetaMap[g];
|
|
185
|
+
return f.label !== T ? b({}, r, {
|
|
186
|
+
items: b({}, r.items, {
|
|
187
|
+
itemMetaMap: b({}, r.items.itemMetaMap, {
|
|
188
|
+
[g]: b({}, f, {
|
|
189
|
+
label: T
|
|
190
|
+
})
|
|
191
|
+
})
|
|
192
|
+
})
|
|
193
|
+
}) : r;
|
|
194
|
+
}), a.onItemLabelChange && a.onItemLabelChange(g, T);
|
|
195
|
+
};
|
|
196
|
+
return {
|
|
197
|
+
instance: {
|
|
198
|
+
setEditedItemId: m,
|
|
199
|
+
isItemBeingEdited: s,
|
|
200
|
+
updateItemLabel: I,
|
|
201
|
+
isItemEditable: p,
|
|
202
|
+
isTreeViewEditable: u,
|
|
203
|
+
isItemBeingEditedRef: l
|
|
204
|
+
},
|
|
205
|
+
publicAPI: {
|
|
206
|
+
updateItemLabel: I
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
L.itemPlugin = Xe;
|
|
211
|
+
L.getDefaultizedParams = ({
|
|
212
|
+
params: e,
|
|
213
|
+
experimentalFeatures: t
|
|
214
|
+
}) => {
|
|
215
|
+
const o = t == null ? void 0 : t.labelEditing;
|
|
216
|
+
return process.env.NODE_ENV !== "production" && e.isItemEditable && !o && Ee(["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/"]), b({}, e, {
|
|
217
|
+
isItemEditable: o ? e.isItemEditable ?? !1 : !1
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
L.getInitialState = () => ({
|
|
221
|
+
editedItemId: null
|
|
222
|
+
});
|
|
223
|
+
L.params = {
|
|
224
|
+
onItemLabelChange: !0,
|
|
225
|
+
isItemEditable: !0
|
|
226
|
+
};
|
|
227
|
+
const Ye = M("div", {
|
|
228
|
+
name: "MuiTreeItem2DragAndDropOverlay",
|
|
229
|
+
slot: "Root",
|
|
230
|
+
overridesResolver: (e, t) => t.root,
|
|
231
|
+
shouldForwardProp: (e) => Y(e) && e !== "action"
|
|
232
|
+
})(({
|
|
233
|
+
theme: e
|
|
234
|
+
}) => ({
|
|
235
|
+
position: "absolute",
|
|
236
|
+
left: 0,
|
|
237
|
+
display: "flex",
|
|
238
|
+
top: 0,
|
|
239
|
+
bottom: 0,
|
|
240
|
+
right: 0,
|
|
241
|
+
pointerEvents: "none",
|
|
242
|
+
variants: [{
|
|
243
|
+
props: {
|
|
244
|
+
action: "make-child"
|
|
245
|
+
},
|
|
246
|
+
style: {
|
|
247
|
+
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
|
|
248
|
+
borderRadius: e.shape.borderRadius,
|
|
249
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.darkChannel} / ${e.vars.palette.action.focusOpacity})` : B(e.palette.primary.dark, e.palette.action.focusOpacity)
|
|
250
|
+
}
|
|
251
|
+
}, {
|
|
252
|
+
props: {
|
|
253
|
+
action: "reorder-above"
|
|
254
|
+
},
|
|
255
|
+
style: {
|
|
256
|
+
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
|
|
257
|
+
borderTop: `1px solid ${(e.vars || e).palette.action.active}`
|
|
258
|
+
}
|
|
259
|
+
}, {
|
|
260
|
+
props: {
|
|
261
|
+
action: "reorder-below"
|
|
262
|
+
},
|
|
263
|
+
style: {
|
|
264
|
+
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
|
|
265
|
+
borderBottom: `1px solid ${(e.vars || e).palette.action.active}`
|
|
266
|
+
}
|
|
267
|
+
}, {
|
|
268
|
+
props: {
|
|
269
|
+
action: "move-to-parent"
|
|
270
|
+
},
|
|
271
|
+
style: {
|
|
272
|
+
marginLeft: "calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",
|
|
273
|
+
borderBottom: `1px solid ${(e.vars || e).palette.action.active}`
|
|
274
|
+
}
|
|
275
|
+
}]
|
|
276
|
+
}));
|
|
277
|
+
function Ie(e) {
|
|
278
|
+
return e.action == null ? null : /* @__PURE__ */ x(Ye, b({}, e));
|
|
279
|
+
}
|
|
280
|
+
process.env.NODE_ENV !== "production" && (Ie.propTypes = {
|
|
281
|
+
// ----------------------------- Warning --------------------------------
|
|
282
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
283
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
284
|
+
// ----------------------------------------------------------------------
|
|
285
|
+
action: y.oneOf(["make-child", "move-to-parent", "reorder-above", "reorder-below"]),
|
|
286
|
+
style: y.object
|
|
287
|
+
});
|
|
288
|
+
const Je = M("input", {
|
|
289
|
+
name: "MuiTreeItem2",
|
|
290
|
+
slot: "LabelInput",
|
|
291
|
+
overridesResolver: (e, t) => t.labelInput
|
|
292
|
+
})(({
|
|
293
|
+
theme: e
|
|
294
|
+
}) => b({}, e.typography.body1, {
|
|
295
|
+
width: "100%",
|
|
296
|
+
backgroundColor: e.palette.background.paper,
|
|
297
|
+
borderRadius: e.shape.borderRadius,
|
|
298
|
+
border: "none",
|
|
299
|
+
padding: "0 2px",
|
|
300
|
+
boxSizing: "border-box",
|
|
301
|
+
"&:focus": {
|
|
302
|
+
outline: `1px solid ${e.palette.primary.main}`
|
|
303
|
+
}
|
|
304
|
+
}));
|
|
305
|
+
function Qe(e) {
|
|
306
|
+
return Le("MuiTreeItem", e);
|
|
307
|
+
}
|
|
308
|
+
const Bt = Me("MuiTreeItem", ["root", "groupTransition", "content", "expanded", "selected", "focused", "disabled", "iconContainer", "label", "checkbox", "labelInput", "editable", "editing", "dragAndDropOverlay"]), Ze = X(/* @__PURE__ */ x("path", {
|
|
309
|
+
d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
|
|
310
|
+
}), "TreeViewExpandIcon"), He = X(/* @__PURE__ */ x("path", {
|
|
311
|
+
d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
|
|
312
|
+
}), "TreeViewCollapseIcon");
|
|
313
|
+
function re(e) {
|
|
314
|
+
const {
|
|
315
|
+
children: t,
|
|
316
|
+
itemId: o
|
|
317
|
+
} = e, {
|
|
318
|
+
wrapItem: a,
|
|
319
|
+
instance: c
|
|
320
|
+
} = K();
|
|
321
|
+
return a({
|
|
322
|
+
children: t,
|
|
323
|
+
itemId: o,
|
|
324
|
+
instance: c
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
re.propTypes = {
|
|
328
|
+
// ----------------------------- Warning --------------------------------
|
|
329
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
330
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
331
|
+
// ----------------------------------------------------------------------
|
|
332
|
+
children: y.node,
|
|
333
|
+
itemId: y.string.isRequired
|
|
334
|
+
};
|
|
335
|
+
const fe = (e) => Array.isArray(e) ? e.length > 0 && e.some(fe) : !!e, et = ({
|
|
336
|
+
itemId: e,
|
|
337
|
+
children: t
|
|
338
|
+
}) => {
|
|
339
|
+
const {
|
|
340
|
+
instance: o,
|
|
341
|
+
selection: {
|
|
342
|
+
multiSelect: a
|
|
343
|
+
},
|
|
344
|
+
publicAPI: c
|
|
345
|
+
} = K(), l = {
|
|
346
|
+
expandable: fe(t),
|
|
347
|
+
expanded: o.isItemExpanded(e),
|
|
348
|
+
focused: o.isItemFocused(e),
|
|
349
|
+
selected: o.isItemSelected(e),
|
|
350
|
+
disabled: o.isItemDisabled(e),
|
|
351
|
+
editing: o != null && o.isItemBeingEdited ? o == null ? void 0 : o.isItemBeingEdited(e) : !1,
|
|
352
|
+
editable: o.isItemEditable ? o.isItemEditable(e) : !1
|
|
353
|
+
}, m = (r) => {
|
|
354
|
+
if (l.disabled)
|
|
355
|
+
return;
|
|
356
|
+
l.focused || o.focusItem(r, e);
|
|
357
|
+
const f = a && (r.shiftKey || r.ctrlKey || r.metaKey);
|
|
358
|
+
l.expandable && !(f && o.isItemExpanded(e)) && o.toggleItemExpansion(r, e);
|
|
359
|
+
}, s = (r) => {
|
|
360
|
+
if (l.disabled)
|
|
361
|
+
return;
|
|
362
|
+
l.focused || o.focusItem(r, e), a && (r.shiftKey || r.ctrlKey || r.metaKey) ? r.shiftKey ? o.expandSelectionRange(r, e) : o.selectItem({
|
|
363
|
+
event: r,
|
|
364
|
+
itemId: e,
|
|
365
|
+
keepExistingSelection: !0
|
|
366
|
+
}) : o.selectItem({
|
|
367
|
+
event: r,
|
|
368
|
+
itemId: e,
|
|
369
|
+
shouldBeSelected: !0
|
|
370
|
+
});
|
|
371
|
+
}, u = (r) => {
|
|
372
|
+
const f = r.nativeEvent.shiftKey;
|
|
373
|
+
a && f ? o.expandSelectionRange(r, e) : o.selectItem({
|
|
374
|
+
event: r,
|
|
375
|
+
itemId: e,
|
|
376
|
+
keepExistingSelection: a,
|
|
377
|
+
shouldBeSelected: r.target.checked
|
|
378
|
+
});
|
|
379
|
+
}, p = () => {
|
|
380
|
+
ne(o, L) && o.isItemEditable(e) && (o.isItemBeingEdited(e) ? o.setEditedItemId(null) : o.setEditedItemId(e));
|
|
381
|
+
};
|
|
382
|
+
return {
|
|
383
|
+
interactions: {
|
|
384
|
+
handleExpansion: m,
|
|
385
|
+
handleSelection: s,
|
|
386
|
+
handleCheckboxSelection: u,
|
|
387
|
+
toggleItemEditing: p,
|
|
388
|
+
handleSaveItemLabel: (r, f) => {
|
|
389
|
+
ne(o, L) && o.isItemBeingEditedRef(e) && (o.updateItemLabel(e, f), p(), o.focusItem(r, e));
|
|
390
|
+
},
|
|
391
|
+
handleCancelItemLabelEditing: (r) => {
|
|
392
|
+
ne(o, L) && o.isItemBeingEditedRef(e) && (p(), o.focusItem(r, e));
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
status: l,
|
|
396
|
+
publicAPI: c
|
|
397
|
+
};
|
|
398
|
+
}, tt = (e) => {
|
|
399
|
+
const {
|
|
400
|
+
runItemPlugins: t,
|
|
401
|
+
items: {
|
|
402
|
+
onItemClick: o,
|
|
403
|
+
disabledItemsFocusable: a,
|
|
404
|
+
indentationAtItemLevel: c
|
|
405
|
+
},
|
|
406
|
+
selection: {
|
|
407
|
+
disableSelection: l,
|
|
408
|
+
checkboxSelection: m
|
|
409
|
+
},
|
|
410
|
+
expansion: {
|
|
411
|
+
expansionTrigger: s
|
|
412
|
+
},
|
|
413
|
+
treeId: u,
|
|
414
|
+
instance: p,
|
|
415
|
+
publicAPI: I
|
|
416
|
+
} = K(), g = R.useContext(ge), {
|
|
417
|
+
id: T,
|
|
418
|
+
itemId: r,
|
|
419
|
+
label: f,
|
|
420
|
+
children: E,
|
|
421
|
+
rootRef: S
|
|
422
|
+
} = e, {
|
|
423
|
+
rootRef: J,
|
|
424
|
+
contentRef: Q,
|
|
425
|
+
propsEnhancers: P
|
|
426
|
+
} = t(e), {
|
|
427
|
+
interactions: w,
|
|
428
|
+
status: h
|
|
429
|
+
} = et({
|
|
430
|
+
itemId: r,
|
|
431
|
+
children: E
|
|
432
|
+
}), v = R.useRef(null), N = R.useRef(null), $ = le(S, J, v), F = le(Q, N), j = R.useRef(null), q = ze({
|
|
433
|
+
itemId: r,
|
|
434
|
+
treeId: u,
|
|
435
|
+
id: T
|
|
436
|
+
}), Z = p.canItemBeTabbed(r) ? 0 : -1, V = {
|
|
437
|
+
rootRefObject: v,
|
|
438
|
+
contentRefObject: N,
|
|
439
|
+
interactions: w
|
|
440
|
+
}, H = (i) => (n) => {
|
|
441
|
+
var C;
|
|
442
|
+
if ((C = i.onFocus) == null || C.call(i, n), n.defaultMuiPrevented)
|
|
443
|
+
return;
|
|
444
|
+
const d = !h.disabled || a;
|
|
445
|
+
!h.focused && d && n.currentTarget === n.target && p.focusItem(n, r);
|
|
446
|
+
}, z = (i) => (n) => {
|
|
447
|
+
var C, O, A, ae, se;
|
|
448
|
+
if ((C = i.onBlur) == null || C.call(i, n), n.defaultMuiPrevented)
|
|
449
|
+
return;
|
|
450
|
+
const d = p.getItemDOMElement(r);
|
|
451
|
+
h.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
|
|
452
|
+
// 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
|
|
453
|
+
n.relatedTarget && pe(n.relatedTarget, d) && (n.target && ((A = (O = n.target) == null ? void 0 : O.dataset) == null ? void 0 : A.element) === "labelInput" && pe(n.target, d) || ((se = (ae = n.relatedTarget) == null ? void 0 : ae.dataset) == null ? void 0 : se.element) === "labelInput") || p.removeFocusedItem();
|
|
454
|
+
}, ee = (i) => (n) => {
|
|
455
|
+
var d, C, O;
|
|
456
|
+
(d = i.onKeyDown) == null || d.call(i, n), !(n.defaultMuiPrevented || ((O = (C = n.target) == null ? void 0 : C.dataset) == null ? void 0 : O.element) === "labelInput") && p.handleItemKeyDown(n, r);
|
|
457
|
+
}, _ = (i) => (n) => {
|
|
458
|
+
var d;
|
|
459
|
+
(d = i.onDoubleClick) == null || d.call(i, n), !n.defaultMuiPrevented && w.toggleItemEditing();
|
|
460
|
+
}, te = (i) => (n) => {
|
|
461
|
+
var d, C;
|
|
462
|
+
(d = i.onClick) == null || d.call(i, n), o == null || o(n, r), !(n.defaultMuiPrevented || (C = j.current) != null && C.contains(n.target)) && (s === "content" && w.handleExpansion(n), m || w.handleSelection(n));
|
|
463
|
+
}, U = (i) => (n) => {
|
|
464
|
+
var d;
|
|
465
|
+
(d = i.onMouseDown) == null || d.call(i, n), !n.defaultMuiPrevented && (n.shiftKey || n.ctrlKey || n.metaKey || h.disabled) && n.preventDefault();
|
|
466
|
+
}, oe = (i) => (n) => {
|
|
467
|
+
var d;
|
|
468
|
+
(d = i.onChange) == null || d.call(i, n), !n.defaultMuiPrevented && (l || h.disabled || w.handleCheckboxSelection(n));
|
|
469
|
+
}, G = (i) => (n) => {
|
|
470
|
+
var d;
|
|
471
|
+
(d = i.onClick) == null || d.call(i, n), !n.defaultMuiPrevented && s === "iconContainer" && w.handleExpansion(n);
|
|
472
|
+
};
|
|
473
|
+
return {
|
|
474
|
+
getRootProps: (i = {}) => {
|
|
475
|
+
var A;
|
|
476
|
+
const n = b({}, D(e), D(i));
|
|
477
|
+
let d;
|
|
478
|
+
h.selected ? d = !0 : l || h.disabled ? d = void 0 : d = !1;
|
|
479
|
+
const C = b({}, n, {
|
|
480
|
+
ref: $,
|
|
481
|
+
role: "treeitem",
|
|
482
|
+
tabIndex: Z,
|
|
483
|
+
id: q,
|
|
484
|
+
"aria-expanded": h.expandable ? h.expanded : void 0,
|
|
485
|
+
"aria-selected": d,
|
|
486
|
+
"aria-disabled": h.disabled || void 0
|
|
487
|
+
}, i, {
|
|
488
|
+
onFocus: H(n),
|
|
489
|
+
onBlur: z(n),
|
|
490
|
+
onKeyDown: ee(n)
|
|
491
|
+
});
|
|
492
|
+
c && (C.style = {
|
|
493
|
+
"--TreeView-itemDepth": typeof g == "function" ? g(r) : g
|
|
494
|
+
});
|
|
495
|
+
const O = ((A = P.root) == null ? void 0 : A.call(P, b({}, V, {
|
|
496
|
+
externalEventHandlers: n
|
|
497
|
+
}))) ?? {};
|
|
498
|
+
return b({}, C, O);
|
|
499
|
+
},
|
|
500
|
+
getContentProps: (i = {}) => {
|
|
501
|
+
var O;
|
|
502
|
+
const n = D(i), d = b({}, n, i, {
|
|
503
|
+
ref: F,
|
|
504
|
+
onClick: te(n),
|
|
505
|
+
onMouseDown: U(n),
|
|
506
|
+
status: h
|
|
507
|
+
});
|
|
508
|
+
c && (d.indentationAtItemLevel = !0);
|
|
509
|
+
const C = ((O = P.content) == null ? void 0 : O.call(P, b({}, V, {
|
|
510
|
+
externalEventHandlers: n
|
|
511
|
+
}))) ?? {};
|
|
512
|
+
return b({}, d, C);
|
|
513
|
+
},
|
|
514
|
+
getGroupTransitionProps: (i = {}) => {
|
|
515
|
+
const n = D(i), d = b({}, n, {
|
|
516
|
+
unmountOnExit: !0,
|
|
517
|
+
component: "ul",
|
|
518
|
+
role: "group",
|
|
519
|
+
in: h.expanded,
|
|
520
|
+
children: E
|
|
521
|
+
}, i);
|
|
522
|
+
return c && (d.indentationAtItemLevel = !0), d;
|
|
523
|
+
},
|
|
524
|
+
getIconContainerProps: (i = {}) => {
|
|
525
|
+
const n = D(i);
|
|
526
|
+
return b({}, n, i, {
|
|
527
|
+
onClick: G(n)
|
|
528
|
+
});
|
|
529
|
+
},
|
|
530
|
+
getCheckboxProps: (i = {}) => {
|
|
531
|
+
const n = D(i);
|
|
532
|
+
return b({}, n, {
|
|
533
|
+
visible: m,
|
|
534
|
+
ref: j,
|
|
535
|
+
checked: h.selected,
|
|
536
|
+
disabled: l || h.disabled,
|
|
537
|
+
tabIndex: -1
|
|
538
|
+
}, i, {
|
|
539
|
+
onChange: oe(n)
|
|
540
|
+
});
|
|
541
|
+
},
|
|
542
|
+
getLabelProps: (i = {}) => {
|
|
543
|
+
const n = b({}, D(i)), d = b({}, n, {
|
|
544
|
+
children: f
|
|
545
|
+
}, i, {
|
|
546
|
+
onDoubleClick: _(n)
|
|
547
|
+
});
|
|
548
|
+
return p.isTreeViewEditable && (d.editable = h.editable), d;
|
|
549
|
+
},
|
|
550
|
+
getLabelInputProps: (i = {}) => {
|
|
551
|
+
var C;
|
|
552
|
+
const n = D(i), d = ((C = P.labelInput) == null ? void 0 : C.call(P, {
|
|
553
|
+
rootRefObject: v,
|
|
554
|
+
contentRefObject: N,
|
|
555
|
+
externalEventHandlers: n,
|
|
556
|
+
interactions: w
|
|
557
|
+
})) ?? {};
|
|
558
|
+
return b({}, i, d);
|
|
559
|
+
},
|
|
560
|
+
getDragAndDropOverlayProps: (i = {}) => {
|
|
561
|
+
var C;
|
|
562
|
+
const n = D(i), d = ((C = P.dragAndDropOverlay) == null ? void 0 : C.call(P, b({}, V, {
|
|
563
|
+
externalEventHandlers: n
|
|
564
|
+
}))) ?? {};
|
|
565
|
+
return b({}, i, d);
|
|
566
|
+
},
|
|
567
|
+
rootRef: $,
|
|
568
|
+
status: h,
|
|
569
|
+
publicAPI: I
|
|
570
|
+
};
|
|
571
|
+
}, ye = tt;
|
|
572
|
+
function xe(e) {
|
|
573
|
+
const {
|
|
574
|
+
slots: t,
|
|
575
|
+
slotProps: o,
|
|
576
|
+
status: a
|
|
577
|
+
} = e, c = K(), l = b({}, c.icons.slots, {
|
|
578
|
+
expandIcon: c.icons.slots.expandIcon ?? Ze,
|
|
579
|
+
collapseIcon: c.icons.slots.collapseIcon ?? He
|
|
580
|
+
}), m = c.icons.slotProps;
|
|
581
|
+
let s;
|
|
582
|
+
t != null && t.icon ? s = "icon" : a.expandable ? a.expanded ? s = "collapseIcon" : s = "expandIcon" : s = "endIcon";
|
|
583
|
+
const u = (t == null ? void 0 : t[s]) ?? l[s], p = k({
|
|
584
|
+
elementType: u,
|
|
585
|
+
externalSlotProps: (I) => b({}, de(m[s], I), de(o == null ? void 0 : o[s], I)),
|
|
586
|
+
// TODO: Add proper ownerState
|
|
587
|
+
ownerState: {}
|
|
588
|
+
});
|
|
589
|
+
return u ? /* @__PURE__ */ x(u, b({}, p)) : null;
|
|
590
|
+
}
|
|
591
|
+
process.env.NODE_ENV !== "production" && (xe.propTypes = {
|
|
592
|
+
// ----------------------------- Warning --------------------------------
|
|
593
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
594
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
595
|
+
// ----------------------------------------------------------------------
|
|
596
|
+
/**
|
|
597
|
+
* The props used for each component slot.
|
|
598
|
+
* @default {}
|
|
599
|
+
*/
|
|
600
|
+
slotProps: y.object,
|
|
601
|
+
/**
|
|
602
|
+
* Overridable component slots.
|
|
603
|
+
* @default {}
|
|
604
|
+
*/
|
|
605
|
+
slots: y.object,
|
|
606
|
+
status: y.shape({
|
|
607
|
+
disabled: y.bool.isRequired,
|
|
608
|
+
editable: y.bool.isRequired,
|
|
609
|
+
editing: y.bool.isRequired,
|
|
610
|
+
expandable: y.bool.isRequired,
|
|
611
|
+
expanded: y.bool.isRequired,
|
|
612
|
+
focused: y.bool.isRequired,
|
|
613
|
+
selected: y.bool.isRequired
|
|
614
|
+
}).isRequired
|
|
615
|
+
});
|
|
616
|
+
const ot = ["visible"], nt = ["id", "itemId", "label", "disabled", "children", "slots", "slotProps"], rt = qe(), Ce = M("li", {
|
|
617
|
+
name: "MuiTreeItem2",
|
|
618
|
+
slot: "Root",
|
|
619
|
+
overridesResolver: (e, t) => t.root
|
|
620
|
+
})({
|
|
621
|
+
listStyle: "none",
|
|
622
|
+
margin: 0,
|
|
623
|
+
padding: 0,
|
|
624
|
+
outline: 0
|
|
625
|
+
}), Te = M("div", {
|
|
626
|
+
name: "MuiTreeItem2",
|
|
627
|
+
slot: "Content",
|
|
628
|
+
overridesResolver: (e, t) => t.content,
|
|
629
|
+
shouldForwardProp: (e) => Y(e) && e !== "status" && e !== "indentationAtItemLevel"
|
|
630
|
+
})(({
|
|
631
|
+
theme: e
|
|
632
|
+
}) => ({
|
|
633
|
+
padding: e.spacing(0.5, 1),
|
|
634
|
+
borderRadius: e.shape.borderRadius,
|
|
635
|
+
width: "100%",
|
|
636
|
+
boxSizing: "border-box",
|
|
637
|
+
// prevent width + padding to overflow
|
|
638
|
+
position: "relative",
|
|
639
|
+
display: "flex",
|
|
640
|
+
alignItems: "center",
|
|
641
|
+
gap: e.spacing(1),
|
|
642
|
+
cursor: "pointer",
|
|
643
|
+
WebkitTapHighlightColor: "transparent",
|
|
644
|
+
"&:hover": {
|
|
645
|
+
backgroundColor: (e.vars || e).palette.action.hover,
|
|
646
|
+
// Reset on touch devices, it doesn't add specificity
|
|
647
|
+
"@media (hover: none)": {
|
|
648
|
+
backgroundColor: "transparent"
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
variants: [{
|
|
652
|
+
props: {
|
|
653
|
+
indentationAtItemLevel: !0
|
|
654
|
+
},
|
|
655
|
+
style: {
|
|
656
|
+
paddingLeft: `calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`
|
|
657
|
+
}
|
|
658
|
+
}, {
|
|
659
|
+
props: ({
|
|
660
|
+
status: t
|
|
661
|
+
}) => t.disabled,
|
|
662
|
+
style: {
|
|
663
|
+
opacity: (e.vars || e).palette.action.disabledOpacity,
|
|
664
|
+
backgroundColor: "transparent"
|
|
665
|
+
}
|
|
666
|
+
}, {
|
|
667
|
+
props: ({
|
|
668
|
+
status: t
|
|
669
|
+
}) => t.focused,
|
|
670
|
+
style: {
|
|
671
|
+
backgroundColor: (e.vars || e).palette.action.focus
|
|
672
|
+
}
|
|
673
|
+
}, {
|
|
674
|
+
props: ({
|
|
675
|
+
status: t
|
|
676
|
+
}) => t.selected,
|
|
677
|
+
style: {
|
|
678
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : B(e.palette.primary.main, e.palette.action.selectedOpacity),
|
|
679
|
+
"&:hover": {
|
|
680
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : B(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
|
|
681
|
+
// Reset on touch devices, it doesn't add specificity
|
|
682
|
+
"@media (hover: none)": {
|
|
683
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : B(e.palette.primary.main, e.palette.action.selectedOpacity)
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
}, {
|
|
688
|
+
props: ({
|
|
689
|
+
status: t
|
|
690
|
+
}) => t.selected && t.focused,
|
|
691
|
+
style: {
|
|
692
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : B(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
|
|
693
|
+
}
|
|
694
|
+
}]
|
|
695
|
+
})), he = M("div", {
|
|
696
|
+
name: "MuiTreeItem2",
|
|
697
|
+
slot: "Label",
|
|
698
|
+
overridesResolver: (e, t) => t.label,
|
|
699
|
+
shouldForwardProp: (e) => Y(e) && e !== "editable"
|
|
700
|
+
})(({
|
|
701
|
+
theme: e
|
|
702
|
+
}) => b({
|
|
703
|
+
width: "100%",
|
|
704
|
+
boxSizing: "border-box",
|
|
705
|
+
// prevent width + padding to overflow
|
|
706
|
+
// fixes overflow - see https://github.com/mui/material-ui/issues/27372
|
|
707
|
+
minWidth: 0,
|
|
708
|
+
position: "relative",
|
|
709
|
+
overflow: "hidden"
|
|
710
|
+
}, e.typography.body1, {
|
|
711
|
+
variants: [{
|
|
712
|
+
props: ({
|
|
713
|
+
editable: t
|
|
714
|
+
}) => t,
|
|
715
|
+
style: {
|
|
716
|
+
paddingLeft: "2px"
|
|
717
|
+
}
|
|
718
|
+
}]
|
|
719
|
+
})), ve = M("div", {
|
|
720
|
+
name: "MuiTreeItem2",
|
|
721
|
+
slot: "IconContainer",
|
|
722
|
+
overridesResolver: (e, t) => t.iconContainer
|
|
723
|
+
})({
|
|
724
|
+
width: 16,
|
|
725
|
+
display: "flex",
|
|
726
|
+
flexShrink: 0,
|
|
727
|
+
justifyContent: "center",
|
|
728
|
+
"& svg": {
|
|
729
|
+
fontSize: 18
|
|
730
|
+
}
|
|
731
|
+
}), we = M(Be, {
|
|
732
|
+
name: "MuiTreeItem2",
|
|
733
|
+
slot: "GroupTransition",
|
|
734
|
+
overridesResolver: (e, t) => t.groupTransition,
|
|
735
|
+
shouldForwardProp: (e) => Y(e) && e !== "indentationAtItemLevel"
|
|
736
|
+
})({
|
|
737
|
+
margin: 0,
|
|
738
|
+
padding: 0,
|
|
739
|
+
paddingLeft: "var(--TreeView-itemChildrenIndentation)",
|
|
740
|
+
variants: [{
|
|
741
|
+
props: {
|
|
742
|
+
indentationAtItemLevel: !0
|
|
743
|
+
},
|
|
744
|
+
style: {
|
|
745
|
+
paddingLeft: 0
|
|
746
|
+
}
|
|
747
|
+
}]
|
|
748
|
+
}), it = M(/* @__PURE__ */ R.forwardRef((e, t) => {
|
|
749
|
+
const {
|
|
750
|
+
visible: o
|
|
751
|
+
} = e, a = ue(e, ot);
|
|
752
|
+
return o ? /* @__PURE__ */ x(Ke, b({}, a, {
|
|
753
|
+
ref: t
|
|
754
|
+
})) : null;
|
|
755
|
+
}), {
|
|
756
|
+
name: "MuiTreeItem2",
|
|
757
|
+
slot: "Checkbox",
|
|
758
|
+
overridesResolver: (e, t) => t.checkbox
|
|
759
|
+
})({
|
|
760
|
+
padding: 0
|
|
761
|
+
}), at = (e) => {
|
|
762
|
+
const {
|
|
763
|
+
classes: t
|
|
764
|
+
} = e;
|
|
765
|
+
return Ae({
|
|
766
|
+
root: ["root"],
|
|
767
|
+
content: ["content"],
|
|
768
|
+
expanded: ["expanded"],
|
|
769
|
+
editing: ["editing"],
|
|
770
|
+
editable: ["editable"],
|
|
771
|
+
selected: ["selected"],
|
|
772
|
+
focused: ["focused"],
|
|
773
|
+
disabled: ["disabled"],
|
|
774
|
+
iconContainer: ["iconContainer"],
|
|
775
|
+
checkbox: ["checkbox"],
|
|
776
|
+
label: ["label"],
|
|
777
|
+
groupTransition: ["groupTransition"],
|
|
778
|
+
labelInput: ["labelInput"],
|
|
779
|
+
dragAndDropOverlay: ["dragAndDropOverlay"]
|
|
780
|
+
}, Qe, t);
|
|
781
|
+
}, st = /* @__PURE__ */ R.forwardRef(function(t, o) {
|
|
782
|
+
const a = rt({
|
|
783
|
+
props: t,
|
|
784
|
+
name: "MuiTreeItem2"
|
|
785
|
+
}), {
|
|
786
|
+
id: c,
|
|
787
|
+
itemId: l,
|
|
788
|
+
label: m,
|
|
789
|
+
disabled: s,
|
|
790
|
+
children: u,
|
|
791
|
+
slots: p = {},
|
|
792
|
+
slotProps: I = {}
|
|
793
|
+
} = a, g = ue(a, nt), {
|
|
794
|
+
getRootProps: T,
|
|
795
|
+
getContentProps: r,
|
|
796
|
+
getIconContainerProps: f,
|
|
797
|
+
getCheckboxProps: E,
|
|
798
|
+
getLabelProps: S,
|
|
799
|
+
getGroupTransitionProps: J,
|
|
800
|
+
getLabelInputProps: Q,
|
|
801
|
+
getDragAndDropOverlayProps: P,
|
|
802
|
+
status: w
|
|
803
|
+
} = ye({
|
|
804
|
+
id: c,
|
|
805
|
+
itemId: l,
|
|
806
|
+
children: u,
|
|
807
|
+
label: m,
|
|
808
|
+
disabled: s
|
|
809
|
+
}), h = b({}, a, w), v = at(h), N = p.root ?? Ce, $ = k({
|
|
810
|
+
elementType: N,
|
|
811
|
+
getSlotProps: T,
|
|
812
|
+
externalForwardedProps: g,
|
|
813
|
+
externalSlotProps: I.root,
|
|
814
|
+
additionalProps: {
|
|
815
|
+
ref: o
|
|
816
|
+
},
|
|
817
|
+
ownerState: {},
|
|
818
|
+
className: v.root
|
|
819
|
+
}), F = p.content ?? Te, j = k({
|
|
820
|
+
elementType: F,
|
|
821
|
+
getSlotProps: r,
|
|
822
|
+
externalSlotProps: I.content,
|
|
823
|
+
ownerState: {},
|
|
824
|
+
className: Ne(v.content, w.expanded && v.expanded, w.selected && v.selected, w.focused && v.focused, w.disabled && v.disabled, w.editing && v.editing, w.editable && v.editable)
|
|
825
|
+
}), q = p.iconContainer ?? ve, Z = k({
|
|
826
|
+
elementType: q,
|
|
827
|
+
getSlotProps: f,
|
|
828
|
+
externalSlotProps: I.iconContainer,
|
|
829
|
+
ownerState: {},
|
|
830
|
+
className: v.iconContainer
|
|
831
|
+
}), V = p.label ?? he, H = k({
|
|
832
|
+
elementType: V,
|
|
833
|
+
getSlotProps: S,
|
|
834
|
+
externalSlotProps: I.label,
|
|
835
|
+
ownerState: {},
|
|
836
|
+
className: v.label
|
|
837
|
+
}), z = p.checkbox ?? it, ee = k({
|
|
838
|
+
elementType: z,
|
|
839
|
+
getSlotProps: E,
|
|
840
|
+
externalSlotProps: I.checkbox,
|
|
841
|
+
ownerState: {},
|
|
842
|
+
className: v.checkbox
|
|
843
|
+
}), _ = p.groupTransition ?? void 0, te = k({
|
|
844
|
+
elementType: _,
|
|
845
|
+
getSlotProps: J,
|
|
846
|
+
externalSlotProps: I.groupTransition,
|
|
847
|
+
ownerState: {},
|
|
848
|
+
className: v.groupTransition
|
|
849
|
+
}), U = p.labelInput ?? Je, oe = k({
|
|
850
|
+
elementType: U,
|
|
851
|
+
getSlotProps: Q,
|
|
852
|
+
externalSlotProps: I.labelInput,
|
|
853
|
+
ownerState: {},
|
|
854
|
+
className: v.labelInput
|
|
855
|
+
}), G = p.dragAndDropOverlay ?? Ie, ie = k({
|
|
856
|
+
elementType: G,
|
|
857
|
+
getSlotProps: P,
|
|
858
|
+
externalSlotProps: I.dragAndDropOverlay,
|
|
859
|
+
ownerState: {},
|
|
860
|
+
className: v.dragAndDropOverlay
|
|
861
|
+
});
|
|
862
|
+
return /* @__PURE__ */ x(re, {
|
|
863
|
+
itemId: l,
|
|
864
|
+
children: /* @__PURE__ */ W(N, b({}, $, {
|
|
865
|
+
children: [/* @__PURE__ */ W(F, b({}, j, {
|
|
866
|
+
children: [/* @__PURE__ */ x(q, b({}, Z, {
|
|
867
|
+
children: /* @__PURE__ */ x(xe, {
|
|
868
|
+
status: w,
|
|
869
|
+
slots: p,
|
|
870
|
+
slotProps: I
|
|
871
|
+
})
|
|
872
|
+
})), /* @__PURE__ */ x(z, b({}, ee)), w.editing ? /* @__PURE__ */ x(U, b({}, oe)) : /* @__PURE__ */ x(V, b({}, H)), /* @__PURE__ */ x(G, b({}, ie))]
|
|
873
|
+
})), u && /* @__PURE__ */ x(we, b({
|
|
874
|
+
as: _
|
|
875
|
+
}, te))]
|
|
876
|
+
}))
|
|
877
|
+
});
|
|
878
|
+
});
|
|
879
|
+
process.env.NODE_ENV !== "production" && (st.propTypes = {
|
|
880
|
+
// ----------------------------- Warning --------------------------------
|
|
881
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
882
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
883
|
+
// ----------------------------------------------------------------------
|
|
884
|
+
/**
|
|
885
|
+
* The content of the component.
|
|
886
|
+
*/
|
|
887
|
+
children: y.node,
|
|
888
|
+
/**
|
|
889
|
+
* Override or extend the styles applied to the component.
|
|
890
|
+
*/
|
|
891
|
+
classes: y.object,
|
|
892
|
+
className: y.string,
|
|
893
|
+
/**
|
|
894
|
+
* If `true`, the item is disabled.
|
|
895
|
+
* @default false
|
|
896
|
+
*/
|
|
897
|
+
disabled: y.bool,
|
|
898
|
+
/**
|
|
899
|
+
* The id attribute of the item. If not provided, it will be generated.
|
|
900
|
+
*/
|
|
901
|
+
id: y.string,
|
|
902
|
+
/**
|
|
903
|
+
* The id of the item.
|
|
904
|
+
* Must be unique.
|
|
905
|
+
*/
|
|
906
|
+
itemId: y.string.isRequired,
|
|
907
|
+
/**
|
|
908
|
+
* The label of the item.
|
|
909
|
+
*/
|
|
910
|
+
label: y.node,
|
|
911
|
+
/**
|
|
912
|
+
* Callback fired when the item root is blurred.
|
|
913
|
+
*/
|
|
914
|
+
onBlur: y.func,
|
|
915
|
+
/**
|
|
916
|
+
* This prop isn't supported.
|
|
917
|
+
* Use the `onItemFocus` callback on the tree if you need to monitor an item's focus.
|
|
918
|
+
*/
|
|
919
|
+
onFocus: $e,
|
|
920
|
+
/**
|
|
921
|
+
* Callback fired when a key is pressed on the keyboard and the tree is in focus.
|
|
922
|
+
*/
|
|
923
|
+
onKeyDown: y.func,
|
|
924
|
+
/**
|
|
925
|
+
* The props used for each component slot.
|
|
926
|
+
* @default {}
|
|
927
|
+
*/
|
|
928
|
+
slotProps: y.object,
|
|
929
|
+
/**
|
|
930
|
+
* Overridable component slots.
|
|
931
|
+
* @default {}
|
|
932
|
+
*/
|
|
933
|
+
slots: y.object
|
|
934
|
+
});
|
|
935
|
+
const Kt = Pe(function(t, o) {
|
|
936
|
+
const {
|
|
937
|
+
id: a,
|
|
938
|
+
itemId: c,
|
|
939
|
+
label: l,
|
|
940
|
+
disabled: m,
|
|
941
|
+
children: s,
|
|
942
|
+
itemData: u,
|
|
943
|
+
iconColor: p = "primary"
|
|
944
|
+
} = t, I = Oe(
|
|
945
|
+
u == null ? void 0 : u.iconType,
|
|
946
|
+
u == null ? void 0 : u.customIcon
|
|
947
|
+
), {
|
|
948
|
+
getRootProps: g,
|
|
949
|
+
getContentProps: T,
|
|
950
|
+
getLabelProps: r,
|
|
951
|
+
getGroupTransitionProps: f,
|
|
952
|
+
getIconContainerProps: E,
|
|
953
|
+
status: S
|
|
954
|
+
} = ye({ id: a, itemId: c, label: l, disabled: m, children: s, rootRef: o });
|
|
955
|
+
return /* @__PURE__ */ x(re, { itemId: c, children: /* @__PURE__ */ W(Ce, { ...g(), children: [
|
|
956
|
+
/* @__PURE__ */ W(
|
|
957
|
+
Te,
|
|
958
|
+
{
|
|
959
|
+
...T(),
|
|
960
|
+
style: Se,
|
|
961
|
+
children: [
|
|
962
|
+
/* @__PURE__ */ x(ve, { ...E(), children: /* @__PURE__ */ x(I, { fontSize: "small", color: p }) }),
|
|
963
|
+
/* @__PURE__ */ x(he, { ...r() }),
|
|
964
|
+
/* @__PURE__ */ x(Re, { sx: De, children: S.expandable && (S.expanded ? /* @__PURE__ */ x(Fe, { fontSize: "small" }) : /* @__PURE__ */ x(je, { fontSize: "small" })) })
|
|
965
|
+
]
|
|
966
|
+
}
|
|
967
|
+
),
|
|
968
|
+
s && /* @__PURE__ */ x(
|
|
969
|
+
we,
|
|
970
|
+
{
|
|
971
|
+
...f(),
|
|
972
|
+
style: S.expanded ? ke : void 0
|
|
973
|
+
}
|
|
974
|
+
)
|
|
975
|
+
] }) });
|
|
976
|
+
});
|
|
977
|
+
export {
|
|
978
|
+
Kt as C,
|
|
979
|
+
be as T,
|
|
980
|
+
ge as a,
|
|
981
|
+
Nt as b,
|
|
982
|
+
Lt as c,
|
|
983
|
+
Ge as d,
|
|
984
|
+
At as e,
|
|
985
|
+
We as f,
|
|
986
|
+
ze as g,
|
|
987
|
+
Vt as h,
|
|
988
|
+
pe as i,
|
|
989
|
+
Ue as j,
|
|
990
|
+
_e as k,
|
|
991
|
+
ne as l,
|
|
992
|
+
K as m,
|
|
993
|
+
Je as n,
|
|
994
|
+
Ie as o,
|
|
995
|
+
qe as p,
|
|
996
|
+
He as q,
|
|
997
|
+
Ze as r,
|
|
998
|
+
re as s,
|
|
999
|
+
Qe as t,
|
|
1000
|
+
L as u,
|
|
1001
|
+
Bt as v
|
|
1002
|
+
};
|