@hybridcore/ui 1.4.36 → 1.4.37
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/{DialogContent-B0_-g7B0.js → DialogContent-CtA2aNum.js} +1 -1
- package/dist/{Modal-CJn-Bqyo.js → Modal-DzZo-vlm.js} +1 -0
- package/dist/{Select-DwAJxKTN.js → Select-ush_fSWy.js} +1 -1
- package/dist/{TextField-BAXUnwnR.js → TextField-BjFXx91l.js} +1 -1
- package/dist/components/confirm/dialog.js +2 -2
- package/dist/components/confirm/index.js +1 -1
- package/dist/components/context-menu/index.js +118 -118
- package/dist/components/instance-form/components/composite-list/index.js +1 -1
- package/dist/components/instance-form/components/variable/index.js +3 -3
- package/dist/components/instance-form/components/variables/index.js +1 -1
- package/dist/components/property-mapping/index.js +1 -1
- package/dist/components/range-selector/components/composite-list-range/index.js +1 -1
- package/dist/components/range-selector/components/date-range/index.js +1 -1
- package/dist/components/range-selector/index.js +1 -1
- package/dist/components/template-form/components/property-list/index.js +3 -3
- package/dist/components/template-form/components/property-list/property-list-form.js +3 -3
- package/dist/components/template-form/components/recognition-property-list/index.js +2 -2
- package/dist/components/template-form/components/recognition-property-list/recognition-property-list-form.js +2 -2
- package/dist/components/template-form/index.js +2 -2
- package/dist/components/template-property-filters/property.js +1 -1
- package/dist/components/tree-select/index.js +2 -2
- package/dist/components/treeview-filter/index.js +45 -592
- package/dist/components/treeview-filter/item/index.js +19 -19
- package/dist/components/treeview-filter/item/styled.js +2 -2
- package/dist/{dialog-DPGR2gik.js → dialog-DrVArHYg.js} +1 -1
- package/dist/{index-RfDWDd66.js → index-CAaDu0NI.js} +1979 -2071
- package/dist/{index-B_GNCJdV.js → index-D2tF2-ya.js} +2 -2
- package/dist/main.js +1 -1
- package/dist/{property-list-form-DgmTiBvu.js → property-list-form-CLSTkOmv.js} +2 -2
- package/package.json +2 -2
|
@@ -1,572 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import { u as Ce } from "../../useControlled-BYdyS7Pn.js";
|
|
18
|
-
import { o as Rt } from "../../ownerDocument-CUrv0DIK.js";
|
|
19
|
-
const De = /* @__PURE__ */ u.createContext({});
|
|
20
|
-
process.env.NODE_ENV !== "production" && (De.displayName = "TreeViewContext");
|
|
21
|
-
function Dt(i, h) {
|
|
22
|
-
let m = 0, p = i.length - 1;
|
|
23
|
-
for (; m <= p; ) {
|
|
24
|
-
const b = Math.floor((m + p) / 2);
|
|
25
|
-
if (i[b].element === h)
|
|
26
|
-
return b;
|
|
27
|
-
i[b].element.compareDocumentPosition(h) & Node.DOCUMENT_POSITION_PRECEDING ? p = b - 1 : m = b + 1;
|
|
28
|
-
}
|
|
29
|
-
return m;
|
|
30
|
-
}
|
|
31
|
-
const Pe = /* @__PURE__ */ u.createContext({});
|
|
32
|
-
process.env.NODE_ENV !== "production" && (Pe.displayName = "DescendantContext");
|
|
33
|
-
function ke(i) {
|
|
34
|
-
const {
|
|
35
|
-
children: h,
|
|
36
|
-
id: m
|
|
37
|
-
} = i, [p, b] = u.useState([]), j = u.useCallback(({
|
|
38
|
-
element: S,
|
|
39
|
-
...P
|
|
40
|
-
}) => {
|
|
41
|
-
b((N) => {
|
|
42
|
-
let T;
|
|
43
|
-
if (N.length === 0)
|
|
44
|
-
return [{
|
|
45
|
-
...P,
|
|
46
|
-
element: S,
|
|
47
|
-
index: 0
|
|
48
|
-
}];
|
|
49
|
-
const w = Dt(N, S);
|
|
50
|
-
if (N[w] && N[w].element === S)
|
|
51
|
-
T = N;
|
|
52
|
-
else {
|
|
53
|
-
const x = {
|
|
54
|
-
...P,
|
|
55
|
-
element: S,
|
|
56
|
-
index: w
|
|
57
|
-
};
|
|
58
|
-
T = N.slice(), T.splice(w, 0, x);
|
|
59
|
-
}
|
|
60
|
-
return T.forEach((x, J) => {
|
|
61
|
-
x.index = J;
|
|
62
|
-
}), T;
|
|
63
|
-
});
|
|
64
|
-
}, []), K = u.useCallback((S) => {
|
|
65
|
-
b((P) => P.filter((N) => S !== N.element));
|
|
66
|
-
}, []), $ = u.useMemo(() => ({
|
|
67
|
-
descendants: p,
|
|
68
|
-
registerDescendant: j,
|
|
69
|
-
unregisterDescendant: K,
|
|
70
|
-
parentId: m
|
|
71
|
-
}), [p, j, K, m]);
|
|
72
|
-
return /* @__PURE__ */ O(Pe.Provider, {
|
|
73
|
-
value: $,
|
|
74
|
-
children: h
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
process.env.NODE_ENV !== "production" && (ke.propTypes = {
|
|
78
|
-
children: s.node,
|
|
79
|
-
id: s.string
|
|
80
|
-
});
|
|
81
|
-
function Pt(i) {
|
|
82
|
-
return Ct("MuiTreeView", i);
|
|
83
|
-
}
|
|
84
|
-
St("MuiTreeView", ["root"]);
|
|
85
|
-
const kt = (i) => {
|
|
86
|
-
const {
|
|
87
|
-
classes: h
|
|
88
|
-
} = i;
|
|
89
|
-
return yt({
|
|
90
|
-
root: ["root"]
|
|
91
|
-
}, Pt, h);
|
|
92
|
-
}, Ft = It("ul", {
|
|
93
|
-
name: "MuiTreeView",
|
|
94
|
-
slot: "Root",
|
|
95
|
-
overridesResolver: (i, h) => h.root
|
|
96
|
-
})({
|
|
97
|
-
padding: 0,
|
|
98
|
-
margin: 0,
|
|
99
|
-
listStyle: "none",
|
|
100
|
-
outline: 0
|
|
101
|
-
});
|
|
102
|
-
function Mt(i) {
|
|
103
|
-
return i && i.length === 1 && i.match(/\S/);
|
|
104
|
-
}
|
|
105
|
-
function Ie(i, h, m) {
|
|
106
|
-
for (let p = h; p < i.length; p += 1)
|
|
107
|
-
if (m === i[p])
|
|
108
|
-
return p;
|
|
109
|
-
return -1;
|
|
110
|
-
}
|
|
111
|
-
function Oe() {
|
|
112
|
-
return !1;
|
|
113
|
-
}
|
|
114
|
-
const _t = [], At = [], Fe = /* @__PURE__ */ u.forwardRef(function(h, m) {
|
|
115
|
-
const p = wt({
|
|
116
|
-
props: h,
|
|
117
|
-
name: "MuiTreeView"
|
|
118
|
-
}), {
|
|
119
|
-
children: b,
|
|
120
|
-
className: j,
|
|
121
|
-
defaultCollapseIcon: K,
|
|
122
|
-
defaultEndIcon: $,
|
|
123
|
-
defaultExpanded: S = _t,
|
|
124
|
-
defaultExpandIcon: P,
|
|
125
|
-
defaultParentIcon: N,
|
|
126
|
-
defaultSelected: T = At,
|
|
127
|
-
disabledItemsFocusable: w = !1,
|
|
128
|
-
disableSelection: x = !1,
|
|
129
|
-
expanded: J,
|
|
130
|
-
id: D,
|
|
131
|
-
multiSelect: g = !1,
|
|
132
|
-
onBlur: L,
|
|
133
|
-
onFocus: Q,
|
|
134
|
-
onKeyDown: X,
|
|
135
|
-
onNodeFocus: ue,
|
|
136
|
-
onNodeSelect: k,
|
|
137
|
-
onNodeToggle: Y,
|
|
138
|
-
selected: Ae,
|
|
139
|
-
...Ve
|
|
140
|
-
} = p, de = Ot().direction === "rtl", fe = {
|
|
141
|
-
...p,
|
|
142
|
-
defaultExpanded: S,
|
|
143
|
-
defaultSelected: T,
|
|
144
|
-
disabledItemsFocusable: w,
|
|
145
|
-
disableSelection: x,
|
|
146
|
-
multiSelect: g
|
|
147
|
-
}, je = kt(fe), pe = Tt(D), ne = u.useRef(null), Ke = Et(ne, m), [c, se] = u.useState(null), d = u.useRef({}), q = u.useRef({}), [A, he] = Ce({
|
|
148
|
-
controlled: J,
|
|
149
|
-
default: S,
|
|
150
|
-
name: "TreeView",
|
|
151
|
-
state: "expanded"
|
|
152
|
-
}), [y, Z] = Ce({
|
|
153
|
-
controlled: Ae,
|
|
154
|
-
default: T,
|
|
155
|
-
name: "TreeView",
|
|
156
|
-
state: "selected"
|
|
157
|
-
}), F = u.useCallback((e) => Array.isArray(A) ? A.indexOf(e) !== -1 : !1, [A]), v = u.useCallback((e) => d.current[e] && d.current[e].expandable, []), Le = u.useCallback((e) => Array.isArray(y) ? y.indexOf(e) !== -1 : y === e, [y]), C = u.useCallback((e) => {
|
|
158
|
-
let t = d.current[e];
|
|
159
|
-
if (!t)
|
|
160
|
-
return !1;
|
|
161
|
-
if (t.disabled)
|
|
162
|
-
return !0;
|
|
163
|
-
for (; t.parentId != null; )
|
|
164
|
-
if (t = d.current[t.parentId], t.disabled)
|
|
165
|
-
return !0;
|
|
166
|
-
return !1;
|
|
167
|
-
}, []), Be = (e) => c === e, ee = (e) => Object.keys(d.current).map((t) => d.current[t]).filter((t) => t.parentId === e).sort((t, r) => t.index - r.index).map((t) => t.id), E = (e) => {
|
|
168
|
-
let t = ee(e);
|
|
169
|
-
return w || (t = t.filter((r) => !C(r))), t;
|
|
170
|
-
}, te = (e) => {
|
|
171
|
-
if (F(e) && E(e).length > 0)
|
|
172
|
-
return E(e)[0];
|
|
173
|
-
let t = d.current[e];
|
|
174
|
-
for (; t != null; ) {
|
|
175
|
-
const r = E(t.parentId), n = r[r.indexOf(t.id) + 1];
|
|
176
|
-
if (n)
|
|
177
|
-
return n;
|
|
178
|
-
t = d.current[t.parentId];
|
|
179
|
-
}
|
|
180
|
-
return null;
|
|
181
|
-
}, oe = (e) => {
|
|
182
|
-
const t = d.current[e], r = E(t.parentId), n = r.indexOf(e);
|
|
183
|
-
if (n === 0)
|
|
184
|
-
return t.parentId;
|
|
185
|
-
let o = r[n - 1];
|
|
186
|
-
for (; F(o) && E(o).length > 0; )
|
|
187
|
-
o = E(o).pop();
|
|
188
|
-
return o;
|
|
189
|
-
}, ce = () => {
|
|
190
|
-
let e = E(null).pop();
|
|
191
|
-
for (; F(e); )
|
|
192
|
-
e = E(e).pop();
|
|
193
|
-
return e;
|
|
194
|
-
}, ae = () => E(null)[0], Ue = (e) => d.current[e].parentId, $e = (e, t) => {
|
|
195
|
-
if (e === t)
|
|
196
|
-
return [e, t];
|
|
197
|
-
const r = d.current[e], n = d.current[t];
|
|
198
|
-
if (r.parentId === n.id || n.parentId === r.id)
|
|
199
|
-
return n.parentId === r.id ? [r.id, n.id] : [n.id, r.id];
|
|
200
|
-
const o = [r.id], a = [n.id];
|
|
201
|
-
let l = r.parentId, f = n.parentId, I = a.indexOf(l) !== -1, W = o.indexOf(f) !== -1, U = !0, G = !0;
|
|
202
|
-
for (; !W && !I; )
|
|
203
|
-
U && (o.push(l), I = a.indexOf(l) !== -1, U = l !== null, !I && U && (l = d.current[l].parentId)), G && !I && (a.push(f), W = o.indexOf(f) !== -1, G = f !== null, !W && G && (f = d.current[f].parentId));
|
|
204
|
-
const H = I ? l : f, be = ee(H), ft = o[o.indexOf(H) - 1], pt = a[a.indexOf(H) - 1];
|
|
205
|
-
return be.indexOf(ft) < be.indexOf(pt) ? [e, t] : [t, e];
|
|
206
|
-
}, qe = (e, t) => {
|
|
207
|
-
const [r, n] = $e(e, t), o = [r];
|
|
208
|
-
let a = r;
|
|
209
|
-
for (; a !== n; )
|
|
210
|
-
a = te(a), o.push(a);
|
|
211
|
-
return o;
|
|
212
|
-
}, M = (e, t) => {
|
|
213
|
-
t && (se(t), ue && ue(e, t));
|
|
214
|
-
}, me = (e, t) => M(e, te(t)), ze = (e, t) => M(e, oe(t)), We = (e) => M(e, ae()), Ge = (e) => M(e, ce()), He = (e, t, r) => {
|
|
215
|
-
let n, o;
|
|
216
|
-
const a = r.toLowerCase(), l = [], f = [];
|
|
217
|
-
Object.keys(q.current).forEach((I) => {
|
|
218
|
-
const W = q.current[I], U = d.current[I], G = U.parentId ? F(U.parentId) : !0, H = w ? !1 : C(I);
|
|
219
|
-
G && !H && (l.push(I), f.push(W));
|
|
220
|
-
}), n = l.indexOf(t) + 1, n >= l.length && (n = 0), o = Ie(f, n, a), o === -1 && (o = Ie(f, 0, a)), o > -1 && M(e, l[o]);
|
|
221
|
-
}, re = (e, t = c) => {
|
|
222
|
-
let r;
|
|
223
|
-
A.indexOf(t) !== -1 ? r = A.filter((n) => n !== t) : r = [t].concat(A), Y && Y(e, r), he(r);
|
|
224
|
-
}, Je = (e, t) => {
|
|
225
|
-
const r = d.current[t], o = ee(r.parentId).filter((l) => v(l) && !F(l)), a = A.concat(o);
|
|
226
|
-
o.length > 0 && (he(a), Y && Y(e, a));
|
|
227
|
-
}, _ = u.useRef(null), B = u.useRef(!1), R = u.useRef([]), Qe = (e, t) => {
|
|
228
|
-
let r = y.slice();
|
|
229
|
-
const {
|
|
230
|
-
start: n,
|
|
231
|
-
next: o,
|
|
232
|
-
current: a
|
|
233
|
-
} = t;
|
|
234
|
-
!o || !a || (R.current.indexOf(a) === -1 && (R.current = []), B.current ? R.current.indexOf(o) !== -1 ? (r = r.filter((l) => l === n || l !== a), R.current = R.current.filter((l) => l === n || l !== a)) : (r.push(o), R.current.push(o)) : (r.push(o), R.current.push(a, o)), k && k(e, r), Z(r));
|
|
235
|
-
}, Xe = (e, t) => {
|
|
236
|
-
let r = y.slice();
|
|
237
|
-
const {
|
|
238
|
-
start: n,
|
|
239
|
-
end: o
|
|
240
|
-
} = t;
|
|
241
|
-
B.current && (r = r.filter((f) => R.current.indexOf(f) === -1));
|
|
242
|
-
let a = qe(n, o);
|
|
243
|
-
a = a.filter((f) => !C(f)), R.current = a;
|
|
244
|
-
let l = r.concat(a);
|
|
245
|
-
l = l.filter((f, I) => l.indexOf(f) === I), k && k(e, l), Z(l);
|
|
246
|
-
}, Ye = (e, t) => {
|
|
247
|
-
let r;
|
|
248
|
-
y.indexOf(t) !== -1 ? r = y.filter((n) => n !== t) : r = [t].concat(y), k && k(e, r), Z(r);
|
|
249
|
-
}, Ze = (e, t) => {
|
|
250
|
-
const r = g ? [t] : t;
|
|
251
|
-
k && k(e, r), Z(r);
|
|
252
|
-
}, z = (e, t, r = !1) => t ? (r ? Ye(e, t) : Ze(e, t), _.current = t, B.current = !1, R.current = [], !0) : !1, V = (e, t, r = !1) => {
|
|
253
|
-
const {
|
|
254
|
-
start: n = _.current,
|
|
255
|
-
end: o,
|
|
256
|
-
current: a
|
|
257
|
-
} = t;
|
|
258
|
-
r ? Qe(e, {
|
|
259
|
-
start: n,
|
|
260
|
-
next: o,
|
|
261
|
-
current: a
|
|
262
|
-
}) : n != null && o != null && Xe(e, {
|
|
263
|
-
start: n,
|
|
264
|
-
end: o
|
|
265
|
-
}), B.current = !0;
|
|
266
|
-
}, ve = (e, t) => {
|
|
267
|
-
_.current || (_.current = t);
|
|
268
|
-
const r = B.current ? _.current : t;
|
|
269
|
-
V(e, {
|
|
270
|
-
start: r,
|
|
271
|
-
end: ae()
|
|
272
|
-
});
|
|
273
|
-
}, et = (e, t) => {
|
|
274
|
-
_.current || (_.current = t);
|
|
275
|
-
const r = B.current ? _.current : t;
|
|
276
|
-
V(e, {
|
|
277
|
-
start: r,
|
|
278
|
-
end: ce()
|
|
279
|
-
});
|
|
280
|
-
}, tt = (e, t) => {
|
|
281
|
-
C(te(t)) || V(e, {
|
|
282
|
-
end: te(t),
|
|
283
|
-
current: t
|
|
284
|
-
}, !0);
|
|
285
|
-
}, rt = (e, t) => {
|
|
286
|
-
C(oe(t)) || V(e, {
|
|
287
|
-
end: oe(t),
|
|
288
|
-
current: t
|
|
289
|
-
}, !0);
|
|
290
|
-
}, nt = (e) => {
|
|
291
|
-
V(e, {
|
|
292
|
-
start: ae(),
|
|
293
|
-
end: ce()
|
|
294
|
-
});
|
|
295
|
-
}, st = u.useCallback((e) => {
|
|
296
|
-
const {
|
|
297
|
-
id: t,
|
|
298
|
-
index: r,
|
|
299
|
-
parentId: n,
|
|
300
|
-
expandable: o,
|
|
301
|
-
idAttribute: a,
|
|
302
|
-
disabled: l
|
|
303
|
-
} = e;
|
|
304
|
-
d.current[t] = {
|
|
305
|
-
id: t,
|
|
306
|
-
index: r,
|
|
307
|
-
parentId: n,
|
|
308
|
-
expandable: o,
|
|
309
|
-
idAttribute: a,
|
|
310
|
-
disabled: l
|
|
311
|
-
};
|
|
312
|
-
}, []), ot = u.useCallback((e) => {
|
|
313
|
-
const t = {
|
|
314
|
-
...d.current
|
|
315
|
-
};
|
|
316
|
-
delete t[e], d.current = t, se((r) => r === e && ne.current === Rt(ne.current).activeElement ? ee(null)[0] : r);
|
|
317
|
-
}, []), ct = u.useCallback((e, t) => {
|
|
318
|
-
q.current[e] = t;
|
|
319
|
-
}, []), at = u.useCallback((e) => {
|
|
320
|
-
const t = {
|
|
321
|
-
...q.current
|
|
322
|
-
};
|
|
323
|
-
delete t[e], q.current = t;
|
|
324
|
-
}, []), xe = (e) => (v(c) && (F(c) ? me(e, c) : C(c) || re(e)), !0), ge = (e) => {
|
|
325
|
-
if (F(c) && !C(c))
|
|
326
|
-
return re(e, c), !0;
|
|
327
|
-
const t = Ue(c);
|
|
328
|
-
return t ? (M(e, t), !0) : !1;
|
|
329
|
-
}, lt = (e) => {
|
|
330
|
-
let t = !1;
|
|
331
|
-
const r = e.key;
|
|
332
|
-
if (e.altKey || e.currentTarget !== e.target || !c)
|
|
333
|
-
return;
|
|
334
|
-
const n = e.ctrlKey || e.metaKey;
|
|
335
|
-
switch (r) {
|
|
336
|
-
case " ":
|
|
337
|
-
!x && !C(c) && (g && e.shiftKey ? (V(e, {
|
|
338
|
-
end: c
|
|
339
|
-
}), t = !0) : g ? t = z(e, c, !0) : t = z(e, c)), e.stopPropagation();
|
|
340
|
-
break;
|
|
341
|
-
case "Enter":
|
|
342
|
-
C(c) || (v(c) ? (re(e), t = !0) : g ? t = z(e, c, !0) : t = z(e, c)), e.stopPropagation();
|
|
343
|
-
break;
|
|
344
|
-
case "ArrowDown":
|
|
345
|
-
g && e.shiftKey && !x && tt(e, c), me(e, c), t = !0;
|
|
346
|
-
break;
|
|
347
|
-
case "ArrowUp":
|
|
348
|
-
g && e.shiftKey && !x && rt(e, c), ze(e, c), t = !0;
|
|
349
|
-
break;
|
|
350
|
-
case "ArrowRight":
|
|
351
|
-
de ? t = ge(e) : t = xe(e);
|
|
352
|
-
break;
|
|
353
|
-
case "ArrowLeft":
|
|
354
|
-
de ? t = xe(e) : t = ge(e);
|
|
355
|
-
break;
|
|
356
|
-
case "Home":
|
|
357
|
-
g && n && e.shiftKey && !x && !C(c) && ve(e, c), We(e), t = !0;
|
|
358
|
-
break;
|
|
359
|
-
case "End":
|
|
360
|
-
g && n && e.shiftKey && !x && !C(c) && et(e, c), Ge(e), t = !0;
|
|
361
|
-
break;
|
|
362
|
-
default:
|
|
363
|
-
r === "*" ? (Je(e, c), t = !0) : g && n && r.toLowerCase() === "a" && !x ? (nt(e), t = !0) : !n && !e.shiftKey && Mt(r) && (He(e, c, r), t = !0);
|
|
364
|
-
}
|
|
365
|
-
t && (e.preventDefault(), e.stopPropagation()), X && X(e);
|
|
366
|
-
}, it = (e) => {
|
|
367
|
-
if (e.target === e.currentTarget) {
|
|
368
|
-
const t = Array.isArray(y) ? y[0] : y;
|
|
369
|
-
M(e, t || E(null)[0]);
|
|
370
|
-
}
|
|
371
|
-
Q && Q(e);
|
|
372
|
-
}, ut = (e) => {
|
|
373
|
-
se(null), L && L(e);
|
|
374
|
-
}, dt = d.current[c] ? d.current[c].idAttribute : null;
|
|
375
|
-
return /* @__PURE__ */ O(De.Provider, {
|
|
376
|
-
// TODO: fix this lint error
|
|
377
|
-
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
378
|
-
value: {
|
|
379
|
-
icons: {
|
|
380
|
-
defaultCollapseIcon: K,
|
|
381
|
-
defaultExpandIcon: P,
|
|
382
|
-
defaultParentIcon: N,
|
|
383
|
-
defaultEndIcon: $
|
|
384
|
-
},
|
|
385
|
-
focus: M,
|
|
386
|
-
toggleExpansion: re,
|
|
387
|
-
isExpanded: F,
|
|
388
|
-
isExpandable: v,
|
|
389
|
-
isFocused: Be,
|
|
390
|
-
isSelected: Le,
|
|
391
|
-
isDisabled: C,
|
|
392
|
-
selectNode: x ? Oe : z,
|
|
393
|
-
selectRange: x ? Oe : V,
|
|
394
|
-
multiSelect: g,
|
|
395
|
-
disabledItemsFocusable: w,
|
|
396
|
-
mapFirstChar: ct,
|
|
397
|
-
unMapFirstChar: at,
|
|
398
|
-
registerNode: st,
|
|
399
|
-
unregisterNode: ot,
|
|
400
|
-
treeId: pe
|
|
401
|
-
},
|
|
402
|
-
children: /* @__PURE__ */ O(ke, {
|
|
403
|
-
children: /* @__PURE__ */ O(Ft, {
|
|
404
|
-
role: "tree",
|
|
405
|
-
id: pe,
|
|
406
|
-
"aria-activedescendant": dt,
|
|
407
|
-
"aria-multiselectable": g,
|
|
408
|
-
className: Nt(je.root, j),
|
|
409
|
-
ref: Ke,
|
|
410
|
-
tabIndex: 0,
|
|
411
|
-
onKeyDown: lt,
|
|
412
|
-
onFocus: it,
|
|
413
|
-
onBlur: ut,
|
|
414
|
-
ownerState: fe,
|
|
415
|
-
...Ve,
|
|
416
|
-
children: b
|
|
417
|
-
})
|
|
418
|
-
})
|
|
419
|
-
});
|
|
420
|
-
});
|
|
421
|
-
process.env.NODE_ENV !== "production" && (Fe.propTypes = {
|
|
422
|
-
// ----------------------------- Warning --------------------------------
|
|
423
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
424
|
-
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
425
|
-
// ----------------------------------------------------------------------
|
|
426
|
-
/**
|
|
427
|
-
* The content of the component.
|
|
428
|
-
*/
|
|
429
|
-
children: s.node,
|
|
430
|
-
/**
|
|
431
|
-
* Override or extend the styles applied to the component.
|
|
432
|
-
*/
|
|
433
|
-
classes: s.object,
|
|
434
|
-
/**
|
|
435
|
-
* @ignore
|
|
436
|
-
*/
|
|
437
|
-
className: s.string,
|
|
438
|
-
/**
|
|
439
|
-
* The default icon used to collapse the node.
|
|
440
|
-
*/
|
|
441
|
-
defaultCollapseIcon: s.node,
|
|
442
|
-
/**
|
|
443
|
-
* The default icon displayed next to a end node. This is applied to all
|
|
444
|
-
* tree nodes and can be overridden by the TreeItem `icon` prop.
|
|
445
|
-
*/
|
|
446
|
-
defaultEndIcon: s.node,
|
|
447
|
-
/**
|
|
448
|
-
* Expanded node ids. (Uncontrolled)
|
|
449
|
-
* @default []
|
|
450
|
-
*/
|
|
451
|
-
defaultExpanded: s.arrayOf(s.string),
|
|
452
|
-
/**
|
|
453
|
-
* The default icon used to expand the node.
|
|
454
|
-
*/
|
|
455
|
-
defaultExpandIcon: s.node,
|
|
456
|
-
/**
|
|
457
|
-
* The default icon displayed next to a parent node. This is applied to all
|
|
458
|
-
* parent nodes and can be overridden by the TreeItem `icon` prop.
|
|
459
|
-
*/
|
|
460
|
-
defaultParentIcon: s.node,
|
|
461
|
-
/**
|
|
462
|
-
* Selected node ids. (Uncontrolled)
|
|
463
|
-
* When `multiSelect` is true this takes an array of strings; when false (default) a string.
|
|
464
|
-
* @default []
|
|
465
|
-
*/
|
|
466
|
-
defaultSelected: s.oneOfType([s.arrayOf(s.string), s.string]),
|
|
467
|
-
/**
|
|
468
|
-
* If `true`, will allow focus on disabled items.
|
|
469
|
-
* @default false
|
|
470
|
-
*/
|
|
471
|
-
disabledItemsFocusable: s.bool,
|
|
472
|
-
/**
|
|
473
|
-
* If `true` selection is disabled.
|
|
474
|
-
* @default false
|
|
475
|
-
*/
|
|
476
|
-
disableSelection: s.bool,
|
|
477
|
-
/**
|
|
478
|
-
* Expanded node ids. (Controlled)
|
|
479
|
-
*/
|
|
480
|
-
expanded: s.arrayOf(s.string),
|
|
481
|
-
/**
|
|
482
|
-
* This prop is used to help implement the accessibility logic.
|
|
483
|
-
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
484
|
-
*/
|
|
485
|
-
id: s.string,
|
|
486
|
-
/**
|
|
487
|
-
* If true `ctrl` and `shift` will trigger multiselect.
|
|
488
|
-
* @default false
|
|
489
|
-
*/
|
|
490
|
-
multiSelect: s.bool,
|
|
491
|
-
/**
|
|
492
|
-
* @ignore
|
|
493
|
-
*/
|
|
494
|
-
onBlur: s.func,
|
|
495
|
-
/**
|
|
496
|
-
* @ignore
|
|
497
|
-
*/
|
|
498
|
-
onFocus: s.func,
|
|
499
|
-
/**
|
|
500
|
-
* @ignore
|
|
501
|
-
*/
|
|
502
|
-
onKeyDown: s.func,
|
|
503
|
-
/**
|
|
504
|
-
* Callback fired when tree items are focused.
|
|
505
|
-
*
|
|
506
|
-
* @param {React.SyntheticEvent} event The event source of the callback **Warning**: This is a generic event not a focus event.
|
|
507
|
-
* @param {string} value of the focused node.
|
|
508
|
-
*/
|
|
509
|
-
onNodeFocus: s.func,
|
|
510
|
-
/**
|
|
511
|
-
* Callback fired when tree items are selected/unselected.
|
|
512
|
-
*
|
|
513
|
-
* @param {React.SyntheticEvent} event The event source of the callback
|
|
514
|
-
* @param {string[] | string} nodeIds Ids of the selected nodes. When `multiSelect` is true
|
|
515
|
-
* this is an array of strings; when false (default) a string.
|
|
516
|
-
*/
|
|
517
|
-
onNodeSelect: s.func,
|
|
518
|
-
/**
|
|
519
|
-
* Callback fired when tree items are expanded/collapsed.
|
|
520
|
-
*
|
|
521
|
-
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
522
|
-
* @param {array} nodeIds The ids of the expanded nodes.
|
|
523
|
-
*/
|
|
524
|
-
onNodeToggle: s.func,
|
|
525
|
-
/**
|
|
526
|
-
* Selected node ids. (Controlled)
|
|
527
|
-
* When `multiSelect` is true this takes an array of strings; when false (default) a string.
|
|
528
|
-
*/
|
|
529
|
-
selected: s.oneOfType([s.arrayOf(s.string), s.string]),
|
|
530
|
-
/**
|
|
531
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
532
|
-
*/
|
|
533
|
-
sx: s.oneOfType([s.arrayOf(s.oneOfType([s.func, s.object, s.bool])), s.func, s.object])
|
|
534
|
-
});
|
|
535
|
-
var le = {}, Vt = Re;
|
|
536
|
-
Object.defineProperty(le, "__esModule", {
|
|
537
|
-
value: !0
|
|
538
|
-
});
|
|
539
|
-
var Me = le.default = void 0, jt = Vt(Ee()), Kt = Te;
|
|
540
|
-
Me = le.default = (0, jt.default)(/* @__PURE__ */ (0, Kt.jsx)("path", {
|
|
541
|
-
d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
|
|
542
|
-
}), "ExpandMore");
|
|
543
|
-
var ie = {}, Lt = Re;
|
|
544
|
-
Object.defineProperty(ie, "__esModule", {
|
|
545
|
-
value: !0
|
|
546
|
-
});
|
|
547
|
-
var _e = ie.default = void 0, Bt = Lt(Ee()), Ut = Te;
|
|
548
|
-
_e = ie.default = (0, Bt.default)(/* @__PURE__ */ (0, Ut.jsx)("path", {
|
|
549
|
-
d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
|
|
550
|
-
}), "ChevronRight");
|
|
551
|
-
const cr = ({
|
|
552
|
-
data: i,
|
|
553
|
-
idKey: h = "id",
|
|
554
|
-
selected: m,
|
|
555
|
-
expanded: p,
|
|
556
|
-
disabled: b,
|
|
557
|
-
disableSearch: j,
|
|
558
|
-
onChange: K,
|
|
559
|
-
onToggle: $
|
|
1
|
+
import { jsxs as c, Fragment as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import d from "react";
|
|
3
|
+
import { SimpleTreeView as D } from "@mui/x-tree-view";
|
|
4
|
+
import I from "./item/index.js";
|
|
5
|
+
import p from "lodash";
|
|
6
|
+
import { Box as C, Divider as F } from "@mui/material";
|
|
7
|
+
import { SearchInput as L } from "../search-input/index.js";
|
|
8
|
+
import { flattenNestedTemplates as _ } from "../../utils/ontology.js";
|
|
9
|
+
const R = ({
|
|
10
|
+
data: l,
|
|
11
|
+
idKey: n = "id",
|
|
12
|
+
selected: a,
|
|
13
|
+
// expanded,
|
|
14
|
+
disabled: s,
|
|
15
|
+
disableSearch: u,
|
|
16
|
+
onChange: f
|
|
560
17
|
}) => {
|
|
561
|
-
const [
|
|
562
|
-
(
|
|
563
|
-
) :
|
|
564
|
-
let
|
|
565
|
-
const
|
|
566
|
-
return /* @__PURE__ */
|
|
567
|
-
!
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
|
|
18
|
+
const [i, h] = d.useState(""), S = _(l), x = d.useMemo(() => i.length > 0 ? S.filter(
|
|
19
|
+
(e) => e.name.toLowerCase().includes(i)
|
|
20
|
+
) : l, [i, l]);
|
|
21
|
+
let o = null;
|
|
22
|
+
const b = 500;
|
|
23
|
+
return /* @__PURE__ */ c(m, { children: [
|
|
24
|
+
!u && /* @__PURE__ */ c(m, { children: [
|
|
25
|
+
/* @__PURE__ */ t(C, { px: 1, pt: 0.75, children: /* @__PURE__ */ t(
|
|
26
|
+
L,
|
|
570
27
|
{
|
|
571
28
|
fullWidth: !0,
|
|
572
29
|
disableLabel: !0,
|
|
@@ -578,38 +35,34 @@ const cr = ({
|
|
|
578
35
|
}
|
|
579
36
|
},
|
|
580
37
|
iconSize: "small",
|
|
581
|
-
onChange: (
|
|
582
|
-
|
|
38
|
+
onChange: (e) => {
|
|
39
|
+
o && clearTimeout(o), o = setTimeout(() => h(e.toLowerCase()), b);
|
|
583
40
|
}
|
|
584
41
|
}
|
|
585
42
|
) }),
|
|
586
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ t(F, { sx: { mt: 1.75 } })
|
|
587
44
|
] }),
|
|
588
|
-
/* @__PURE__ */
|
|
589
|
-
|
|
45
|
+
/* @__PURE__ */ t(
|
|
46
|
+
D,
|
|
590
47
|
{
|
|
591
48
|
"aria-label": "tree view filter",
|
|
592
|
-
defaultCollapseIcon: /* @__PURE__ */ O(Me, {}),
|
|
593
|
-
defaultExpandIcon: /* @__PURE__ */ O(_e, {}),
|
|
594
49
|
disableSelection: !0,
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
return /* @__PURE__ */ O(
|
|
600
|
-
ht,
|
|
50
|
+
children: x.map((e, T) => {
|
|
51
|
+
const r = String(e[n]), g = p.includes(a, r), w = p.includes(s, r);
|
|
52
|
+
return console.log({ id: r }), /* @__PURE__ */ t(
|
|
53
|
+
I,
|
|
601
54
|
{
|
|
602
|
-
id:
|
|
603
|
-
idKey:
|
|
604
|
-
name:
|
|
605
|
-
checked:
|
|
606
|
-
disabled:
|
|
607
|
-
disabledIds:
|
|
608
|
-
children:
|
|
609
|
-
onChange:
|
|
610
|
-
defaultSelected:
|
|
55
|
+
id: r,
|
|
56
|
+
idKey: n,
|
|
57
|
+
name: e.name,
|
|
58
|
+
checked: g,
|
|
59
|
+
disabled: w,
|
|
60
|
+
disabledIds: s,
|
|
61
|
+
children: e.children,
|
|
62
|
+
onChange: f,
|
|
63
|
+
defaultSelected: a
|
|
611
64
|
},
|
|
612
|
-
|
|
65
|
+
T
|
|
613
66
|
);
|
|
614
67
|
})
|
|
615
68
|
}
|
|
@@ -617,5 +70,5 @@ const cr = ({
|
|
|
617
70
|
] });
|
|
618
71
|
};
|
|
619
72
|
export {
|
|
620
|
-
|
|
73
|
+
R as TreeViewFilter
|
|
621
74
|
};
|