react-composable-treeview 1.0.4 → 1.0.5
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 +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +94 -94
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15,14 +15,14 @@ function br() {
|
|
|
15
15
|
return B;
|
|
16
16
|
Ve = 1;
|
|
17
17
|
var t = Ne, o = Symbol.for("react.element"), i = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, d = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, f = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
-
function s(p,
|
|
19
|
-
var
|
|
20
|
-
y !== void 0 && (T = "" + y),
|
|
21
|
-
for (
|
|
22
|
-
a.call(
|
|
18
|
+
function s(p, _, y) {
|
|
19
|
+
var b, w = {}, T = null, P = null;
|
|
20
|
+
y !== void 0 && (T = "" + y), _.key !== void 0 && (T = "" + _.key), _.ref !== void 0 && (P = _.ref);
|
|
21
|
+
for (b in _)
|
|
22
|
+
a.call(_, b) && !f.hasOwnProperty(b) && (w[b] = _[b]);
|
|
23
23
|
if (p && p.defaultProps)
|
|
24
|
-
for (
|
|
25
|
-
w[
|
|
24
|
+
for (b in _ = p.defaultProps, _)
|
|
25
|
+
w[b] === void 0 && (w[b] = _[b]);
|
|
26
26
|
return { $$typeof: o, type: p, key: T, ref: P, props: w, _owner: d.current };
|
|
27
27
|
}
|
|
28
28
|
return B.Fragment = i, B.jsx = s, B.jsxs = s, B;
|
|
@@ -40,15 +40,15 @@ var q = {};
|
|
|
40
40
|
var Le;
|
|
41
41
|
function Rr() {
|
|
42
42
|
return Le || (Le = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var t = Ne, o = Symbol.for("react.element"), i = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), d = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), p = Symbol.for("react.context"),
|
|
43
|
+
var t = Ne, o = Symbol.for("react.element"), i = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), d = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), p = 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"), P = Symbol.for("react.offscreen"), D = Symbol.iterator, R = "@@iterator";
|
|
44
44
|
function L(e) {
|
|
45
45
|
if (e === null || typeof e != "object")
|
|
46
46
|
return null;
|
|
47
|
-
var r =
|
|
47
|
+
var r = D && e[D] || e[R];
|
|
48
48
|
return typeof r == "function" ? r : null;
|
|
49
49
|
}
|
|
50
50
|
var C = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
-
function
|
|
51
|
+
function h(e) {
|
|
52
52
|
{
|
|
53
53
|
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), u = 1; u < r; u++)
|
|
54
54
|
n[u - 1] = arguments[u];
|
|
@@ -59,16 +59,16 @@ function Rr() {
|
|
|
59
59
|
{
|
|
60
60
|
var u = C.ReactDebugCurrentFrame, v = u.getStackAddendum();
|
|
61
61
|
v !== "" && (r += "%s", n = n.concat([v]));
|
|
62
|
-
var
|
|
62
|
+
var g = n.map(function(l) {
|
|
63
63
|
return String(l);
|
|
64
64
|
});
|
|
65
|
-
|
|
65
|
+
g.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, g);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
var
|
|
68
|
+
var A = !1, M = !1, Ue = !1, Ge = !1, Be = !1, de;
|
|
69
69
|
de = Symbol.for("react.module.reference");
|
|
70
70
|
function qe(e) {
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e === a || e === f || Be || e === d || e === y || e ===
|
|
71
|
+
return !!(typeof e == "string" || typeof e == "function" || e === a || e === f || Be || e === d || e === y || e === b || Ge || e === P || A || M || Ue || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === w || e.$$typeof === s || e.$$typeof === p || 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.
|
|
@@ -87,7 +87,7 @@ function Rr() {
|
|
|
87
87
|
function k(e) {
|
|
88
88
|
if (e == null)
|
|
89
89
|
return null;
|
|
90
|
-
if (typeof e.tag == "number" &&
|
|
90
|
+
if (typeof e.tag == "number" && h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
91
91
|
return e.displayName || e.name || null;
|
|
92
92
|
if (typeof e == "string")
|
|
93
93
|
return e;
|
|
@@ -102,7 +102,7 @@ function Rr() {
|
|
|
102
102
|
return "StrictMode";
|
|
103
103
|
case y:
|
|
104
104
|
return "Suspense";
|
|
105
|
-
case
|
|
105
|
+
case b:
|
|
106
106
|
return "SuspenseList";
|
|
107
107
|
}
|
|
108
108
|
if (typeof e == "object")
|
|
@@ -113,15 +113,15 @@ function Rr() {
|
|
|
113
113
|
case s:
|
|
114
114
|
var n = e;
|
|
115
115
|
return ve(n._context) + ".Provider";
|
|
116
|
-
case
|
|
116
|
+
case _:
|
|
117
117
|
return Ke(e, e.render, "ForwardRef");
|
|
118
118
|
case w:
|
|
119
119
|
var u = e.displayName || null;
|
|
120
120
|
return u !== null ? u : k(e.type) || "Memo";
|
|
121
121
|
case T: {
|
|
122
|
-
var v = e,
|
|
122
|
+
var v = e, g = v._payload, l = v._init;
|
|
123
123
|
try {
|
|
124
|
-
return k(l(
|
|
124
|
+
return k(l(g));
|
|
125
125
|
} catch {
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
@@ -188,7 +188,7 @@ function Rr() {
|
|
|
188
188
|
})
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
U < 0 &&
|
|
191
|
+
U < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
var te = C.ReactCurrentDispatcher, ne;
|
|
@@ -222,8 +222,8 @@ function Rr() {
|
|
|
222
222
|
oe = !0;
|
|
223
223
|
var v = Error.prepareStackTrace;
|
|
224
224
|
Error.prepareStackTrace = void 0;
|
|
225
|
-
var
|
|
226
|
-
|
|
225
|
+
var g;
|
|
226
|
+
g = te.current, te.current = null, Je();
|
|
227
227
|
try {
|
|
228
228
|
if (r) {
|
|
229
229
|
var l = function() {
|
|
@@ -276,7 +276,7 @@ function Rr() {
|
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
} finally {
|
|
279
|
-
oe = !1, te.current =
|
|
279
|
+
oe = !1, te.current = g, Me(), Error.prepareStackTrace = v;
|
|
280
280
|
}
|
|
281
281
|
var W = e ? e.displayName || e.name : "", Ie = W ? z(W) : "";
|
|
282
282
|
return typeof e == "function" && X.set(e, Ie), Ie;
|
|
@@ -298,19 +298,19 @@ function Rr() {
|
|
|
298
298
|
switch (e) {
|
|
299
299
|
case y:
|
|
300
300
|
return z("Suspense");
|
|
301
|
-
case
|
|
301
|
+
case b:
|
|
302
302
|
return z("SuspenseList");
|
|
303
303
|
}
|
|
304
304
|
if (typeof e == "object")
|
|
305
305
|
switch (e.$$typeof) {
|
|
306
|
-
case
|
|
306
|
+
case _:
|
|
307
307
|
return Xe(e.render);
|
|
308
308
|
case w:
|
|
309
309
|
return H(e.type, r, n);
|
|
310
310
|
case T: {
|
|
311
|
-
var u = e, v = u._payload,
|
|
311
|
+
var u = e, v = u._payload, g = u._init;
|
|
312
312
|
try {
|
|
313
|
-
return H(
|
|
313
|
+
return H(g(v), r, n);
|
|
314
314
|
} catch {
|
|
315
315
|
}
|
|
316
316
|
}
|
|
@@ -327,9 +327,9 @@ function Rr() {
|
|
|
327
327
|
}
|
|
328
328
|
function Ze(e, r, n, u, v) {
|
|
329
329
|
{
|
|
330
|
-
var
|
|
330
|
+
var g = Function.call.bind(Z);
|
|
331
331
|
for (var l in e)
|
|
332
|
-
if (
|
|
332
|
+
if (g(e, l)) {
|
|
333
333
|
var c = void 0;
|
|
334
334
|
try {
|
|
335
335
|
if (typeof e[l] != "function") {
|
|
@@ -340,7 +340,7 @@ function Rr() {
|
|
|
340
340
|
} catch (E) {
|
|
341
341
|
c = E;
|
|
342
342
|
}
|
|
343
|
-
c && !(c instanceof Error) && (Q(v),
|
|
343
|
+
c && !(c instanceof Error) && (Q(v), 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, l, typeof c), Q(null)), c instanceof Error && !(c.message in we) && (we[c.message] = !0, Q(v), h("Failed %s type: %s", n, c.message), Q(null));
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
}
|
|
@@ -366,7 +366,7 @@ function Rr() {
|
|
|
366
366
|
}
|
|
367
367
|
function Se(e) {
|
|
368
368
|
if (rr(e))
|
|
369
|
-
return
|
|
369
|
+
return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", er(e)), xe(e);
|
|
370
370
|
}
|
|
371
371
|
var G = C.ReactCurrentOwner, tr = {
|
|
372
372
|
key: !0,
|
|
@@ -394,13 +394,13 @@ function Rr() {
|
|
|
394
394
|
function ar(e, r) {
|
|
395
395
|
if (typeof e.ref == "string" && G.current && r && G.current.stateNode !== r) {
|
|
396
396
|
var n = k(G.current.type);
|
|
397
|
-
ie[n] || (
|
|
397
|
+
ie[n] || (h('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', k(G.current.type), e.ref), ie[n] = !0);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
function ir(e, r) {
|
|
401
401
|
{
|
|
402
402
|
var n = function() {
|
|
403
|
-
Ce || (Ce = !0,
|
|
403
|
+
Ce || (Ce = !0, h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
404
404
|
};
|
|
405
405
|
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
406
406
|
get: n,
|
|
@@ -411,7 +411,7 @@ function Rr() {
|
|
|
411
411
|
function ur(e, r) {
|
|
412
412
|
{
|
|
413
413
|
var n = function() {
|
|
414
|
-
Pe || (Pe = !0,
|
|
414
|
+
Pe || (Pe = !0, h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
415
415
|
};
|
|
416
416
|
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
417
417
|
get: n,
|
|
@@ -419,7 +419,7 @@ function Rr() {
|
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
var cr = function(e, r, n, u, v,
|
|
422
|
+
var cr = function(e, r, n, u, v, g, l) {
|
|
423
423
|
var c = {
|
|
424
424
|
// This tag allows us to uniquely identify this as a React Element
|
|
425
425
|
$$typeof: o,
|
|
@@ -429,7 +429,7 @@ function Rr() {
|
|
|
429
429
|
ref: n,
|
|
430
430
|
props: l,
|
|
431
431
|
// Record the component responsible for creating this element.
|
|
432
|
-
_owner:
|
|
432
|
+
_owner: g
|
|
433
433
|
};
|
|
434
434
|
return c._store = {}, Object.defineProperty(c._store, "validated", {
|
|
435
435
|
configurable: !1,
|
|
@@ -450,14 +450,14 @@ function Rr() {
|
|
|
450
450
|
};
|
|
451
451
|
function sr(e, r, n, u, v) {
|
|
452
452
|
{
|
|
453
|
-
var
|
|
453
|
+
var g, l = {}, c = null, S = null;
|
|
454
454
|
n !== void 0 && (Se(n), c = "" + n), or(r) && (Se(r.key), c = "" + r.key), nr(r) && (S = r.ref, ar(r, v));
|
|
455
|
-
for (
|
|
456
|
-
Z.call(r,
|
|
455
|
+
for (g in r)
|
|
456
|
+
Z.call(r, g) && !tr.hasOwnProperty(g) && (l[g] = r[g]);
|
|
457
457
|
if (e && e.defaultProps) {
|
|
458
458
|
var E = e.defaultProps;
|
|
459
|
-
for (
|
|
460
|
-
l[
|
|
459
|
+
for (g in E)
|
|
460
|
+
l[g] === void 0 && (l[g] = E[g]);
|
|
461
461
|
}
|
|
462
462
|
if (c || S) {
|
|
463
463
|
var m = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
@@ -515,7 +515,7 @@ Check the top-level render call using <` + n + ">.");
|
|
|
515
515
|
return r;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function De(e, r) {
|
|
519
519
|
{
|
|
520
520
|
if (!e._store || e._store.validated || e.key != null)
|
|
521
521
|
return;
|
|
@@ -525,25 +525,25 @@ Check the top-level render call using <` + n + ">.");
|
|
|
525
525
|
return;
|
|
526
526
|
je[n] = !0;
|
|
527
527
|
var u = "";
|
|
528
|
-
e && e._owner && e._owner !== ue.current && (u = " It was passed a child from " + k(e._owner.type) + "."), $(e),
|
|
528
|
+
e && e._owner && e._owner !== ue.current && (u = " It was passed a child from " + k(e._owner.type) + "."), $(e), h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, u), $(null);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function Ae(e, r) {
|
|
532
532
|
{
|
|
533
533
|
if (typeof e != "object")
|
|
534
534
|
return;
|
|
535
535
|
if (ae(e))
|
|
536
536
|
for (var n = 0; n < e.length; n++) {
|
|
537
537
|
var u = e[n];
|
|
538
|
-
se(u) &&
|
|
538
|
+
se(u) && De(u, r);
|
|
539
539
|
}
|
|
540
540
|
else if (se(e))
|
|
541
541
|
e._store && (e._store.validated = !0);
|
|
542
542
|
else if (e) {
|
|
543
543
|
var v = L(e);
|
|
544
544
|
if (typeof v == "function" && v !== e.entries)
|
|
545
|
-
for (var
|
|
546
|
-
se(l.value) &&
|
|
545
|
+
for (var g = v.call(e), l; !(l = g.next()).done; )
|
|
546
|
+
se(l.value) && De(l.value, r);
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
}
|
|
@@ -555,7 +555,7 @@ Check the top-level render call using <` + n + ">.");
|
|
|
555
555
|
var n;
|
|
556
556
|
if (typeof r == "function")
|
|
557
557
|
n = r.propTypes;
|
|
558
|
-
else if (typeof r == "object" && (r.$$typeof ===
|
|
558
|
+
else if (typeof r == "object" && (r.$$typeof === _ || // Note: Memo only checks outer props here.
|
|
559
559
|
// Inner props are checked in the reconciler.
|
|
560
560
|
r.$$typeof === w))
|
|
561
561
|
n = r.propTypes;
|
|
@@ -567,9 +567,9 @@ Check the top-level render call using <` + n + ">.");
|
|
|
567
567
|
} else if (r.PropTypes !== void 0 && !ce) {
|
|
568
568
|
ce = !0;
|
|
569
569
|
var v = k(r);
|
|
570
|
-
|
|
570
|
+
h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", v || "Unknown");
|
|
571
571
|
}
|
|
572
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
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
|
}
|
|
574
574
|
}
|
|
575
575
|
function vr(e) {
|
|
@@ -577,14 +577,14 @@ Check the top-level render call using <` + n + ">.");
|
|
|
577
577
|
for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
|
|
578
578
|
var u = r[n];
|
|
579
579
|
if (u !== "children" && u !== "key") {
|
|
580
|
-
$(e),
|
|
580
|
+
$(e), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", u), $(null);
|
|
581
581
|
break;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
e.ref !== null && ($(e),
|
|
584
|
+
e.ref !== null && ($(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), $(null));
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function Fe(e, r, n, u, v, g) {
|
|
588
588
|
{
|
|
589
589
|
var l = qe(e);
|
|
590
590
|
if (!l) {
|
|
@@ -593,9 +593,9 @@ Check the top-level render call using <` + n + ">.");
|
|
|
593
593
|
var S = fr(v);
|
|
594
594
|
S ? c += S : c += ke();
|
|
595
595
|
var E;
|
|
596
|
-
e === null ? E = "null" : ae(e) ? E = "array" : e !== void 0 && e.$$typeof === o ? (E = "<" + (k(e.type) || "Unknown") + " />", c = " Did you accidentally export a JSX literal instead of a component?") : E = typeof e,
|
|
596
|
+
e === null ? E = "null" : ae(e) ? E = "array" : e !== void 0 && e.$$typeof === o ? (E = "<" + (k(e.type) || "Unknown") + " />", c = " Did you accidentally export a JSX literal instead of a component?") : E = 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", E, c);
|
|
597
597
|
}
|
|
598
|
-
var m = sr(e, r, n, v,
|
|
598
|
+
var m = sr(e, r, n, v, g);
|
|
599
599
|
if (m == null)
|
|
600
600
|
return m;
|
|
601
601
|
if (l) {
|
|
@@ -604,28 +604,28 @@ Check the top-level render call using <` + n + ">.");
|
|
|
604
604
|
if (u)
|
|
605
605
|
if (ae(O)) {
|
|
606
606
|
for (var W = 0; W < O.length; W++)
|
|
607
|
-
|
|
607
|
+
Ae(O[W], e);
|
|
608
608
|
Object.freeze && Object.freeze(O);
|
|
609
609
|
} else
|
|
610
|
-
|
|
610
|
+
h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
611
611
|
else
|
|
612
|
-
|
|
612
|
+
Ae(O, e);
|
|
613
613
|
}
|
|
614
614
|
return e === a ? vr(m) : dr(m), m;
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
function pr(e, r, n) {
|
|
618
|
-
return
|
|
618
|
+
return Fe(e, r, n, !0);
|
|
619
619
|
}
|
|
620
620
|
function hr(e, r, n) {
|
|
621
|
-
return
|
|
621
|
+
return Fe(e, r, n, !1);
|
|
622
622
|
}
|
|
623
623
|
var _r = hr, gr = pr;
|
|
624
624
|
q.Fragment = a, q.jsx = _r, q.jsxs = gr;
|
|
625
625
|
}()), q;
|
|
626
626
|
}
|
|
627
627
|
process.env.NODE_ENV === "production" ? fe.exports = br() : fe.exports = Rr();
|
|
628
|
-
var
|
|
628
|
+
var F = fe.exports;
|
|
629
629
|
const J = $e({
|
|
630
630
|
rootValue: /* @__PURE__ */ new Set(),
|
|
631
631
|
setRootValue: () => {
|
|
@@ -647,8 +647,8 @@ function Er() {
|
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
649
|
if (t.current[a] = { value: a, parent: d, children: {}, childrenLength: 0, index: f, isGroup: s, ref: p }, t.current[d].children[f] = a, (f + 1 > t.current[d].childrenLength || t.current[t.current[d].childrenLength - 1] == null) && (t.current[d].childrenLength = f + 1), o.current[a]) {
|
|
650
|
-
for (const
|
|
651
|
-
i(...
|
|
650
|
+
for (const _ of o.current[a])
|
|
651
|
+
i(..._);
|
|
652
652
|
delete o.current[a];
|
|
653
653
|
}
|
|
654
654
|
}, []);
|
|
@@ -734,38 +734,38 @@ function Pr(t) {
|
|
|
734
734
|
(a = t[o].ref.current) == null || a.focus();
|
|
735
735
|
}
|
|
736
736
|
const Or = K(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...d }, f) => {
|
|
737
|
-
const [s, p] = Er(),
|
|
738
|
-
if (!(!yr.includes(
|
|
739
|
-
switch (
|
|
737
|
+
const [s, p] = Er(), _ = Ye(), [y, b] = mr(t, o, i ?? /* @__PURE__ */ new Set()), [w, T] = We(null), P = I(null), D = le(P, f), R = I(""), L = ee((h) => {
|
|
738
|
+
if (!(!yr.includes(h.key) || !s.current))
|
|
739
|
+
switch (h.key) {
|
|
740
740
|
case "ArrowRight":
|
|
741
741
|
if (!s.current[R.current].isGroup)
|
|
742
742
|
break;
|
|
743
|
-
y.has(R.current) ? wr(s.current, R.current) :
|
|
743
|
+
h.preventDefault(), y.has(R.current) ? wr(s.current, R.current) : b((x) => /* @__PURE__ */ new Set([...x, R.current]));
|
|
744
744
|
break;
|
|
745
745
|
case "ArrowLeft":
|
|
746
|
-
y.has(R.current) ?
|
|
746
|
+
h.preventDefault(), y.has(R.current) ? b((x) => new Set([...x].filter((A) => A !== R.current))) : Tr(s.current, R.current);
|
|
747
747
|
break;
|
|
748
748
|
case "ArrowUp":
|
|
749
|
-
xr(s.current, R.current);
|
|
749
|
+
h.preventDefault(), xr(s.current, R.current);
|
|
750
750
|
break;
|
|
751
751
|
case "ArrowDown":
|
|
752
|
-
Sr(s.current, R.current);
|
|
752
|
+
h.preventDefault(), Sr(s.current, R.current);
|
|
753
753
|
break;
|
|
754
754
|
case "Home":
|
|
755
|
-
Cr(s.current);
|
|
755
|
+
h.preventDefault(), Cr(s.current);
|
|
756
756
|
break;
|
|
757
757
|
case "End":
|
|
758
|
-
Pr(s.current);
|
|
758
|
+
h.preventDefault(), Pr(s.current);
|
|
759
759
|
break;
|
|
760
760
|
case "Enter":
|
|
761
|
-
T(R.current), y.has(R.current) ?
|
|
761
|
+
h.preventDefault(), T(R.current), y.has(R.current) ? b((x) => new Set([...x].filter((A) => A !== R.current))) : b((x) => /* @__PURE__ */ new Set([...x, R.current]));
|
|
762
762
|
break;
|
|
763
763
|
}
|
|
764
764
|
}, [y]), C = re(a, L);
|
|
765
|
-
return /* @__PURE__ */
|
|
765
|
+
return /* @__PURE__ */ F.jsx(J.Provider, { value: { rootValue: y, setRootValue: b, selection: w, setSelection: T, focus: R, nodeMap: s, pushToNodeMap: p }, children: /* @__PURE__ */ F.jsx(Y.Provider, { value: { parent: "__root__", getIndex: _, depth: 0 }, children: /* @__PURE__ */ F.jsx(
|
|
766
766
|
"ul",
|
|
767
767
|
{
|
|
768
|
-
ref:
|
|
768
|
+
ref: D,
|
|
769
769
|
role: "tree",
|
|
770
770
|
"aria-multiselectable": "false",
|
|
771
771
|
onKeyDown: C,
|
|
@@ -773,13 +773,13 @@ const Or = K(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...d
|
|
|
773
773
|
}
|
|
774
774
|
) }) });
|
|
775
775
|
}), kr = K(({ value: t, onFocus: o, ...i }, a) => {
|
|
776
|
-
const { selection: d, focus: f, nodeMap: s, pushToNodeMap: p } = V(J), { parent:
|
|
777
|
-
function
|
|
778
|
-
var C,
|
|
779
|
-
(
|
|
776
|
+
const { selection: d, focus: f, nodeMap: s, pushToNodeMap: p } = V(J), { parent: _, getIndex: y, depth: b } = V(Y), w = I(null), T = le(w, a), P = re(o, D);
|
|
777
|
+
function D(L) {
|
|
778
|
+
var C, h, x;
|
|
779
|
+
(h = (C = s.current) == null ? void 0 : C[f.current].ref.current) == null || h.setAttribute("tabindex", "-1"), (x = w.current) == null || x.setAttribute("tabindex", "0"), f.current = t, L.preventDefault();
|
|
780
780
|
}
|
|
781
781
|
const R = y(t);
|
|
782
|
-
return p(t,
|
|
782
|
+
return p(t, _, R, !1, w), f.current == "" && _ == "__root__" && R == 0 && (f.current = t), /* @__PURE__ */ F.jsx(
|
|
783
783
|
"li",
|
|
784
784
|
{
|
|
785
785
|
ref: T,
|
|
@@ -787,21 +787,21 @@ const Or = K(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...d
|
|
|
787
787
|
"aria-selected": d == t,
|
|
788
788
|
tabIndex: f.current == t ? 0 : -1,
|
|
789
789
|
onFocus: P,
|
|
790
|
-
"data-depth":
|
|
790
|
+
"data-depth": b,
|
|
791
791
|
...i
|
|
792
792
|
}
|
|
793
793
|
);
|
|
794
794
|
}), jr = K(({ value: t, onFocus: o, ...i }, a) => {
|
|
795
|
-
const d = Ye(), { rootValue: f, selection: s, focus: p, nodeMap:
|
|
796
|
-
function L(
|
|
797
|
-
var x,
|
|
798
|
-
(
|
|
795
|
+
const d = Ye(), { rootValue: f, selection: s, focus: p, nodeMap: _, pushToNodeMap: y } = V(J), { parent: b, getIndex: w, depth: T } = V(Y), P = I(null), D = le(P, a), R = re(o, L);
|
|
796
|
+
function L(h) {
|
|
797
|
+
var x, A, M;
|
|
798
|
+
(A = (x = _.current) == null ? void 0 : x[p.current].ref.current) == null || A.setAttribute("tabindex", "-1"), (M = P.current) == null || M.setAttribute("tabindex", "0"), p.current = t, h.preventDefault();
|
|
799
799
|
}
|
|
800
800
|
const C = w(t);
|
|
801
|
-
return y(t,
|
|
801
|
+
return y(t, b, C, !0, P), p.current == "" && b == "__root__" && C == 0 && (p.current = t), /* @__PURE__ */ F.jsx(Y.Provider, { value: { parent: t, getIndex: d, depth: T + 1 }, children: /* @__PURE__ */ F.jsx(
|
|
802
802
|
"li",
|
|
803
803
|
{
|
|
804
|
-
ref:
|
|
804
|
+
ref: D,
|
|
805
805
|
role: "treenode",
|
|
806
806
|
"aria-expanded": f.has(t),
|
|
807
807
|
"data-state": f.has(t) ? "open" : "closed",
|
|
@@ -812,12 +812,12 @@ const Or = K(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...d
|
|
|
812
812
|
...i
|
|
813
813
|
}
|
|
814
814
|
) });
|
|
815
|
-
}),
|
|
815
|
+
}), Dr = K(({ onClick: t, ...o }, i) => {
|
|
816
816
|
const { setRootValue: a, setSelection: d } = V(J), { parent: f } = V(Y), s = re(t, p);
|
|
817
817
|
function p() {
|
|
818
|
-
d(f), a((
|
|
818
|
+
d(f), a((_) => _.has(f) ? new Set([..._].filter((y) => y !== f)) : /* @__PURE__ */ new Set([..._, f]));
|
|
819
819
|
}
|
|
820
|
-
return /* @__PURE__ */
|
|
820
|
+
return /* @__PURE__ */ F.jsx(
|
|
821
821
|
"div",
|
|
822
822
|
{
|
|
823
823
|
ref: i,
|
|
@@ -825,10 +825,10 @@ const Or = K(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...d
|
|
|
825
825
|
...o
|
|
826
826
|
}
|
|
827
827
|
);
|
|
828
|
-
}),
|
|
828
|
+
}), Ar = K(({ ...t }, o) => {
|
|
829
829
|
const { rootValue: i } = V(J), { parent: a } = V(Y);
|
|
830
830
|
if (i.has(a))
|
|
831
|
-
return /* @__PURE__ */
|
|
831
|
+
return /* @__PURE__ */ F.jsx(
|
|
832
832
|
"ul",
|
|
833
833
|
{
|
|
834
834
|
ref: o,
|
|
@@ -839,8 +839,8 @@ const Or = K(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...d
|
|
|
839
839
|
}), Ir = {
|
|
840
840
|
Root: Or,
|
|
841
841
|
Group: jr,
|
|
842
|
-
Trigger:
|
|
843
|
-
Content:
|
|
842
|
+
Trigger: Dr,
|
|
843
|
+
Content: Ar,
|
|
844
844
|
Item: kr
|
|
845
845
|
};
|
|
846
846
|
export {
|