@hybridcore/ui 1.1.2 → 1.2.0
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/{ButtonBase-BYmh3G5j.js → ButtonBase-C7CHOX3y.js} +8 -7
- package/dist/{CardContent-C8PxkJz4.js → CardContent-DDFwwGfd.js} +3 -3
- package/dist/Checkbox-DP6_qp1v.js +469 -0
- package/dist/Collapse-9egEADkh.js +296 -0
- package/dist/{DialogContent-2aPOjKE7.js → DialogContent-MMUsECN2.js} +746 -789
- package/dist/{FormControl-BiAFm76F.js → FormControl-Cj5nc-Nv.js} +151 -163
- package/dist/FormControlLabel-j_atSYQA.js +827 -0
- package/dist/{IconButton-CQJ8wZE8.js → IconButton-2FRFauye.js} +4 -4
- package/dist/{Input-Bf5G3tFN.js → Input-BY_yKOrF.js} +5 -5
- package/dist/{listItemTextClasses-BvXFz-Oc.js → List-CgBXAAKA.js} +50 -62
- package/dist/ListItem-BFDUUjHt.js +428 -0
- package/dist/MenuItem-BejUFNIP.js +233 -0
- package/dist/{OutlinedInput-BEVE8VZQ.js → OutlinedInput-CnzESIDi.js} +5 -5
- package/dist/{Paper-CaiWdndQ.js → Paper-k37cShvn.js} +4 -4
- package/dist/{Select-DxpxZbJp.js → Select-BGt6e73I.js} +804 -1025
- package/dist/{Typography-XIiVCSto.js → Typography-Bjo-B13o.js} +3 -3
- package/dist/{chainPropTypes-DtBfUj5o.js → chainPropTypes-BmidnkZm.js} +2 -2
- package/dist/components/card/index.js +5 -5
- package/dist/components/card/styled.js +1 -1
- package/dist/components/collapsible-card/index.js +34 -0
- package/dist/components/collapsible-card/style.js +575 -0
- package/dist/components/confirm/dialog.js +5 -5
- package/dist/components/container/index.js +6 -6
- package/dist/components/context-menu/index.js +191 -603
- package/dist/components/data-management/instance-form/components/composite-list/index.js +1 -1
- package/dist/components/data-management/instance-form/components/variable/index.js +7 -5
- package/dist/components/data-management/instance-form/components/variables/index.js +1 -1
- package/dist/components/geometry-picker/coordinate/index.js +1 -1
- package/dist/components/geometry-picker/edit/index.js +1 -1
- package/dist/components/geometry-picker/geometry/index.js +1 -1
- package/dist/components/geometry-picker/index.js +2 -2
- package/dist/components/geometry-picker/kml/index.js +1 -1
- package/dist/components/geometry-picker/map/index.js +1 -1
- package/dist/components/geometry-picker/map/logic.js +1 -1
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/map/helpers/ol.js +2 -2
- package/dist/components/map/index.js +2 -2
- package/dist/components/map/logic.js +1 -1
- package/dist/components/map/styled.js +89 -6
- package/dist/components/search-input/index.js +119 -48
- package/dist/components/template-property-filters/index.js +78 -0
- package/dist/components/template-property-filters/property.js +7019 -0
- package/dist/components/tree-select/index.js +14 -13
- package/dist/components/treeview-filter/index.js +263 -328
- package/dist/components/treeview-filter/item/index.js +1 -1
- package/dist/components/treeview-filter/item-label/index.js +2 -2
- package/dist/createSvgIcon-DAR6Hwv8.js +77 -0
- package/dist/createSvgIcon-R_PakhKf.js +213 -0
- package/dist/{createTheme-agWfFD64.js → createTheme-oOCi1S_n.js} +5 -5
- package/dist/debounce-46wSf_lW.js +15 -0
- package/dist/{exactProp-CI8dagM-.js → exactProp-DhXxfU8X.js} +2 -2
- package/dist/index-C7W2wuUG.js +609 -0
- package/dist/index-DHnXB0CB.js +287 -0
- package/dist/{index-IvOfmM1F.js → index-JrtqxUdI.js} +6 -6
- package/dist/listItemTextClasses-CaI8l2PD.js +16 -0
- package/dist/main.d.ts +140 -0
- package/dist/main.js +1 -1
- package/dist/{ol-DXmSLlWv.js → ol-q6vTiF_t.js} +1 -1
- package/dist/resolveComponentProps-BwtY1IP3.js +54 -0
- package/dist/styled-CHMAYxVs.js +142 -0
- package/dist/{styled-Iq9jsO4F.js → styled-Wx2vv4j8.js} +1 -1
- package/dist/unsupportedProp-BuVD30Gh.js +9 -0
- package/dist/{useTheme-C0Dky5rV.js → useTheme-BI40KZ7w.js} +2 -1
- package/dist/{useTheme-CeyGVuQP.js → useTheme-CD5DEi5n.js} +2 -2
- package/dist/useThemeProps-D4or2IlT.js +62 -0
- package/dist/{useThemeProps-CzAjOL6F.js → useThemeProps-DT5EdhcP.js} +5 -4
- package/dist/{utils-DLpkeyhZ.js → utils-BEaBPoDF.js} +10 -10
- package/package.json +1 -1
- package/dist/Checkbox-DostZSwR.js +0 -673
- package/dist/index-Bw_m9ult.js +0 -1105
- package/dist/index-wW2D1aTG.js +0 -957
- package/dist/styled-C43K9x7T.js +0 -229
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
import { jsx as T, jsxs as ae } from "react/jsx-runtime";
|
|
2
|
+
import xe from "./components/treeview-filter/item-label/index.js";
|
|
3
|
+
import se from "lodash";
|
|
4
|
+
import * as l from "react";
|
|
5
|
+
import { P as o } from "./createTheme-oOCi1S_n.js";
|
|
6
|
+
import { b as Ie, a as Te, e as he } from "./ButtonBase-C7CHOX3y.js";
|
|
7
|
+
import { g as Ee, a as ve } from "./chainPropTypes-BmidnkZm.js";
|
|
8
|
+
import { g as De, s as W } from "./styled-Wx2vv4j8.js";
|
|
9
|
+
import { a as $, u as Ne } from "./useThemeProps-D4or2IlT.js";
|
|
10
|
+
import { C as ie } from "./Collapse-9egEADkh.js";
|
|
11
|
+
import { u as Oe } from "./unsupportedProp-BuVD30Gh.js";
|
|
12
|
+
import { o as Se } from "./ownerDocument-CUrv0DIK.js";
|
|
13
|
+
function ce(e) {
|
|
14
|
+
var n, s, t = "";
|
|
15
|
+
if (typeof e == "string" || typeof e == "number") t += e;
|
|
16
|
+
else if (typeof e == "object") if (Array.isArray(e)) for (n = 0; n < e.length; n++) e[n] && (s = ce(e[n])) && (t && (t += " "), t += s);
|
|
17
|
+
else for (n in e) e[n] && (t && (t += " "), t += n);
|
|
18
|
+
return t;
|
|
19
|
+
}
|
|
20
|
+
function le() {
|
|
21
|
+
for (var e, n, s = 0, t = ""; s < arguments.length; ) (e = arguments[s++]) && (n = ce(e)) && (t && (t += " "), t += n);
|
|
22
|
+
return t;
|
|
23
|
+
}
|
|
24
|
+
const z = /* @__PURE__ */ l.createContext({});
|
|
25
|
+
process.env.NODE_ENV !== "production" && (z.displayName = "TreeViewContext");
|
|
26
|
+
function ke(e, n) {
|
|
27
|
+
for (let s = 0; s < e.length; s += 1)
|
|
28
|
+
if (n(e[s]))
|
|
29
|
+
return s;
|
|
30
|
+
return -1;
|
|
31
|
+
}
|
|
32
|
+
function we(e, n) {
|
|
33
|
+
let s = 0, t = e.length - 1;
|
|
34
|
+
for (; s <= t; ) {
|
|
35
|
+
const r = Math.floor((s + t) / 2);
|
|
36
|
+
if (e[r].element === n)
|
|
37
|
+
return r;
|
|
38
|
+
e[r].element.compareDocumentPosition(n) & Node.DOCUMENT_POSITION_PRECEDING ? t = r - 1 : s = r + 1;
|
|
39
|
+
}
|
|
40
|
+
return s;
|
|
41
|
+
}
|
|
42
|
+
const J = /* @__PURE__ */ l.createContext({});
|
|
43
|
+
process.env.NODE_ENV !== "production" && (J.displayName = "DescendantContext");
|
|
44
|
+
function Re(e) {
|
|
45
|
+
const n = l.useRef(null);
|
|
46
|
+
return l.useEffect(() => {
|
|
47
|
+
n.current = e;
|
|
48
|
+
}, [e]), n.current;
|
|
49
|
+
}
|
|
50
|
+
const re = () => {
|
|
51
|
+
};
|
|
52
|
+
function $e(e) {
|
|
53
|
+
const [, n] = l.useState(), {
|
|
54
|
+
registerDescendant: s = re,
|
|
55
|
+
unregisterDescendant: t = re,
|
|
56
|
+
descendants: r = [],
|
|
57
|
+
parentId: g = null
|
|
58
|
+
} = l.useContext(J), f = ke(r, (p) => p.element === e.element), m = Re(r), d = r.some((p, c) => m && m[c] && m[c].element !== p.element);
|
|
59
|
+
return Ie(() => {
|
|
60
|
+
if (e.element)
|
|
61
|
+
return s({
|
|
62
|
+
...e,
|
|
63
|
+
index: f
|
|
64
|
+
}), () => {
|
|
65
|
+
t(e.element);
|
|
66
|
+
};
|
|
67
|
+
n({});
|
|
68
|
+
}, [s, t, f, d, e]), {
|
|
69
|
+
parentId: g,
|
|
70
|
+
index: f
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function de(e) {
|
|
74
|
+
const {
|
|
75
|
+
children: n,
|
|
76
|
+
id: s
|
|
77
|
+
} = e, [t, r] = l.useState([]), g = l.useCallback(({
|
|
78
|
+
element: d,
|
|
79
|
+
...p
|
|
80
|
+
}) => {
|
|
81
|
+
r((c) => {
|
|
82
|
+
let u;
|
|
83
|
+
if (c.length === 0)
|
|
84
|
+
return [{
|
|
85
|
+
...p,
|
|
86
|
+
element: d,
|
|
87
|
+
index: 0
|
|
88
|
+
}];
|
|
89
|
+
const C = we(c, d);
|
|
90
|
+
if (c[C] && c[C].element === d)
|
|
91
|
+
u = c;
|
|
92
|
+
else {
|
|
93
|
+
const b = {
|
|
94
|
+
...p,
|
|
95
|
+
element: d,
|
|
96
|
+
index: C
|
|
97
|
+
};
|
|
98
|
+
u = c.slice(), u.splice(C, 0, b);
|
|
99
|
+
}
|
|
100
|
+
return u.forEach((b, y) => {
|
|
101
|
+
b.index = y;
|
|
102
|
+
}), u;
|
|
103
|
+
});
|
|
104
|
+
}, []), f = l.useCallback((d) => {
|
|
105
|
+
r((p) => p.filter((c) => d !== c.element));
|
|
106
|
+
}, []), m = l.useMemo(() => ({
|
|
107
|
+
descendants: t,
|
|
108
|
+
registerDescendant: g,
|
|
109
|
+
unregisterDescendant: f,
|
|
110
|
+
parentId: s
|
|
111
|
+
}), [t, g, f, s]);
|
|
112
|
+
return /* @__PURE__ */ T(J.Provider, {
|
|
113
|
+
value: m,
|
|
114
|
+
children: n
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
process.env.NODE_ENV !== "production" && (de.propTypes = {
|
|
118
|
+
children: o.node,
|
|
119
|
+
id: o.string
|
|
120
|
+
});
|
|
121
|
+
function Me(e) {
|
|
122
|
+
const {
|
|
123
|
+
focus: n,
|
|
124
|
+
isExpanded: s,
|
|
125
|
+
isExpandable: t,
|
|
126
|
+
isFocused: r,
|
|
127
|
+
isDisabled: g,
|
|
128
|
+
isSelected: f,
|
|
129
|
+
multiSelect: m,
|
|
130
|
+
selectNode: d,
|
|
131
|
+
selectRange: p,
|
|
132
|
+
toggleExpansion: c
|
|
133
|
+
} = l.useContext(z), u = t ? t(e) : !1, C = s ? s(e) : !1, b = r ? r(e) : !1, y = g ? g(e) : !1, i = f ? f(e) : !1;
|
|
134
|
+
return {
|
|
135
|
+
disabled: y,
|
|
136
|
+
expanded: C,
|
|
137
|
+
selected: i,
|
|
138
|
+
focused: b,
|
|
139
|
+
handleExpansion: (a) => {
|
|
140
|
+
if (!y) {
|
|
141
|
+
b || n(a, e);
|
|
142
|
+
const v = m && (a.shiftKey || a.ctrlKey || a.metaKey);
|
|
143
|
+
u && !(v && s(e)) && c(a, e);
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
handleSelection: (a) => {
|
|
147
|
+
y || (b || n(a, e), m && (a.shiftKey || a.ctrlKey || a.metaKey) ? a.shiftKey ? p(a, {
|
|
148
|
+
end: e
|
|
149
|
+
}) : d(a, e, !0) : d(a, e));
|
|
150
|
+
},
|
|
151
|
+
preventSelection: (a) => {
|
|
152
|
+
(a.shiftKey || a.ctrlKey || a.metaKey || y) && a.preventDefault();
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
const Q = /* @__PURE__ */ l.forwardRef(function(n, s) {
|
|
157
|
+
const {
|
|
158
|
+
classes: t,
|
|
159
|
+
className: r,
|
|
160
|
+
displayIcon: g,
|
|
161
|
+
expansionIcon: f,
|
|
162
|
+
icon: m,
|
|
163
|
+
label: d,
|
|
164
|
+
nodeId: p,
|
|
165
|
+
onClick: c,
|
|
166
|
+
onMouseDown: u,
|
|
167
|
+
...C
|
|
168
|
+
} = n, {
|
|
169
|
+
disabled: b,
|
|
170
|
+
expanded: y,
|
|
171
|
+
selected: i,
|
|
172
|
+
focused: S,
|
|
173
|
+
handleExpansion: k,
|
|
174
|
+
handleSelection: w,
|
|
175
|
+
preventSelection: a
|
|
176
|
+
} = Me(p), v = m || f || g, D = (x) => {
|
|
177
|
+
a(x), u && u(x);
|
|
178
|
+
}, M = (x) => {
|
|
179
|
+
k(x), w(x), c && c(x);
|
|
180
|
+
};
|
|
181
|
+
return (
|
|
182
|
+
/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions -- Key event is handled by the TreeView */
|
|
183
|
+
/* @__PURE__ */ ae("div", {
|
|
184
|
+
className: le(r, t.root, y && t.expanded, i && t.selected, S && t.focused, b && t.disabled),
|
|
185
|
+
onClick: M,
|
|
186
|
+
onMouseDown: D,
|
|
187
|
+
ref: s,
|
|
188
|
+
...C,
|
|
189
|
+
children: [/* @__PURE__ */ T("div", {
|
|
190
|
+
className: t.iconContainer,
|
|
191
|
+
children: v
|
|
192
|
+
}), /* @__PURE__ */ T("div", {
|
|
193
|
+
className: t.label,
|
|
194
|
+
children: d
|
|
195
|
+
})]
|
|
196
|
+
})
|
|
197
|
+
);
|
|
198
|
+
});
|
|
199
|
+
process.env.NODE_ENV !== "production" && (Q.propTypes = {
|
|
200
|
+
// ----------------------------- Warning --------------------------------
|
|
201
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
202
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
203
|
+
// ----------------------------------------------------------------------
|
|
204
|
+
/**
|
|
205
|
+
* Override or extend the styles applied to the component.
|
|
206
|
+
* See [CSS API](#css) below for more details.
|
|
207
|
+
*/
|
|
208
|
+
classes: o.object,
|
|
209
|
+
/**
|
|
210
|
+
* className applied to the root element.
|
|
211
|
+
*/
|
|
212
|
+
className: o.string,
|
|
213
|
+
/**
|
|
214
|
+
* The icon to display next to the tree node's label. Either a parent or end icon.
|
|
215
|
+
*/
|
|
216
|
+
displayIcon: o.node,
|
|
217
|
+
/**
|
|
218
|
+
* The icon to display next to the tree node's label. Either an expansion or collapse icon.
|
|
219
|
+
*/
|
|
220
|
+
expansionIcon: o.node,
|
|
221
|
+
/**
|
|
222
|
+
* The icon to display next to the tree node's label.
|
|
223
|
+
*/
|
|
224
|
+
icon: o.node,
|
|
225
|
+
/**
|
|
226
|
+
* The tree node label.
|
|
227
|
+
*/
|
|
228
|
+
label: o.node,
|
|
229
|
+
/**
|
|
230
|
+
* The id of the node.
|
|
231
|
+
*/
|
|
232
|
+
nodeId: o.string.isRequired,
|
|
233
|
+
/**
|
|
234
|
+
* @ignore
|
|
235
|
+
*/
|
|
236
|
+
onClick: o.func,
|
|
237
|
+
/**
|
|
238
|
+
* @ignore
|
|
239
|
+
*/
|
|
240
|
+
onMouseDown: o.func
|
|
241
|
+
});
|
|
242
|
+
function Pe(e) {
|
|
243
|
+
return De("MuiTreeItem", e);
|
|
244
|
+
}
|
|
245
|
+
const E = Ee("MuiTreeItem", ["root", "group", "content", "expanded", "selected", "focused", "disabled", "iconContainer", "label"]), je = (e) => {
|
|
246
|
+
const {
|
|
247
|
+
classes: n
|
|
248
|
+
} = e;
|
|
249
|
+
return ve({
|
|
250
|
+
root: ["root"],
|
|
251
|
+
content: ["content"],
|
|
252
|
+
expanded: ["expanded"],
|
|
253
|
+
selected: ["selected"],
|
|
254
|
+
focused: ["focused"],
|
|
255
|
+
disabled: ["disabled"],
|
|
256
|
+
iconContainer: ["iconContainer"],
|
|
257
|
+
label: ["label"],
|
|
258
|
+
group: ["group"]
|
|
259
|
+
}, Pe, n);
|
|
260
|
+
}, Fe = W("li", {
|
|
261
|
+
name: "MuiTreeItem",
|
|
262
|
+
slot: "Root",
|
|
263
|
+
overridesResolver: (e, n) => n.root
|
|
264
|
+
})({
|
|
265
|
+
listStyle: "none",
|
|
266
|
+
margin: 0,
|
|
267
|
+
padding: 0,
|
|
268
|
+
outline: 0
|
|
269
|
+
}), Ke = W(Q, {
|
|
270
|
+
name: "MuiTreeItem",
|
|
271
|
+
slot: "Content",
|
|
272
|
+
overridesResolver: (e, n) => [n.content, n.iconContainer && {
|
|
273
|
+
[`& .${E.iconContainer}`]: n.iconContainer
|
|
274
|
+
}, n.label && {
|
|
275
|
+
[`& .${E.label}`]: n.label
|
|
276
|
+
}]
|
|
277
|
+
})(({
|
|
278
|
+
theme: e
|
|
279
|
+
}) => ({
|
|
280
|
+
padding: "0 8px",
|
|
281
|
+
width: "100%",
|
|
282
|
+
display: "flex",
|
|
283
|
+
alignItems: "center",
|
|
284
|
+
cursor: "pointer",
|
|
285
|
+
WebkitTapHighlightColor: "transparent",
|
|
286
|
+
"&:hover": {
|
|
287
|
+
backgroundColor: (e.vars || e).palette.action.hover,
|
|
288
|
+
// Reset on touch devices, it doesn't add specificity
|
|
289
|
+
"@media (hover: none)": {
|
|
290
|
+
backgroundColor: "transparent"
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
[`&.${E.disabled}`]: {
|
|
294
|
+
opacity: (e.vars || e).palette.action.disabledOpacity,
|
|
295
|
+
backgroundColor: "transparent"
|
|
296
|
+
},
|
|
297
|
+
[`&.${E.focused}`]: {
|
|
298
|
+
backgroundColor: (e.vars || e).palette.action.focus
|
|
299
|
+
},
|
|
300
|
+
[`&.${E.selected}`]: {
|
|
301
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : $(e.palette.primary.main, e.palette.action.selectedOpacity),
|
|
302
|
+
"&:hover": {
|
|
303
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : $(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
|
|
304
|
+
// Reset on touch devices, it doesn't add specificity
|
|
305
|
+
"@media (hover: none)": {
|
|
306
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : $(e.palette.primary.main, e.palette.action.selectedOpacity)
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
[`&.${E.focused}`]: {
|
|
310
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : $(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
[`& .${E.iconContainer}`]: {
|
|
314
|
+
marginRight: 4,
|
|
315
|
+
width: 15,
|
|
316
|
+
display: "flex",
|
|
317
|
+
flexShrink: 0,
|
|
318
|
+
justifyContent: "center",
|
|
319
|
+
"& svg": {
|
|
320
|
+
fontSize: 18
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
[`& .${E.label}`]: {
|
|
324
|
+
width: "100%",
|
|
325
|
+
// fixes overflow - see https://github.com/mui/material-ui/issues/27372
|
|
326
|
+
minWidth: 0,
|
|
327
|
+
paddingLeft: 4,
|
|
328
|
+
position: "relative",
|
|
329
|
+
...e.typography.body1
|
|
330
|
+
}
|
|
331
|
+
})), _e = W(ie, {
|
|
332
|
+
name: "MuiTreeItem",
|
|
333
|
+
slot: "Group",
|
|
334
|
+
overridesResolver: (e, n) => n.group
|
|
335
|
+
})({
|
|
336
|
+
margin: 0,
|
|
337
|
+
padding: 0,
|
|
338
|
+
marginLeft: 17
|
|
339
|
+
}), pe = /* @__PURE__ */ l.forwardRef(function(n, s) {
|
|
340
|
+
const t = Ne({
|
|
341
|
+
props: n,
|
|
342
|
+
name: "MuiTreeItem"
|
|
343
|
+
}), {
|
|
344
|
+
children: r,
|
|
345
|
+
className: g,
|
|
346
|
+
collapseIcon: f,
|
|
347
|
+
ContentComponent: m = Q,
|
|
348
|
+
ContentProps: d,
|
|
349
|
+
endIcon: p,
|
|
350
|
+
expandIcon: c,
|
|
351
|
+
disabled: u,
|
|
352
|
+
icon: C,
|
|
353
|
+
id: b,
|
|
354
|
+
label: y,
|
|
355
|
+
nodeId: i,
|
|
356
|
+
onClick: S,
|
|
357
|
+
onMouseDown: k,
|
|
358
|
+
TransitionComponent: w = ie,
|
|
359
|
+
TransitionProps: a,
|
|
360
|
+
...v
|
|
361
|
+
} = t, {
|
|
362
|
+
icons: D = {},
|
|
363
|
+
focus: M,
|
|
364
|
+
isExpanded: x,
|
|
365
|
+
isFocused: X,
|
|
366
|
+
isSelected: Y,
|
|
367
|
+
isDisabled: Z,
|
|
368
|
+
multiSelect: ue,
|
|
369
|
+
disabledItemsFocusable: fe,
|
|
370
|
+
mapFirstChar: P,
|
|
371
|
+
unMapFirstChar: j,
|
|
372
|
+
registerNode: F,
|
|
373
|
+
unregisterNode: K,
|
|
374
|
+
treeId: _
|
|
375
|
+
} = l.useContext(z);
|
|
376
|
+
let N = null;
|
|
377
|
+
b != null ? N = b : _ && i && (N = `${_}-${i}`);
|
|
378
|
+
const [ee, me] = l.useState(null), ne = l.useRef(null), ge = Te(me, s), be = l.useMemo(() => ({
|
|
379
|
+
element: ee,
|
|
380
|
+
id: i
|
|
381
|
+
}), [i, ee]), {
|
|
382
|
+
index: V,
|
|
383
|
+
parentId: te
|
|
384
|
+
} = $e(be), O = !!(Array.isArray(r) ? r.length : r), R = x ? x(i) : !1, oe = X ? X(i) : !1, A = Y ? Y(i) : !1, U = Z ? Z(i) : !1, L = {
|
|
385
|
+
...t,
|
|
386
|
+
expanded: R,
|
|
387
|
+
focused: oe,
|
|
388
|
+
selected: A,
|
|
389
|
+
disabled: U
|
|
390
|
+
}, I = je(L);
|
|
391
|
+
let G, q;
|
|
392
|
+
O && (R ? q = f || D.defaultCollapseIcon : q = c || D.defaultExpandIcon), O ? G = D.defaultParentIcon : G = p || D.defaultEndIcon, l.useEffect(() => {
|
|
393
|
+
if (F && K && V !== -1)
|
|
394
|
+
return F({
|
|
395
|
+
id: i,
|
|
396
|
+
idAttribute: N,
|
|
397
|
+
index: V,
|
|
398
|
+
parentId: te,
|
|
399
|
+
expandable: O,
|
|
400
|
+
disabled: u
|
|
401
|
+
}), () => {
|
|
402
|
+
K(i);
|
|
403
|
+
};
|
|
404
|
+
}, [F, K, te, V, i, O, u, N]), l.useEffect(() => {
|
|
405
|
+
if (P && j && y)
|
|
406
|
+
return P(i, ne.current.textContent.substring(0, 1).toLowerCase()), () => {
|
|
407
|
+
j(i);
|
|
408
|
+
};
|
|
409
|
+
}, [P, j, i, y]);
|
|
410
|
+
let B;
|
|
411
|
+
ue ? B = A : A && (B = !0);
|
|
412
|
+
function Ce(h) {
|
|
413
|
+
if (h.target === h.currentTarget) {
|
|
414
|
+
let H;
|
|
415
|
+
typeof h.target.getRootNode == "function" ? H = h.target.getRootNode() : H = Se(h.target), H.getElementById(_).focus({
|
|
416
|
+
preventScroll: !0
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
const ye = !fe && U;
|
|
420
|
+
!oe && h.currentTarget === h.target && !ye && M(h, i);
|
|
421
|
+
}
|
|
422
|
+
return /* @__PURE__ */ ae(Fe, {
|
|
423
|
+
className: le(I.root, g),
|
|
424
|
+
role: "treeitem",
|
|
425
|
+
"aria-expanded": O ? R : null,
|
|
426
|
+
"aria-selected": B,
|
|
427
|
+
"aria-disabled": U || null,
|
|
428
|
+
ref: ge,
|
|
429
|
+
id: N,
|
|
430
|
+
tabIndex: -1,
|
|
431
|
+
...v,
|
|
432
|
+
ownerState: L,
|
|
433
|
+
onFocus: Ce,
|
|
434
|
+
children: [/* @__PURE__ */ T(Ke, {
|
|
435
|
+
as: m,
|
|
436
|
+
ref: ne,
|
|
437
|
+
classes: {
|
|
438
|
+
root: I.content,
|
|
439
|
+
expanded: I.expanded,
|
|
440
|
+
selected: I.selected,
|
|
441
|
+
focused: I.focused,
|
|
442
|
+
disabled: I.disabled,
|
|
443
|
+
iconContainer: I.iconContainer,
|
|
444
|
+
label: I.label
|
|
445
|
+
},
|
|
446
|
+
label: y,
|
|
447
|
+
nodeId: i,
|
|
448
|
+
onClick: S,
|
|
449
|
+
onMouseDown: k,
|
|
450
|
+
icon: C,
|
|
451
|
+
expansionIcon: q,
|
|
452
|
+
displayIcon: G,
|
|
453
|
+
ownerState: L,
|
|
454
|
+
...d
|
|
455
|
+
}), r && /* @__PURE__ */ T(de, {
|
|
456
|
+
id: i,
|
|
457
|
+
children: /* @__PURE__ */ T(_e, {
|
|
458
|
+
as: w,
|
|
459
|
+
unmountOnExit: !0,
|
|
460
|
+
className: I.group,
|
|
461
|
+
in: R,
|
|
462
|
+
component: "ul",
|
|
463
|
+
role: "group",
|
|
464
|
+
...a,
|
|
465
|
+
children: r
|
|
466
|
+
})
|
|
467
|
+
})]
|
|
468
|
+
});
|
|
469
|
+
});
|
|
470
|
+
process.env.NODE_ENV !== "production" && (pe.propTypes = {
|
|
471
|
+
// ----------------------------- Warning --------------------------------
|
|
472
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
473
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
474
|
+
// ----------------------------------------------------------------------
|
|
475
|
+
/**
|
|
476
|
+
* The content of the component.
|
|
477
|
+
*/
|
|
478
|
+
children: o.node,
|
|
479
|
+
/**
|
|
480
|
+
* Override or extend the styles applied to the component.
|
|
481
|
+
*/
|
|
482
|
+
classes: o.object,
|
|
483
|
+
/**
|
|
484
|
+
* @ignore
|
|
485
|
+
*/
|
|
486
|
+
className: o.string,
|
|
487
|
+
/**
|
|
488
|
+
* The icon used to collapse the node.
|
|
489
|
+
*/
|
|
490
|
+
collapseIcon: o.node,
|
|
491
|
+
/**
|
|
492
|
+
* The component used for the content node.
|
|
493
|
+
* @default TreeItemContent
|
|
494
|
+
*/
|
|
495
|
+
ContentComponent: he,
|
|
496
|
+
/**
|
|
497
|
+
* Props applied to ContentComponent
|
|
498
|
+
*/
|
|
499
|
+
ContentProps: o.object,
|
|
500
|
+
/**
|
|
501
|
+
* If `true`, the node is disabled.
|
|
502
|
+
* @default false
|
|
503
|
+
*/
|
|
504
|
+
disabled: o.bool,
|
|
505
|
+
/**
|
|
506
|
+
* The icon displayed next to a end node.
|
|
507
|
+
*/
|
|
508
|
+
endIcon: o.node,
|
|
509
|
+
/**
|
|
510
|
+
* The icon used to expand the node.
|
|
511
|
+
*/
|
|
512
|
+
expandIcon: o.node,
|
|
513
|
+
/**
|
|
514
|
+
* The icon to display next to the tree node's label.
|
|
515
|
+
*/
|
|
516
|
+
icon: o.node,
|
|
517
|
+
/**
|
|
518
|
+
* @ignore
|
|
519
|
+
*/
|
|
520
|
+
id: o.string,
|
|
521
|
+
/**
|
|
522
|
+
* The tree node label.
|
|
523
|
+
*/
|
|
524
|
+
label: o.node,
|
|
525
|
+
/**
|
|
526
|
+
* The id of the node.
|
|
527
|
+
*/
|
|
528
|
+
nodeId: o.string.isRequired,
|
|
529
|
+
/**
|
|
530
|
+
* @ignore
|
|
531
|
+
*/
|
|
532
|
+
onClick: o.func,
|
|
533
|
+
/**
|
|
534
|
+
* This prop isn't supported.
|
|
535
|
+
* Use the `onNodeFocus` callback on the tree if you need to monitor a node's focus.
|
|
536
|
+
*/
|
|
537
|
+
onFocus: Oe,
|
|
538
|
+
/**
|
|
539
|
+
* @ignore
|
|
540
|
+
*/
|
|
541
|
+
onMouseDown: o.func,
|
|
542
|
+
/**
|
|
543
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
544
|
+
*/
|
|
545
|
+
sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
|
|
546
|
+
/**
|
|
547
|
+
* The component used for the transition.
|
|
548
|
+
* [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
549
|
+
* @default Collapse
|
|
550
|
+
*/
|
|
551
|
+
TransitionComponent: o.elementType,
|
|
552
|
+
/**
|
|
553
|
+
* Props applied to the transition element.
|
|
554
|
+
* By default, the element is based on this [`Transition`](http://reactcommunity.org/react-transition-group/transition/) component.
|
|
555
|
+
*/
|
|
556
|
+
TransitionProps: o.object
|
|
557
|
+
});
|
|
558
|
+
function Ve({
|
|
559
|
+
id: e,
|
|
560
|
+
idKey: n,
|
|
561
|
+
name: s,
|
|
562
|
+
checked: t,
|
|
563
|
+
disabled: r,
|
|
564
|
+
disabledIds: g,
|
|
565
|
+
onChange: f,
|
|
566
|
+
children: m,
|
|
567
|
+
defaultSelected: d
|
|
568
|
+
}) {
|
|
569
|
+
return /* @__PURE__ */ T(
|
|
570
|
+
pe,
|
|
571
|
+
{
|
|
572
|
+
nodeId: String(e),
|
|
573
|
+
label: /* @__PURE__ */ T(
|
|
574
|
+
xe,
|
|
575
|
+
{
|
|
576
|
+
id: e,
|
|
577
|
+
name: s,
|
|
578
|
+
checked: t,
|
|
579
|
+
disabled: r,
|
|
580
|
+
onChange: f
|
|
581
|
+
}
|
|
582
|
+
),
|
|
583
|
+
children: m && m.map((p, c) => {
|
|
584
|
+
const u = String(p[n]), C = se.includes(d, u), b = se.includes(g, u);
|
|
585
|
+
return /* @__PURE__ */ T(
|
|
586
|
+
Ve,
|
|
587
|
+
{
|
|
588
|
+
id: u,
|
|
589
|
+
idKey: n,
|
|
590
|
+
name: p.name,
|
|
591
|
+
checked: C,
|
|
592
|
+
disabled: b,
|
|
593
|
+
disabledIds: g,
|
|
594
|
+
children: p.children,
|
|
595
|
+
onChange: f,
|
|
596
|
+
defaultSelected: d
|
|
597
|
+
},
|
|
598
|
+
c
|
|
599
|
+
);
|
|
600
|
+
})
|
|
601
|
+
}
|
|
602
|
+
);
|
|
603
|
+
}
|
|
604
|
+
export {
|
|
605
|
+
de as D,
|
|
606
|
+
Ve as I,
|
|
607
|
+
z as T,
|
|
608
|
+
le as c
|
|
609
|
+
};
|