react-composable-treeview 1.0.6 → 1.0.7
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/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +114 -112
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,18 +14,18 @@ function br() {
|
|
|
14
14
|
if (Ne)
|
|
15
15
|
return q;
|
|
16
16
|
Ne = 1;
|
|
17
|
-
var t = We, o = Symbol.for("react.element"), i = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty,
|
|
18
|
-
function
|
|
17
|
+
var t = We, o = Symbol.for("react.element"), i = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, s = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function f(l, _, y) {
|
|
19
19
|
var b, w = {}, T = null, S = null;
|
|
20
20
|
y !== void 0 && (T = "" + y), _.key !== void 0 && (T = "" + _.key), _.ref !== void 0 && (S = _.ref);
|
|
21
21
|
for (b in _)
|
|
22
|
-
a.call(_, b) && !
|
|
23
|
-
if (
|
|
24
|
-
for (b in _ =
|
|
22
|
+
a.call(_, b) && !v.hasOwnProperty(b) && (w[b] = _[b]);
|
|
23
|
+
if (l && l.defaultProps)
|
|
24
|
+
for (b in _ = l.defaultProps, _)
|
|
25
25
|
w[b] === void 0 && (w[b] = _[b]);
|
|
26
|
-
return { $$typeof: o, type:
|
|
26
|
+
return { $$typeof: o, type: l, key: T, ref: S, props: w, _owner: s.current };
|
|
27
27
|
}
|
|
28
|
-
return q.Fragment = i, q.jsx =
|
|
28
|
+
return q.Fragment = i, q.jsx = f, q.jsxs = f, q;
|
|
29
29
|
}
|
|
30
30
|
var K = {};
|
|
31
31
|
/**
|
|
@@ -40,7 +40,7 @@ var K = {};
|
|
|
40
40
|
var $e;
|
|
41
41
|
function Rr() {
|
|
42
42
|
return $e || ($e = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var t = We, o = Symbol.for("react.element"), i = Symbol.for("react.portal"), a = Symbol.for("react.fragment"),
|
|
43
|
+
var t = We, o = Symbol.for("react.element"), i = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), l = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), A = Symbol.iterator, E = "@@iterator";
|
|
44
44
|
function L(e) {
|
|
45
45
|
if (e === null || typeof e != "object")
|
|
46
46
|
return null;
|
|
@@ -57,10 +57,10 @@ function Rr() {
|
|
|
57
57
|
}
|
|
58
58
|
function x(e, r, n) {
|
|
59
59
|
{
|
|
60
|
-
var u = P.ReactDebugCurrentFrame,
|
|
61
|
-
|
|
62
|
-
var g = n.map(function(
|
|
63
|
-
return String(
|
|
60
|
+
var u = P.ReactDebugCurrentFrame, p = u.getStackAddendum();
|
|
61
|
+
p !== "" && (r += "%s", n = n.concat([p]));
|
|
62
|
+
var g = n.map(function(d) {
|
|
63
|
+
return String(d);
|
|
64
64
|
});
|
|
65
65
|
g.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, g);
|
|
66
66
|
}
|
|
@@ -68,7 +68,7 @@ function Rr() {
|
|
|
68
68
|
var k = !1, N = !1, H = !1, X = !1, Be = !1, pe;
|
|
69
69
|
pe = Symbol.for("react.module.reference");
|
|
70
70
|
function qe(e) {
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e === a || e ===
|
|
71
|
+
return !!(typeof e == "string" || typeof e == "function" || e === a || e === v || Be || e === s || e === y || e === b || X || e === S || k || N || H || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === w || e.$$typeof === f || e.$$typeof === l || e.$$typeof === _ || // This needs to include all possible module reference object
|
|
72
72
|
// types supported by any Flight configuration anywhere since
|
|
73
73
|
// we don't know which Flight build this will end up being used
|
|
74
74
|
// with.
|
|
@@ -78,8 +78,8 @@ function Rr() {
|
|
|
78
78
|
var u = e.displayName;
|
|
79
79
|
if (u)
|
|
80
80
|
return u;
|
|
81
|
-
var
|
|
82
|
-
return
|
|
81
|
+
var p = r.displayName || r.name || "";
|
|
82
|
+
return p !== "" ? n + "(" + p + ")" : n;
|
|
83
83
|
}
|
|
84
84
|
function he(e) {
|
|
85
85
|
return e.displayName || "Context";
|
|
@@ -96,9 +96,9 @@ function Rr() {
|
|
|
96
96
|
return "Fragment";
|
|
97
97
|
case i:
|
|
98
98
|
return "Portal";
|
|
99
|
-
case
|
|
99
|
+
case v:
|
|
100
100
|
return "Profiler";
|
|
101
|
-
case
|
|
101
|
+
case s:
|
|
102
102
|
return "StrictMode";
|
|
103
103
|
case y:
|
|
104
104
|
return "Suspense";
|
|
@@ -107,10 +107,10 @@ function Rr() {
|
|
|
107
107
|
}
|
|
108
108
|
if (typeof e == "object")
|
|
109
109
|
switch (e.$$typeof) {
|
|
110
|
-
case
|
|
110
|
+
case l:
|
|
111
111
|
var r = e;
|
|
112
112
|
return he(r) + ".Consumer";
|
|
113
|
-
case
|
|
113
|
+
case f:
|
|
114
114
|
var n = e;
|
|
115
115
|
return he(n._context) + ".Provider";
|
|
116
116
|
case _:
|
|
@@ -119,9 +119,9 @@ function Rr() {
|
|
|
119
119
|
var u = e.displayName || null;
|
|
120
120
|
return u !== null ? u : j(e.type) || "Memo";
|
|
121
121
|
case T: {
|
|
122
|
-
var
|
|
122
|
+
var p = e, g = p._payload, d = p._init;
|
|
123
123
|
try {
|
|
124
|
-
return j(
|
|
124
|
+
return j(d(g));
|
|
125
125
|
} catch {
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
@@ -197,8 +197,8 @@ function Rr() {
|
|
|
197
197
|
if (ae === void 0)
|
|
198
198
|
try {
|
|
199
199
|
throw Error();
|
|
200
|
-
} catch (
|
|
201
|
-
var u =
|
|
200
|
+
} catch (p) {
|
|
201
|
+
var u = p.stack.trim().match(/\n( *(at )?)/);
|
|
202
202
|
ae = u && u[1] || "";
|
|
203
203
|
}
|
|
204
204
|
return `
|
|
@@ -220,33 +220,33 @@ function Rr() {
|
|
|
220
220
|
}
|
|
221
221
|
var u;
|
|
222
222
|
ie = !0;
|
|
223
|
-
var
|
|
223
|
+
var p = Error.prepareStackTrace;
|
|
224
224
|
Error.prepareStackTrace = void 0;
|
|
225
225
|
var g;
|
|
226
226
|
g = oe.current, oe.current = null, Je();
|
|
227
227
|
try {
|
|
228
228
|
if (r) {
|
|
229
|
-
var
|
|
229
|
+
var d = function() {
|
|
230
230
|
throw Error();
|
|
231
231
|
};
|
|
232
|
-
if (Object.defineProperty(
|
|
232
|
+
if (Object.defineProperty(d.prototype, "props", {
|
|
233
233
|
set: function() {
|
|
234
234
|
throw Error();
|
|
235
235
|
}
|
|
236
236
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
237
|
try {
|
|
238
|
-
Reflect.construct(
|
|
238
|
+
Reflect.construct(d, []);
|
|
239
239
|
} catch (D) {
|
|
240
240
|
u = D;
|
|
241
241
|
}
|
|
242
|
-
Reflect.construct(e, [],
|
|
242
|
+
Reflect.construct(e, [], d);
|
|
243
243
|
} else {
|
|
244
244
|
try {
|
|
245
|
-
|
|
245
|
+
d.call();
|
|
246
246
|
} catch (D) {
|
|
247
247
|
u = D;
|
|
248
248
|
}
|
|
249
|
-
e.call(
|
|
249
|
+
e.call(d.prototype);
|
|
250
250
|
}
|
|
251
251
|
} else {
|
|
252
252
|
try {
|
|
@@ -276,7 +276,7 @@ function Rr() {
|
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
} finally {
|
|
279
|
-
ie = !1, oe.current = g, Me(), Error.prepareStackTrace =
|
|
279
|
+
ie = !1, oe.current = g, Me(), Error.prepareStackTrace = p;
|
|
280
280
|
}
|
|
281
281
|
var Y = e ? e.displayName || e.name : "", Le = Y ? Z(Y) : "";
|
|
282
282
|
return typeof e == "function" && Q.set(e, Le), Le;
|
|
@@ -308,9 +308,9 @@ function Rr() {
|
|
|
308
308
|
case w:
|
|
309
309
|
return ee(e.type, r, n);
|
|
310
310
|
case T: {
|
|
311
|
-
var u = e,
|
|
311
|
+
var u = e, p = u._payload, g = u._init;
|
|
312
312
|
try {
|
|
313
|
-
return ee(g(
|
|
313
|
+
return ee(g(p), r, n);
|
|
314
314
|
} catch {
|
|
315
315
|
}
|
|
316
316
|
}
|
|
@@ -325,22 +325,22 @@ function Rr() {
|
|
|
325
325
|
} else
|
|
326
326
|
Ce.setExtraStackFrame(null);
|
|
327
327
|
}
|
|
328
|
-
function Ze(e, r, n, u,
|
|
328
|
+
function Ze(e, r, n, u, p) {
|
|
329
329
|
{
|
|
330
330
|
var g = Function.call.bind(re);
|
|
331
|
-
for (var
|
|
332
|
-
if (g(e,
|
|
331
|
+
for (var d in e)
|
|
332
|
+
if (g(e, d)) {
|
|
333
333
|
var c = void 0;
|
|
334
334
|
try {
|
|
335
|
-
if (typeof e[
|
|
336
|
-
var C = Error((u || "React class") + ": " + n + " type `" +
|
|
335
|
+
if (typeof e[d] != "function") {
|
|
336
|
+
var C = Error((u || "React class") + ": " + n + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
337
|
throw C.name = "Invariant Violation", C;
|
|
338
338
|
}
|
|
339
|
-
c = e[
|
|
339
|
+
c = e[d](r, d, u, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
340
|
} catch (R) {
|
|
341
341
|
c = R;
|
|
342
342
|
}
|
|
343
|
-
c && !(c instanceof Error) && (te(
|
|
343
|
+
c && !(c instanceof Error) && (te(p), h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", u || "React class", n, d, typeof c), te(null)), c instanceof Error && !(c.message in xe) && (xe[c.message] = !0, te(p), h("Failed %s type: %s", n, c.message), te(null));
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
}
|
|
@@ -419,7 +419,7 @@ function Rr() {
|
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
var cr = function(e, r, n, u,
|
|
422
|
+
var cr = function(e, r, n, u, p, g, d) {
|
|
423
423
|
var c = {
|
|
424
424
|
// This tag allows us to uniquely identify this as a React Element
|
|
425
425
|
$$typeof: o,
|
|
@@ -427,7 +427,7 @@ function Rr() {
|
|
|
427
427
|
type: e,
|
|
428
428
|
key: r,
|
|
429
429
|
ref: n,
|
|
430
|
-
props:
|
|
430
|
+
props: d,
|
|
431
431
|
// Record the component responsible for creating this element.
|
|
432
432
|
_owner: g
|
|
433
433
|
};
|
|
@@ -445,25 +445,25 @@ function Rr() {
|
|
|
445
445
|
configurable: !1,
|
|
446
446
|
enumerable: !1,
|
|
447
447
|
writable: !1,
|
|
448
|
-
value:
|
|
448
|
+
value: p
|
|
449
449
|
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
|
|
450
450
|
};
|
|
451
|
-
function sr(e, r, n, u,
|
|
451
|
+
function sr(e, r, n, u, p) {
|
|
452
452
|
{
|
|
453
|
-
var g,
|
|
454
|
-
n !== void 0 && (Pe(n), c = "" + n), or(r) && (Pe(r.key), c = "" + r.key), nr(r) && (C = r.ref, ar(r,
|
|
453
|
+
var g, d = {}, c = null, C = null;
|
|
454
|
+
n !== void 0 && (Pe(n), c = "" + n), or(r) && (Pe(r.key), c = "" + r.key), nr(r) && (C = r.ref, ar(r, p));
|
|
455
455
|
for (g in r)
|
|
456
|
-
re.call(r, g) && !tr.hasOwnProperty(g) && (
|
|
456
|
+
re.call(r, g) && !tr.hasOwnProperty(g) && (d[g] = r[g]);
|
|
457
457
|
if (e && e.defaultProps) {
|
|
458
458
|
var R = e.defaultProps;
|
|
459
459
|
for (g in R)
|
|
460
|
-
|
|
460
|
+
d[g] === void 0 && (d[g] = R[g]);
|
|
461
461
|
}
|
|
462
462
|
if (c || C) {
|
|
463
463
|
var m = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
464
|
-
c && ir(
|
|
464
|
+
c && ir(d, m), C && ur(d, m);
|
|
465
465
|
}
|
|
466
|
-
return cr(e, c, C,
|
|
466
|
+
return cr(e, c, C, p, u, B.current, d);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
var se = P.ReactCurrentOwner, je = P.ReactDebugCurrentFrame;
|
|
@@ -540,10 +540,10 @@ Check the top-level render call using <` + n + ">.");
|
|
|
540
540
|
else if (le(e))
|
|
541
541
|
e._store && (e._store.validated = !0);
|
|
542
542
|
else if (e) {
|
|
543
|
-
var
|
|
544
|
-
if (typeof
|
|
545
|
-
for (var g =
|
|
546
|
-
le(
|
|
543
|
+
var p = L(e);
|
|
544
|
+
if (typeof p == "function" && p !== e.entries)
|
|
545
|
+
for (var g = p.call(e), d; !(d = g.next()).done; )
|
|
546
|
+
le(d.value) && Fe(d.value, r);
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
}
|
|
@@ -566,8 +566,8 @@ Check the top-level render call using <` + n + ">.");
|
|
|
566
566
|
Ze(n, e.props, "prop", u, e);
|
|
567
567
|
} else if (r.PropTypes !== void 0 && !fe) {
|
|
568
568
|
fe = !0;
|
|
569
|
-
var
|
|
570
|
-
h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
|
569
|
+
var p = j(r);
|
|
570
|
+
h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
|
|
571
571
|
}
|
|
572
572
|
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
573
|
}
|
|
@@ -584,21 +584,21 @@ Check the top-level render call using <` + n + ">.");
|
|
|
584
584
|
e.ref !== null && (W(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
function Ve(e, r, n, u,
|
|
587
|
+
function Ve(e, r, n, u, p, g) {
|
|
588
588
|
{
|
|
589
|
-
var
|
|
590
|
-
if (!
|
|
589
|
+
var d = qe(e);
|
|
590
|
+
if (!d) {
|
|
591
591
|
var c = "";
|
|
592
592
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (c += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
593
|
-
var C = fr(
|
|
593
|
+
var C = fr(p);
|
|
594
594
|
C ? c += C : c += De();
|
|
595
595
|
var R;
|
|
596
596
|
e === null ? R = "null" : ue(e) ? R = "array" : e !== void 0 && e.$$typeof === o ? (R = "<" + (j(e.type) || "Unknown") + " />", c = " Did you accidentally export a JSX literal instead of a component?") : R = typeof e, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, c);
|
|
597
597
|
}
|
|
598
|
-
var m = sr(e, r, n,
|
|
598
|
+
var m = sr(e, r, n, p, g);
|
|
599
599
|
if (m == null)
|
|
600
600
|
return m;
|
|
601
|
-
if (
|
|
601
|
+
if (d) {
|
|
602
602
|
var O = r.children;
|
|
603
603
|
if (O !== void 0)
|
|
604
604
|
if (u)
|
|
@@ -641,12 +641,12 @@ const z = Ye({
|
|
|
641
641
|
function Er() {
|
|
642
642
|
const t = I({
|
|
643
643
|
__root__: { value: "__root__", parent: "", children: {}, index: 0, childrenLength: 0, isGroup: !0, ref: { current: null } }
|
|
644
|
-
}), o = I({}), i = ne((a,
|
|
645
|
-
if (!t.current[
|
|
646
|
-
o.current[
|
|
644
|
+
}), o = I({}), i = ne((a, s, v, f, l) => {
|
|
645
|
+
if (!t.current[s]) {
|
|
646
|
+
o.current[s] ? o.current[s].push([a, s, v, f, l]) : o.current[s] = [[a, s, v, f, l]];
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
|
-
if (t.current[a] = { value: a, parent:
|
|
649
|
+
if (t.current[a] = { value: a, parent: s, children: {}, childrenLength: 0, index: v, isGroup: f, ref: l }, t.current[s].children[v] = a, (v + 1 > t.current[s].childrenLength || t.current[t.current[s].childrenLength - 1] == null) && (t.current[s].childrenLength = v + 1), o.current[a]) {
|
|
650
650
|
for (const _ of o.current[a])
|
|
651
651
|
i(..._);
|
|
652
652
|
delete o.current[a];
|
|
@@ -660,15 +660,17 @@ const U = Ye({
|
|
|
660
660
|
depth: -1
|
|
661
661
|
});
|
|
662
662
|
function mr(t, o, i) {
|
|
663
|
-
const [a,
|
|
664
|
-
return [t !== void 0 ? t : a, (
|
|
665
|
-
|
|
663
|
+
const [a, s] = Ue(i);
|
|
664
|
+
return [t !== void 0 ? t : a, (l) => {
|
|
665
|
+
s(l), o && o(a);
|
|
666
666
|
}];
|
|
667
667
|
}
|
|
668
668
|
function J(t, o) {
|
|
669
669
|
return function(a) {
|
|
670
|
-
|
|
671
|
-
|
|
670
|
+
const s = a.defaultPrevented;
|
|
671
|
+
s && (a.defaultPrevented = !1), t == null || t(a);
|
|
672
|
+
let v;
|
|
673
|
+
return a.defaultPrevented || (v = o == null ? void 0 : o(a), s && (a.defaultPrevented = !0)), v;
|
|
672
674
|
};
|
|
673
675
|
}
|
|
674
676
|
function ve(...t) {
|
|
@@ -693,23 +695,23 @@ function Tr(t, o) {
|
|
|
693
695
|
i != "__root__" && ((a = t[i].ref.current) == null || a.focus());
|
|
694
696
|
}
|
|
695
697
|
function xr(t, o) {
|
|
696
|
-
var
|
|
698
|
+
var s, v;
|
|
697
699
|
const i = t[o].parent, a = t[o].index;
|
|
698
700
|
if (a != 0) {
|
|
699
|
-
let
|
|
700
|
-
for (; t[
|
|
701
|
-
|
|
702
|
-
(
|
|
701
|
+
let f = t[i].children[a - 1], l;
|
|
702
|
+
for (; t[f].isGroup && (l = t[f].children[t[f].childrenLength - 1], !(l == null || t[l].ref.current == null)); )
|
|
703
|
+
f = l;
|
|
704
|
+
(s = t[f].ref.current) == null || s.focus();
|
|
703
705
|
return;
|
|
704
706
|
}
|
|
705
|
-
i != "__root__" && ((
|
|
707
|
+
i != "__root__" && ((v = t[i].ref.current) == null || v.focus());
|
|
706
708
|
}
|
|
707
709
|
function Cr(t, o) {
|
|
708
|
-
var
|
|
710
|
+
var s, v;
|
|
709
711
|
if (t[o].isGroup) {
|
|
710
|
-
const
|
|
711
|
-
if (
|
|
712
|
-
|
|
712
|
+
const f = (s = t[t[o].children[0]]) == null ? void 0 : s.ref.current;
|
|
713
|
+
if (f) {
|
|
714
|
+
f.focus();
|
|
713
715
|
return;
|
|
714
716
|
}
|
|
715
717
|
}
|
|
@@ -719,7 +721,7 @@ function Cr(t, o) {
|
|
|
719
721
|
return;
|
|
720
722
|
o = i;
|
|
721
723
|
}
|
|
722
|
-
(
|
|
724
|
+
(v = t[a].ref.current) == null || v.focus();
|
|
723
725
|
}
|
|
724
726
|
function Sr(t) {
|
|
725
727
|
var i;
|
|
@@ -733,62 +735,62 @@ function Pr(t) {
|
|
|
733
735
|
o = i;
|
|
734
736
|
(a = t[o].ref.current) == null || a.focus();
|
|
735
737
|
}
|
|
736
|
-
const Or = M(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...
|
|
737
|
-
const [
|
|
738
|
-
if (!(!yr.includes(h.key) || !
|
|
738
|
+
const Or = M(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...s }, v) => {
|
|
739
|
+
const [f, l] = Er(), _ = Ge(), [y, b] = mr(t, o, i ?? /* @__PURE__ */ new Set()), [w, T] = Ue(null), S = I(null), A = ve(S, v), E = I(""), L = ne((h) => {
|
|
740
|
+
if (!(!yr.includes(h.key) || !f.current))
|
|
739
741
|
switch (h.key) {
|
|
740
742
|
case "ArrowRight":
|
|
741
|
-
if (!
|
|
743
|
+
if (!f.current[E.current].isGroup)
|
|
742
744
|
break;
|
|
743
|
-
h.preventDefault(), y.has(E.current) ? wr(
|
|
745
|
+
h.preventDefault(), y.has(E.current) ? wr(f.current, E.current) : b((x) => /* @__PURE__ */ new Set([...x, E.current]));
|
|
744
746
|
break;
|
|
745
747
|
case "ArrowLeft":
|
|
746
|
-
h.preventDefault(), y.has(E.current) ? b((x) => new Set([...x].filter((k) => k !== E.current))) : Tr(
|
|
748
|
+
h.preventDefault(), y.has(E.current) ? b((x) => new Set([...x].filter((k) => k !== E.current))) : Tr(f.current, E.current);
|
|
747
749
|
break;
|
|
748
750
|
case "ArrowUp":
|
|
749
|
-
h.preventDefault(), xr(
|
|
751
|
+
h.preventDefault(), xr(f.current, E.current);
|
|
750
752
|
break;
|
|
751
753
|
case "ArrowDown":
|
|
752
|
-
h.preventDefault(), Cr(
|
|
754
|
+
h.preventDefault(), Cr(f.current, E.current);
|
|
753
755
|
break;
|
|
754
756
|
case "Home":
|
|
755
|
-
h.preventDefault(), Sr(
|
|
757
|
+
h.preventDefault(), Sr(f.current);
|
|
756
758
|
break;
|
|
757
759
|
case "End":
|
|
758
|
-
h.preventDefault(), Pr(
|
|
760
|
+
h.preventDefault(), Pr(f.current);
|
|
759
761
|
break;
|
|
760
762
|
case "Enter":
|
|
761
763
|
h.preventDefault(), T(E.current), y.has(E.current) ? b((x) => new Set([...x].filter((k) => k !== E.current))) : b((x) => /* @__PURE__ */ new Set([...x, E.current]));
|
|
762
764
|
break;
|
|
763
765
|
}
|
|
764
766
|
}, [y]), P = J(a, L);
|
|
765
|
-
return /* @__PURE__ */ F.jsx(z.Provider, { value: { rootValue: y, setRootValue: b, selection: w, setSelection: T, focus: E, nodeMap:
|
|
767
|
+
return /* @__PURE__ */ F.jsx(z.Provider, { value: { rootValue: y, setRootValue: b, selection: w, setSelection: T, focus: E, nodeMap: f, pushToNodeMap: l }, children: /* @__PURE__ */ F.jsx(U.Provider, { value: { parent: "__root__", getIndex: _, depth: 0 }, children: /* @__PURE__ */ F.jsx(
|
|
766
768
|
"ul",
|
|
767
769
|
{
|
|
768
770
|
ref: A,
|
|
769
771
|
role: "tree",
|
|
770
772
|
"aria-multiselectable": "false",
|
|
771
773
|
onKeyDown: P,
|
|
772
|
-
...
|
|
774
|
+
...s
|
|
773
775
|
}
|
|
774
776
|
) }) });
|
|
775
|
-
}), kr = M(({ value: t, onFocus: o, onClick: i, ...a },
|
|
776
|
-
const { selection:
|
|
777
|
+
}), kr = M(({ value: t, onFocus: o, onClick: i, ...a }, s) => {
|
|
778
|
+
const { selection: v, setSelection: f, focus: l, nodeMap: _, pushToNodeMap: y } = V(z), { parent: b, getIndex: w, depth: T } = V(U), S = I(null), A = ve(S, s), E = J(o, P), L = J(i, h);
|
|
777
779
|
function P(k) {
|
|
778
780
|
var N, H, X;
|
|
779
|
-
(H = (N = _.current) == null ? void 0 : N[
|
|
781
|
+
(H = (N = _.current) == null ? void 0 : N[l.current].ref.current) == null || H.setAttribute("tabindex", "-1"), (X = S.current) == null || X.setAttribute("tabindex", "0"), l.current = t, k.preventDefault();
|
|
780
782
|
}
|
|
781
783
|
function h() {
|
|
782
|
-
|
|
784
|
+
f(t);
|
|
783
785
|
}
|
|
784
786
|
const x = w(t);
|
|
785
|
-
return y(t, b, x, !1, S),
|
|
787
|
+
return y(t, b, x, !1, S), l.current == "" && b == "__root__" && x == 0 && (l.current = t), /* @__PURE__ */ F.jsx(
|
|
786
788
|
"li",
|
|
787
789
|
{
|
|
788
790
|
ref: A,
|
|
789
791
|
role: "treenode",
|
|
790
|
-
"aria-selected":
|
|
791
|
-
tabIndex:
|
|
792
|
+
"aria-selected": v == t,
|
|
793
|
+
tabIndex: l.current == t ? 0 : -1,
|
|
792
794
|
onFocus: E,
|
|
793
795
|
onClick: L,
|
|
794
796
|
"data-depth": T,
|
|
@@ -796,36 +798,36 @@ const Or = M(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...d
|
|
|
796
798
|
}
|
|
797
799
|
);
|
|
798
800
|
}), jr = M(({ value: t, onFocus: o, ...i }, a) => {
|
|
799
|
-
const
|
|
801
|
+
const s = Ge(), { rootValue: v, selection: f, focus: l, nodeMap: _, pushToNodeMap: y } = V(z), { parent: b, getIndex: w, depth: T } = V(U), S = I(null), A = ve(S, a), E = J(o, L);
|
|
800
802
|
function L(h) {
|
|
801
803
|
var x, k, N;
|
|
802
|
-
(k = (x = _.current) == null ? void 0 : x[
|
|
804
|
+
(k = (x = _.current) == null ? void 0 : x[l.current].ref.current) == null || k.setAttribute("tabindex", "-1"), (N = S.current) == null || N.setAttribute("tabindex", "0"), l.current = t, h.preventDefault();
|
|
803
805
|
}
|
|
804
806
|
const P = w(t);
|
|
805
|
-
return y(t, b, P, !0, S),
|
|
807
|
+
return y(t, b, P, !0, S), l.current == "" && b == "__root__" && P == 0 && (l.current = t), /* @__PURE__ */ F.jsx(U.Provider, { value: { parent: t, getIndex: s, depth: T + 1 }, children: /* @__PURE__ */ F.jsx(
|
|
806
808
|
"li",
|
|
807
809
|
{
|
|
808
810
|
ref: A,
|
|
809
811
|
role: "treenode",
|
|
810
|
-
"aria-expanded":
|
|
811
|
-
"data-state":
|
|
812
|
+
"aria-expanded": v.has(t),
|
|
813
|
+
"data-state": v.has(t) ? "open" : "closed",
|
|
812
814
|
"data-depth": T,
|
|
813
|
-
"aria-selected":
|
|
814
|
-
tabIndex:
|
|
815
|
+
"aria-selected": f == t,
|
|
816
|
+
tabIndex: l.current == t ? 0 : -1,
|
|
815
817
|
onFocus: E,
|
|
816
818
|
...i
|
|
817
819
|
}
|
|
818
820
|
) });
|
|
819
821
|
}), Dr = M(({ onClick: t, ...o }, i) => {
|
|
820
|
-
const { setRootValue: a, setSelection:
|
|
821
|
-
function
|
|
822
|
-
|
|
822
|
+
const { setRootValue: a, setSelection: s } = V(z), { parent: v } = V(U), f = J(t, l);
|
|
823
|
+
function l() {
|
|
824
|
+
s(v), a((_) => _.has(v) ? new Set([..._].filter((y) => y !== v)) : /* @__PURE__ */ new Set([..._, v]));
|
|
823
825
|
}
|
|
824
826
|
return /* @__PURE__ */ F.jsx(
|
|
825
827
|
"div",
|
|
826
828
|
{
|
|
827
829
|
ref: i,
|
|
828
|
-
onClick:
|
|
830
|
+
onClick: f,
|
|
829
831
|
...o
|
|
830
832
|
}
|
|
831
833
|
);
|