react-composable-treeview 1.0.10 → 1.0.12
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/README.md +16 -10
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +76 -76
- 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, f = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
|
|
18
|
-
function
|
|
17
|
+
var t = We, o = Symbol.for("react.element"), i = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, f = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function d(c, h, y) {
|
|
19
19
|
var b, w = {}, T = null, S = null;
|
|
20
20
|
y !== void 0 && (T = "" + y), h.key !== void 0 && (T = "" + h.key), h.ref !== void 0 && (S = h.ref);
|
|
21
21
|
for (b in h)
|
|
22
|
-
a.call(h, b) && !
|
|
22
|
+
a.call(h, b) && !l.hasOwnProperty(b) && (w[b] = h[b]);
|
|
23
23
|
if (c && c.defaultProps)
|
|
24
24
|
for (b in h = c.defaultProps, h)
|
|
25
25
|
w[b] === void 0 && (w[b] = h[b]);
|
|
26
26
|
return { $$typeof: o, type: c, key: T, ref: S, props: w, _owner: f.current };
|
|
27
27
|
}
|
|
28
|
-
return q.Fragment = i, q.jsx =
|
|
28
|
+
return q.Fragment = i, q.jsx = d, q.jsxs = d, 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"), f = Symbol.for("react.strict_mode"),
|
|
43
|
+
var t = We, o = Symbol.for("react.element"), i = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), c = Symbol.for("react.context"), h = 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;
|
|
@@ -59,8 +59,8 @@ function Rr() {
|
|
|
59
59
|
{
|
|
60
60
|
var u = P.ReactDebugCurrentFrame, p = u.getStackAddendum();
|
|
61
61
|
p !== "" && (r += "%s", n = n.concat([p]));
|
|
62
|
-
var g = n.map(function(
|
|
63
|
-
return String(
|
|
62
|
+
var g = n.map(function(v) {
|
|
63
|
+
return String(v);
|
|
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 === l || Be || e === f || e === y || e === b || X || e === S || k || N || H || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === w || e.$$typeof === d || e.$$typeof === c || e.$$typeof === h || // 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.
|
|
@@ -96,7 +96,7 @@ function Rr() {
|
|
|
96
96
|
return "Fragment";
|
|
97
97
|
case i:
|
|
98
98
|
return "Portal";
|
|
99
|
-
case
|
|
99
|
+
case l:
|
|
100
100
|
return "Profiler";
|
|
101
101
|
case f:
|
|
102
102
|
return "StrictMode";
|
|
@@ -110,7 +110,7 @@ function Rr() {
|
|
|
110
110
|
case c:
|
|
111
111
|
var r = e;
|
|
112
112
|
return he(r) + ".Consumer";
|
|
113
|
-
case
|
|
113
|
+
case d:
|
|
114
114
|
var n = e;
|
|
115
115
|
return he(n._context) + ".Provider";
|
|
116
116
|
case h:
|
|
@@ -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 p = e, g = p._payload,
|
|
122
|
+
var p = e, g = p._payload, v = p._init;
|
|
123
123
|
try {
|
|
124
|
-
return j(
|
|
124
|
+
return j(v(g));
|
|
125
125
|
} catch {
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
@@ -226,27 +226,27 @@ function Rr() {
|
|
|
226
226
|
g = oe.current, oe.current = null, Je();
|
|
227
227
|
try {
|
|
228
228
|
if (r) {
|
|
229
|
-
var
|
|
229
|
+
var v = function() {
|
|
230
230
|
throw Error();
|
|
231
231
|
};
|
|
232
|
-
if (Object.defineProperty(
|
|
232
|
+
if (Object.defineProperty(v.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(v, []);
|
|
239
239
|
} catch (D) {
|
|
240
240
|
u = D;
|
|
241
241
|
}
|
|
242
|
-
Reflect.construct(e, [],
|
|
242
|
+
Reflect.construct(e, [], v);
|
|
243
243
|
} else {
|
|
244
244
|
try {
|
|
245
|
-
|
|
245
|
+
v.call();
|
|
246
246
|
} catch (D) {
|
|
247
247
|
u = D;
|
|
248
248
|
}
|
|
249
|
-
e.call(
|
|
249
|
+
e.call(v.prototype);
|
|
250
250
|
}
|
|
251
251
|
} else {
|
|
252
252
|
try {
|
|
@@ -328,19 +328,19 @@ function Rr() {
|
|
|
328
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 v in e)
|
|
332
|
+
if (g(e, v)) {
|
|
333
333
|
var s = void 0;
|
|
334
334
|
try {
|
|
335
|
-
if (typeof e[
|
|
336
|
-
var C = Error((u || "React class") + ": " + n + " type `" +
|
|
335
|
+
if (typeof e[v] != "function") {
|
|
336
|
+
var C = Error((u || "React class") + ": " + n + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[v] + "`.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
|
-
s = e[
|
|
339
|
+
s = e[v](r, v, u, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
340
|
} catch (R) {
|
|
341
341
|
s = R;
|
|
342
342
|
}
|
|
343
|
-
s && !(s instanceof Error) && (te(p), _("%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,
|
|
343
|
+
s && !(s instanceof Error) && (te(p), _("%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, v, typeof s), te(null)), s instanceof Error && !(s.message in xe) && (xe[s.message] = !0, te(p), _("Failed %s type: %s", n, s.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, p, g,
|
|
422
|
+
var cr = function(e, r, n, u, p, g, v) {
|
|
423
423
|
var s = {
|
|
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: v,
|
|
431
431
|
// Record the component responsible for creating this element.
|
|
432
432
|
_owner: g
|
|
433
433
|
};
|
|
@@ -450,20 +450,20 @@ function Rr() {
|
|
|
450
450
|
};
|
|
451
451
|
function sr(e, r, n, u, p) {
|
|
452
452
|
{
|
|
453
|
-
var g,
|
|
453
|
+
var g, v = {}, s = null, C = null;
|
|
454
454
|
n !== void 0 && (Pe(n), s = "" + n), or(r) && (Pe(r.key), s = "" + 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) && (v[g] = r[g]);
|
|
457
457
|
if (e && e.defaultProps) {
|
|
458
458
|
var R = e.defaultProps;
|
|
459
459
|
for (g in R)
|
|
460
|
-
|
|
460
|
+
v[g] === void 0 && (v[g] = R[g]);
|
|
461
461
|
}
|
|
462
462
|
if (s || C) {
|
|
463
463
|
var m = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
464
|
-
s && ir(
|
|
464
|
+
s && ir(v, m), C && ur(v, m);
|
|
465
465
|
}
|
|
466
|
-
return cr(e, s, C, p, u, B.current,
|
|
466
|
+
return cr(e, s, C, p, u, B.current, v);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
var se = P.ReactCurrentOwner, je = P.ReactDebugCurrentFrame;
|
|
@@ -542,8 +542,8 @@ Check the top-level render call using <` + n + ">.");
|
|
|
542
542
|
else if (e) {
|
|
543
543
|
var p = L(e);
|
|
544
544
|
if (typeof p == "function" && p !== e.entries)
|
|
545
|
-
for (var g = p.call(e),
|
|
546
|
-
le(
|
|
545
|
+
for (var g = p.call(e), v; !(v = g.next()).done; )
|
|
546
|
+
le(v.value) && Fe(v.value, r);
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
}
|
|
@@ -586,8 +586,8 @@ Check the top-level render call using <` + n + ">.");
|
|
|
586
586
|
}
|
|
587
587
|
function Ve(e, r, n, u, p, g) {
|
|
588
588
|
{
|
|
589
|
-
var
|
|
590
|
-
if (!
|
|
589
|
+
var v = qe(e);
|
|
590
|
+
if (!v) {
|
|
591
591
|
var s = "";
|
|
592
592
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (s += " 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
593
|
var C = fr(p);
|
|
@@ -598,7 +598,7 @@ Check the top-level render call using <` + n + ">.");
|
|
|
598
598
|
var m = sr(e, r, n, p, g);
|
|
599
599
|
if (m == null)
|
|
600
600
|
return m;
|
|
601
|
-
if (
|
|
601
|
+
if (v) {
|
|
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, f,
|
|
644
|
+
}), o = I({}), i = ne((a, f, l, d, c) => {
|
|
645
645
|
if (!t.current[f]) {
|
|
646
|
-
o.current[f] ? o.current[f].push([a, f,
|
|
646
|
+
o.current[f] ? o.current[f].push([a, f, l, d, c]) : o.current[f] = [[a, f, l, d, c]];
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
|
-
if (t.current[a] = { value: a, parent: f, children: {}, childrenLength: 0, index:
|
|
649
|
+
if (t.current[a] = { value: a, parent: f, children: {}, childrenLength: 0, index: l, isGroup: d, ref: c }, t.current[f].children[l] = a, (l + 1 > t.current[f].childrenLength || t.current[t.current[f].childrenLength - 1] == null) && (t.current[f].childrenLength = l + 1), o.current[a]) {
|
|
650
650
|
for (const h of o.current[a])
|
|
651
651
|
i(...h);
|
|
652
652
|
delete o.current[a];
|
|
@@ -660,9 +660,9 @@ const U = Ye({
|
|
|
660
660
|
depth: -1
|
|
661
661
|
});
|
|
662
662
|
function mr(t, o, i) {
|
|
663
|
-
const [a, f] = Ue(i);
|
|
664
|
-
return [
|
|
665
|
-
const h = typeof c == "function" ? c(
|
|
663
|
+
const [a, f] = Ue(i), l = t !== void 0 ? t : a;
|
|
664
|
+
return [l, (c) => {
|
|
665
|
+
const h = typeof c == "function" ? c(l) : c;
|
|
666
666
|
o && o(h), f(h);
|
|
667
667
|
}];
|
|
668
668
|
}
|
|
@@ -670,8 +670,8 @@ function J(t, o) {
|
|
|
670
670
|
return function(a) {
|
|
671
671
|
const f = a.defaultPrevented;
|
|
672
672
|
f && (a.defaultPrevented = !1), t == null || t(a);
|
|
673
|
-
let
|
|
674
|
-
return a.defaultPrevented || (
|
|
673
|
+
let l;
|
|
674
|
+
return a.defaultPrevented || (l = o == null ? void 0 : o(a), f && (a.defaultPrevented = !0)), l;
|
|
675
675
|
};
|
|
676
676
|
}
|
|
677
677
|
function ve(...t) {
|
|
@@ -696,23 +696,23 @@ function Tr(t, o) {
|
|
|
696
696
|
i != "__root__" && ((a = t[i].ref.current) == null || a.focus());
|
|
697
697
|
}
|
|
698
698
|
function xr(t, o) {
|
|
699
|
-
var f,
|
|
699
|
+
var f, l;
|
|
700
700
|
const i = t[o].parent, a = t[o].index;
|
|
701
701
|
if (a != 0) {
|
|
702
|
-
let
|
|
703
|
-
for (; t[
|
|
704
|
-
|
|
705
|
-
(f = t[
|
|
702
|
+
let d = t[i].children[a - 1], c;
|
|
703
|
+
for (; t[d].isGroup && (c = t[d].children[t[d].childrenLength - 1], !(c == null || t[c].ref.current == null)); )
|
|
704
|
+
d = c;
|
|
705
|
+
(f = t[d].ref.current) == null || f.focus();
|
|
706
706
|
return;
|
|
707
707
|
}
|
|
708
|
-
i != "__root__" && ((
|
|
708
|
+
i != "__root__" && ((l = t[i].ref.current) == null || l.focus());
|
|
709
709
|
}
|
|
710
710
|
function Cr(t, o) {
|
|
711
|
-
var f,
|
|
711
|
+
var f, l;
|
|
712
712
|
if (t[o].isGroup) {
|
|
713
|
-
const
|
|
714
|
-
if (
|
|
715
|
-
|
|
713
|
+
const d = (f = t[t[o].children[0]]) == null ? void 0 : f.ref.current;
|
|
714
|
+
if (d) {
|
|
715
|
+
d.focus();
|
|
716
716
|
return;
|
|
717
717
|
}
|
|
718
718
|
}
|
|
@@ -722,7 +722,7 @@ function Cr(t, o) {
|
|
|
722
722
|
return;
|
|
723
723
|
o = i;
|
|
724
724
|
}
|
|
725
|
-
(
|
|
725
|
+
(l = t[a].ref.current) == null || l.focus();
|
|
726
726
|
}
|
|
727
727
|
function Sr(t) {
|
|
728
728
|
var i;
|
|
@@ -736,36 +736,36 @@ function Pr(t) {
|
|
|
736
736
|
o = i;
|
|
737
737
|
(a = t[o].ref.current) == null || a.focus();
|
|
738
738
|
}
|
|
739
|
-
const Or = M(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...f },
|
|
740
|
-
const [
|
|
741
|
-
if (!(!yr.includes(_.key) || !
|
|
739
|
+
const Or = M(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...f }, l) => {
|
|
740
|
+
const [d, c] = Er(), h = Ge(), [y, b] = mr(t, o, i ?? /* @__PURE__ */ new Set()), [w, T] = Ue(null), S = I(null), A = ve(S, l), E = I(""), L = ne((_) => {
|
|
741
|
+
if (!(!yr.includes(_.key) || !d.current))
|
|
742
742
|
switch (_.key) {
|
|
743
743
|
case "ArrowRight":
|
|
744
|
-
if (!
|
|
744
|
+
if (!d.current[E.current].isGroup)
|
|
745
745
|
break;
|
|
746
|
-
_.preventDefault(), y.has(E.current) ? wr(
|
|
746
|
+
_.preventDefault(), y.has(E.current) ? wr(d.current, E.current) : b((x) => /* @__PURE__ */ new Set([...x, E.current]));
|
|
747
747
|
break;
|
|
748
748
|
case "ArrowLeft":
|
|
749
|
-
_.preventDefault(), y.has(E.current) ? b((x) => new Set([...x].filter((k) => k !== E.current))) : Tr(
|
|
749
|
+
_.preventDefault(), y.has(E.current) ? b((x) => new Set([...x].filter((k) => k !== E.current))) : Tr(d.current, E.current);
|
|
750
750
|
break;
|
|
751
751
|
case "ArrowUp":
|
|
752
|
-
_.preventDefault(), xr(
|
|
752
|
+
_.preventDefault(), xr(d.current, E.current);
|
|
753
753
|
break;
|
|
754
754
|
case "ArrowDown":
|
|
755
|
-
_.preventDefault(), Cr(
|
|
755
|
+
_.preventDefault(), Cr(d.current, E.current);
|
|
756
756
|
break;
|
|
757
757
|
case "Home":
|
|
758
|
-
_.preventDefault(), Sr(
|
|
758
|
+
_.preventDefault(), Sr(d.current);
|
|
759
759
|
break;
|
|
760
760
|
case "End":
|
|
761
|
-
_.preventDefault(), Pr(
|
|
761
|
+
_.preventDefault(), Pr(d.current);
|
|
762
762
|
break;
|
|
763
763
|
case "Enter":
|
|
764
764
|
_.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]));
|
|
765
765
|
break;
|
|
766
766
|
}
|
|
767
767
|
}, [y]), P = J(a, L);
|
|
768
|
-
return /* @__PURE__ */ F.jsx(z.Provider, { value: { rootValue: y, setRootValue: b, selection: w, setSelection: T, focus: E, nodeMap:
|
|
768
|
+
return /* @__PURE__ */ F.jsx(z.Provider, { value: { rootValue: y, setRootValue: b, selection: w, setSelection: T, focus: E, nodeMap: d, pushToNodeMap: c }, children: /* @__PURE__ */ F.jsx(U.Provider, { value: { parent: "__root__", getIndex: h, depth: 0 }, children: /* @__PURE__ */ F.jsx(
|
|
769
769
|
"ul",
|
|
770
770
|
{
|
|
771
771
|
ref: A,
|
|
@@ -776,13 +776,13 @@ const Or = M(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...f
|
|
|
776
776
|
}
|
|
777
777
|
) }) });
|
|
778
778
|
}), kr = M(({ value: t, onFocus: o, onClick: i, ...a }, f) => {
|
|
779
|
-
const { selection:
|
|
779
|
+
const { selection: l, setSelection: d, focus: c, nodeMap: h, pushToNodeMap: y } = V(z), { parent: b, getIndex: w, depth: T } = V(U), S = I(null), A = ve(S, f), E = J(o, P), L = J(i, _);
|
|
780
780
|
function P(k) {
|
|
781
781
|
var N, H, X;
|
|
782
782
|
(H = (N = h.current) == null ? void 0 : N[c.current].ref.current) == null || H.setAttribute("tabindex", "-1"), (X = S.current) == null || X.setAttribute("tabindex", "0"), c.current = t, k.stopPropagation();
|
|
783
783
|
}
|
|
784
784
|
function _() {
|
|
785
|
-
|
|
785
|
+
d(t);
|
|
786
786
|
}
|
|
787
787
|
const x = w(t);
|
|
788
788
|
return y(t, b, x, !1, S), c.current == "" && b == "__root__" && x == 0 && (c.current = t), /* @__PURE__ */ F.jsx(
|
|
@@ -790,7 +790,7 @@ const Or = M(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...f
|
|
|
790
790
|
{
|
|
791
791
|
ref: A,
|
|
792
792
|
role: "treenode",
|
|
793
|
-
"aria-selected":
|
|
793
|
+
"aria-selected": l == t,
|
|
794
794
|
tabIndex: c.current == t ? 0 : -1,
|
|
795
795
|
onFocus: E,
|
|
796
796
|
onClick: L,
|
|
@@ -799,7 +799,7 @@ const Or = M(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...f
|
|
|
799
799
|
}
|
|
800
800
|
);
|
|
801
801
|
}), jr = M(({ value: t, onFocus: o, ...i }, a) => {
|
|
802
|
-
const f = Ge(), { rootValue:
|
|
802
|
+
const f = Ge(), { rootValue: l, selection: d, focus: c, nodeMap: h, pushToNodeMap: y } = V(z), { parent: b, getIndex: w, depth: T } = V(U), S = I(null), A = ve(S, a), E = J(o, L);
|
|
803
803
|
function L(_) {
|
|
804
804
|
var x, k, N;
|
|
805
805
|
(k = (x = h.current) == null ? void 0 : x[c.current].ref.current) == null || k.setAttribute("tabindex", "-1"), (N = S.current) == null || N.setAttribute("tabindex", "0"), c.current = t, _.stopPropagation();
|
|
@@ -810,25 +810,25 @@ const Or = M(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...f
|
|
|
810
810
|
{
|
|
811
811
|
ref: A,
|
|
812
812
|
role: "treenode",
|
|
813
|
-
"
|
|
814
|
-
"data-state": v.has(t) ? "open" : "closed",
|
|
813
|
+
"data-state": l.has(t) ? "open" : "closed",
|
|
815
814
|
"data-depth": T,
|
|
816
|
-
"aria-
|
|
815
|
+
"aria-expanded": l.has(t),
|
|
816
|
+
"aria-selected": d == t,
|
|
817
817
|
tabIndex: c.current == t ? 0 : -1,
|
|
818
818
|
onFocus: E,
|
|
819
819
|
...i
|
|
820
820
|
}
|
|
821
821
|
) });
|
|
822
822
|
}), Dr = M(({ onClick: t, ...o }, i) => {
|
|
823
|
-
const { setRootValue: a, setSelection: f } = V(z), { parent:
|
|
823
|
+
const { setRootValue: a, setSelection: f } = V(z), { parent: l } = V(U), d = J(t, c);
|
|
824
824
|
function c() {
|
|
825
|
-
f(
|
|
825
|
+
f(l), a((h) => h.has(l) ? new Set([...h].filter((y) => y !== l)) : /* @__PURE__ */ new Set([...h, l]));
|
|
826
826
|
}
|
|
827
827
|
return /* @__PURE__ */ F.jsx(
|
|
828
828
|
"div",
|
|
829
829
|
{
|
|
830
830
|
ref: i,
|
|
831
|
-
onClick:
|
|
831
|
+
onClick: d,
|
|
832
832
|
...o
|
|
833
833
|
}
|
|
834
834
|
);
|