react-composable-treeview 1.0.8 → 1.0.10
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 +2 -2
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +107 -106
- 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, f = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function l(c, h, y) {
|
|
19
19
|
var b, w = {}, T = null, S = null;
|
|
20
|
-
y !== void 0 && (T = "" + y),
|
|
21
|
-
for (b in
|
|
22
|
-
a.call(
|
|
23
|
-
if (
|
|
24
|
-
for (b in
|
|
25
|
-
w[b] === void 0 && (w[b] =
|
|
26
|
-
return { $$typeof: o, type:
|
|
20
|
+
y !== void 0 && (T = "" + y), h.key !== void 0 && (T = "" + h.key), h.ref !== void 0 && (S = h.ref);
|
|
21
|
+
for (b in h)
|
|
22
|
+
a.call(h, b) && !v.hasOwnProperty(b) && (w[b] = h[b]);
|
|
23
|
+
if (c && c.defaultProps)
|
|
24
|
+
for (b in h = c.defaultProps, h)
|
|
25
|
+
w[b] === void 0 && (w[b] = h[b]);
|
|
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 = l, q.jsxs = l, 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"), f = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), l = 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;
|
|
@@ -48,7 +48,7 @@ function Rr() {
|
|
|
48
48
|
return typeof r == "function" ? r : null;
|
|
49
49
|
}
|
|
50
50
|
var P = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
-
function
|
|
51
|
+
function _(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];
|
|
@@ -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 === v || Be || e ===
|
|
71
|
+
return !!(typeof e == "string" || typeof e == "function" || e === a || e === v || 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 === l || 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.
|
|
@@ -87,7 +87,7 @@ function Rr() {
|
|
|
87
87
|
function j(e) {
|
|
88
88
|
if (e == null)
|
|
89
89
|
return null;
|
|
90
|
-
if (typeof e.tag == "number" &&
|
|
90
|
+
if (typeof e.tag == "number" && _("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;
|
|
@@ -98,7 +98,7 @@ function Rr() {
|
|
|
98
98
|
return "Portal";
|
|
99
99
|
case v:
|
|
100
100
|
return "Profiler";
|
|
101
|
-
case
|
|
101
|
+
case f:
|
|
102
102
|
return "StrictMode";
|
|
103
103
|
case y:
|
|
104
104
|
return "Suspense";
|
|
@@ -107,13 +107,13 @@ function Rr() {
|
|
|
107
107
|
}
|
|
108
108
|
if (typeof e == "object")
|
|
109
109
|
switch (e.$$typeof) {
|
|
110
|
-
case
|
|
110
|
+
case c:
|
|
111
111
|
var r = e;
|
|
112
112
|
return he(r) + ".Consumer";
|
|
113
|
-
case
|
|
113
|
+
case l:
|
|
114
114
|
var n = e;
|
|
115
115
|
return he(n._context) + ".Provider";
|
|
116
|
-
case
|
|
116
|
+
case h:
|
|
117
117
|
return Ke(e, e.render, "ForwardRef");
|
|
118
118
|
case w:
|
|
119
119
|
var u = e.displayName || null;
|
|
@@ -188,7 +188,7 @@ function Rr() {
|
|
|
188
188
|
})
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
G < 0 &&
|
|
191
|
+
G < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
var oe = P.ReactCurrentDispatcher, ae;
|
|
@@ -258,17 +258,17 @@ function Rr() {
|
|
|
258
258
|
}
|
|
259
259
|
} catch (D) {
|
|
260
260
|
if (D && u && typeof D.stack == "string") {
|
|
261
|
-
for (var
|
|
261
|
+
for (var s = D.stack.split(`
|
|
262
262
|
`), C = u.stack.split(`
|
|
263
|
-
`), R =
|
|
263
|
+
`), R = s.length - 1, m = C.length - 1; R >= 1 && m >= 0 && s[R] !== C[m]; )
|
|
264
264
|
m--;
|
|
265
265
|
for (; R >= 1 && m >= 0; R--, m--)
|
|
266
|
-
if (
|
|
266
|
+
if (s[R] !== C[m]) {
|
|
267
267
|
if (R !== 1 || m !== 1)
|
|
268
268
|
do
|
|
269
|
-
if (R--, m--, m < 0 ||
|
|
269
|
+
if (R--, m--, m < 0 || s[R] !== C[m]) {
|
|
270
270
|
var O = `
|
|
271
|
-
` +
|
|
271
|
+
` + s[R].replace(" at new ", " at ");
|
|
272
272
|
return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && Q.set(e, O), O;
|
|
273
273
|
}
|
|
274
274
|
while (R >= 1 && m >= 0);
|
|
@@ -303,7 +303,7 @@ function Rr() {
|
|
|
303
303
|
}
|
|
304
304
|
if (typeof e == "object")
|
|
305
305
|
switch (e.$$typeof) {
|
|
306
|
-
case
|
|
306
|
+
case h:
|
|
307
307
|
return He(e.render);
|
|
308
308
|
case w:
|
|
309
309
|
return ee(e.type, r, n);
|
|
@@ -330,17 +330,17 @@ function Rr() {
|
|
|
330
330
|
var g = Function.call.bind(re);
|
|
331
331
|
for (var d in e)
|
|
332
332
|
if (g(e, d)) {
|
|
333
|
-
var
|
|
333
|
+
var s = void 0;
|
|
334
334
|
try {
|
|
335
335
|
if (typeof e[d] != "function") {
|
|
336
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
|
-
|
|
339
|
+
s = e[d](r, d, u, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
340
|
} catch (R) {
|
|
341
|
-
|
|
341
|
+
s = R;
|
|
342
342
|
}
|
|
343
|
-
|
|
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, d, 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
|
}
|
|
@@ -366,7 +366,7 @@ function Rr() {
|
|
|
366
366
|
}
|
|
367
367
|
function Pe(e) {
|
|
368
368
|
if (rr(e))
|
|
369
|
-
return
|
|
369
|
+
return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", er(e)), Se(e);
|
|
370
370
|
}
|
|
371
371
|
var B = P.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" && B.current && r && B.current.stateNode !== r) {
|
|
396
396
|
var n = j(B.current.type);
|
|
397
|
-
ce[n] || (
|
|
397
|
+
ce[n] || (_('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', j(B.current.type), e.ref), ce[n] = !0);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
function ir(e, r) {
|
|
401
401
|
{
|
|
402
402
|
var n = function() {
|
|
403
|
-
Oe || (Oe = !0,
|
|
403
|
+
Oe || (Oe = !0, _("%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
|
-
ke || (ke = !0,
|
|
414
|
+
ke || (ke = !0, _("%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,
|
|
@@ -420,7 +420,7 @@ function Rr() {
|
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
var cr = function(e, r, n, u, p, g, d) {
|
|
423
|
-
var
|
|
423
|
+
var s = {
|
|
424
424
|
// This tag allows us to uniquely identify this as a React Element
|
|
425
425
|
$$typeof: o,
|
|
426
426
|
// Built-in properties that belong on the element
|
|
@@ -431,27 +431,27 @@ function Rr() {
|
|
|
431
431
|
// Record the component responsible for creating this element.
|
|
432
432
|
_owner: g
|
|
433
433
|
};
|
|
434
|
-
return
|
|
434
|
+
return s._store = {}, Object.defineProperty(s._store, "validated", {
|
|
435
435
|
configurable: !1,
|
|
436
436
|
enumerable: !1,
|
|
437
437
|
writable: !0,
|
|
438
438
|
value: !1
|
|
439
|
-
}), Object.defineProperty(
|
|
439
|
+
}), Object.defineProperty(s, "_self", {
|
|
440
440
|
configurable: !1,
|
|
441
441
|
enumerable: !1,
|
|
442
442
|
writable: !1,
|
|
443
443
|
value: u
|
|
444
|
-
}), Object.defineProperty(
|
|
444
|
+
}), Object.defineProperty(s, "_source", {
|
|
445
445
|
configurable: !1,
|
|
446
446
|
enumerable: !1,
|
|
447
447
|
writable: !1,
|
|
448
448
|
value: p
|
|
449
|
-
}), Object.freeze && (Object.freeze(
|
|
449
|
+
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
|
|
450
450
|
};
|
|
451
451
|
function sr(e, r, n, u, p) {
|
|
452
452
|
{
|
|
453
|
-
var g, d = {},
|
|
454
|
-
n !== void 0 && (Pe(n),
|
|
453
|
+
var g, d = {}, s = null, C = null;
|
|
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
456
|
re.call(r, g) && !tr.hasOwnProperty(g) && (d[g] = r[g]);
|
|
457
457
|
if (e && e.defaultProps) {
|
|
@@ -459,11 +459,11 @@ function Rr() {
|
|
|
459
459
|
for (g in R)
|
|
460
460
|
d[g] === void 0 && (d[g] = R[g]);
|
|
461
461
|
}
|
|
462
|
-
if (
|
|
462
|
+
if (s || C) {
|
|
463
463
|
var m = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
464
|
-
|
|
464
|
+
s && ir(d, m), C && ur(d, m);
|
|
465
465
|
}
|
|
466
|
-
return cr(e,
|
|
466
|
+
return cr(e, s, C, p, u, B.current, d);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
var se = P.ReactCurrentOwner, je = P.ReactDebugCurrentFrame;
|
|
@@ -525,7 +525,7 @@ Check the top-level render call using <` + n + ">.");
|
|
|
525
525
|
return;
|
|
526
526
|
Ae[n] = !0;
|
|
527
527
|
var u = "";
|
|
528
|
-
e && e._owner && e._owner !== se.current && (u = " It was passed a child from " + j(e._owner.type) + "."), W(e),
|
|
528
|
+
e && e._owner && e._owner !== se.current && (u = " It was passed a child from " + j(e._owner.type) + "."), W(e), _('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), W(null);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
function Ie(e, r) {
|
|
@@ -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 === h || // 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 && !fe) {
|
|
568
568
|
fe = !0;
|
|
569
569
|
var p = j(r);
|
|
570
|
-
|
|
570
|
+
_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
|
|
571
571
|
}
|
|
572
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
572
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && _("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,23 +577,23 @@ 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
|
-
W(e),
|
|
580
|
+
W(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", u), W(null);
|
|
581
581
|
break;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
e.ref !== null && (W(e),
|
|
584
|
+
e.ref !== null && (W(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
function Ve(e, r, n, u, p, g) {
|
|
588
588
|
{
|
|
589
589
|
var d = qe(e);
|
|
590
590
|
if (!d) {
|
|
591
|
-
var
|
|
592
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
591
|
+
var s = "";
|
|
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);
|
|
594
|
-
C ?
|
|
594
|
+
C ? s += C : s += De();
|
|
595
595
|
var R;
|
|
596
|
-
e === null ? R = "null" : ue(e) ? R = "array" : e !== void 0 && e.$$typeof === o ? (R = "<" + (j(e.type) || "Unknown") + " />",
|
|
596
|
+
e === null ? R = "null" : ue(e) ? R = "array" : e !== void 0 && e.$$typeof === o ? (R = "<" + (j(e.type) || "Unknown") + " />", s = " Did you accidentally export a JSX literal instead of a component?") : R = typeof e, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, s);
|
|
597
597
|
}
|
|
598
598
|
var m = sr(e, r, n, p, g);
|
|
599
599
|
if (m == null)
|
|
@@ -607,7 +607,7 @@ Check the top-level render call using <` + n + ">.");
|
|
|
607
607
|
Ie(O[Y], e);
|
|
608
608
|
Object.freeze && Object.freeze(O);
|
|
609
609
|
} else
|
|
610
|
-
|
|
610
|
+
_("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
|
Ie(O, e);
|
|
613
613
|
}
|
|
@@ -641,14 +641,14 @@ 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, f, v, l, c) => {
|
|
645
|
+
if (!t.current[f]) {
|
|
646
|
+
o.current[f] ? o.current[f].push([a, f, v, l, c]) : o.current[f] = [[a, f, v, l, c]];
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
|
-
if (t.current[a] = { value: a, parent:
|
|
650
|
-
for (const
|
|
651
|
-
i(...
|
|
649
|
+
if (t.current[a] = { value: a, parent: f, children: {}, childrenLength: 0, index: v, isGroup: l, ref: c }, t.current[f].children[v] = a, (v + 1 > t.current[f].childrenLength || t.current[t.current[f].childrenLength - 1] == null) && (t.current[f].childrenLength = v + 1), o.current[a]) {
|
|
650
|
+
for (const h of o.current[a])
|
|
651
|
+
i(...h);
|
|
652
652
|
delete o.current[a];
|
|
653
653
|
}
|
|
654
654
|
}, []);
|
|
@@ -660,17 +660,18 @@ 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, f] = Ue(i);
|
|
664
|
+
return [t !== void 0 ? t : a, (c) => {
|
|
665
|
+
const h = typeof c == "function" ? c(a) : c;
|
|
666
|
+
o && o(h), f(h);
|
|
666
667
|
}];
|
|
667
668
|
}
|
|
668
669
|
function J(t, o) {
|
|
669
670
|
return function(a) {
|
|
670
|
-
const
|
|
671
|
-
|
|
671
|
+
const f = a.defaultPrevented;
|
|
672
|
+
f && (a.defaultPrevented = !1), t == null || t(a);
|
|
672
673
|
let v;
|
|
673
|
-
return a.defaultPrevented || (v = o == null ? void 0 : o(a),
|
|
674
|
+
return a.defaultPrevented || (v = o == null ? void 0 : o(a), f && (a.defaultPrevented = !0)), v;
|
|
674
675
|
};
|
|
675
676
|
}
|
|
676
677
|
function ve(...t) {
|
|
@@ -695,23 +696,23 @@ function Tr(t, o) {
|
|
|
695
696
|
i != "__root__" && ((a = t[i].ref.current) == null || a.focus());
|
|
696
697
|
}
|
|
697
698
|
function xr(t, o) {
|
|
698
|
-
var
|
|
699
|
+
var f, v;
|
|
699
700
|
const i = t[o].parent, a = t[o].index;
|
|
700
701
|
if (a != 0) {
|
|
701
|
-
let
|
|
702
|
-
for (; t[
|
|
703
|
-
|
|
704
|
-
(
|
|
702
|
+
let l = t[i].children[a - 1], c;
|
|
703
|
+
for (; t[l].isGroup && (c = t[l].children[t[l].childrenLength - 1], !(c == null || t[c].ref.current == null)); )
|
|
704
|
+
l = c;
|
|
705
|
+
(f = t[l].ref.current) == null || f.focus();
|
|
705
706
|
return;
|
|
706
707
|
}
|
|
707
708
|
i != "__root__" && ((v = t[i].ref.current) == null || v.focus());
|
|
708
709
|
}
|
|
709
710
|
function Cr(t, o) {
|
|
710
|
-
var
|
|
711
|
+
var f, v;
|
|
711
712
|
if (t[o].isGroup) {
|
|
712
|
-
const
|
|
713
|
-
if (
|
|
714
|
-
|
|
713
|
+
const l = (f = t[t[o].children[0]]) == null ? void 0 : f.ref.current;
|
|
714
|
+
if (l) {
|
|
715
|
+
l.focus();
|
|
715
716
|
return;
|
|
716
717
|
}
|
|
717
718
|
}
|
|
@@ -735,62 +736,62 @@ function Pr(t) {
|
|
|
735
736
|
o = i;
|
|
736
737
|
(a = t[o].ref.current) == null || a.focus();
|
|
737
738
|
}
|
|
738
|
-
const Or = M(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...
|
|
739
|
-
const [
|
|
740
|
-
if (!(!yr.includes(
|
|
741
|
-
switch (
|
|
739
|
+
const Or = M(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...f }, v) => {
|
|
740
|
+
const [l, c] = Er(), h = 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((_) => {
|
|
741
|
+
if (!(!yr.includes(_.key) || !l.current))
|
|
742
|
+
switch (_.key) {
|
|
742
743
|
case "ArrowRight":
|
|
743
|
-
if (!
|
|
744
|
+
if (!l.current[E.current].isGroup)
|
|
744
745
|
break;
|
|
745
|
-
|
|
746
|
+
_.preventDefault(), y.has(E.current) ? wr(l.current, E.current) : b((x) => /* @__PURE__ */ new Set([...x, E.current]));
|
|
746
747
|
break;
|
|
747
748
|
case "ArrowLeft":
|
|
748
|
-
|
|
749
|
+
_.preventDefault(), y.has(E.current) ? b((x) => new Set([...x].filter((k) => k !== E.current))) : Tr(l.current, E.current);
|
|
749
750
|
break;
|
|
750
751
|
case "ArrowUp":
|
|
751
|
-
|
|
752
|
+
_.preventDefault(), xr(l.current, E.current);
|
|
752
753
|
break;
|
|
753
754
|
case "ArrowDown":
|
|
754
|
-
|
|
755
|
+
_.preventDefault(), Cr(l.current, E.current);
|
|
755
756
|
break;
|
|
756
757
|
case "Home":
|
|
757
|
-
|
|
758
|
+
_.preventDefault(), Sr(l.current);
|
|
758
759
|
break;
|
|
759
760
|
case "End":
|
|
760
|
-
|
|
761
|
+
_.preventDefault(), Pr(l.current);
|
|
761
762
|
break;
|
|
762
763
|
case "Enter":
|
|
763
|
-
|
|
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]));
|
|
764
765
|
break;
|
|
765
766
|
}
|
|
766
767
|
}, [y]), P = J(a, L);
|
|
767
|
-
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: l, pushToNodeMap: c }, children: /* @__PURE__ */ F.jsx(U.Provider, { value: { parent: "__root__", getIndex: h, depth: 0 }, children: /* @__PURE__ */ F.jsx(
|
|
768
769
|
"ul",
|
|
769
770
|
{
|
|
770
771
|
ref: A,
|
|
771
772
|
role: "tree",
|
|
772
773
|
"aria-multiselectable": "false",
|
|
773
774
|
onKeyDown: P,
|
|
774
|
-
...
|
|
775
|
+
...f
|
|
775
776
|
}
|
|
776
777
|
) }) });
|
|
777
|
-
}), kr = M(({ value: t, onFocus: o, onClick: i, ...a },
|
|
778
|
-
const { selection: v, setSelection:
|
|
778
|
+
}), kr = M(({ value: t, onFocus: o, onClick: i, ...a }, f) => {
|
|
779
|
+
const { selection: v, setSelection: l, 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, _);
|
|
779
780
|
function P(k) {
|
|
780
781
|
var N, H, X;
|
|
781
|
-
(H = (N =
|
|
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();
|
|
782
783
|
}
|
|
783
|
-
function
|
|
784
|
-
|
|
784
|
+
function _() {
|
|
785
|
+
l(t);
|
|
785
786
|
}
|
|
786
787
|
const x = w(t);
|
|
787
|
-
return y(t, b, x, !1, S),
|
|
788
|
+
return y(t, b, x, !1, S), c.current == "" && b == "__root__" && x == 0 && (c.current = t), /* @__PURE__ */ F.jsx(
|
|
788
789
|
"li",
|
|
789
790
|
{
|
|
790
791
|
ref: A,
|
|
791
792
|
role: "treenode",
|
|
792
793
|
"aria-selected": v == t,
|
|
793
|
-
tabIndex:
|
|
794
|
+
tabIndex: c.current == t ? 0 : -1,
|
|
794
795
|
onFocus: E,
|
|
795
796
|
onClick: L,
|
|
796
797
|
"data-depth": T,
|
|
@@ -798,13 +799,13 @@ const Or = M(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...s
|
|
|
798
799
|
}
|
|
799
800
|
);
|
|
800
801
|
}), jr = M(({ value: t, onFocus: o, ...i }, a) => {
|
|
801
|
-
const
|
|
802
|
-
function L(
|
|
802
|
+
const f = Ge(), { rootValue: v, selection: l, 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
|
+
function L(_) {
|
|
803
804
|
var x, k, N;
|
|
804
|
-
(k = (x =
|
|
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();
|
|
805
806
|
}
|
|
806
807
|
const P = w(t);
|
|
807
|
-
return y(t, b, P, !0, S),
|
|
808
|
+
return y(t, b, P, !0, S), c.current == "" && b == "__root__" && P == 0 && (c.current = t), /* @__PURE__ */ F.jsx(U.Provider, { value: { parent: t, getIndex: f, depth: T + 1 }, children: /* @__PURE__ */ F.jsx(
|
|
808
809
|
"li",
|
|
809
810
|
{
|
|
810
811
|
ref: A,
|
|
@@ -812,22 +813,22 @@ const Or = M(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...s
|
|
|
812
813
|
"aria-expanded": v.has(t),
|
|
813
814
|
"data-state": v.has(t) ? "open" : "closed",
|
|
814
815
|
"data-depth": T,
|
|
815
|
-
"aria-selected":
|
|
816
|
-
tabIndex:
|
|
816
|
+
"aria-selected": l == t,
|
|
817
|
+
tabIndex: c.current == t ? 0 : -1,
|
|
817
818
|
onFocus: E,
|
|
818
819
|
...i
|
|
819
820
|
}
|
|
820
821
|
) });
|
|
821
822
|
}), Dr = M(({ onClick: t, ...o }, i) => {
|
|
822
|
-
const { setRootValue: a, setSelection:
|
|
823
|
-
function
|
|
824
|
-
|
|
823
|
+
const { setRootValue: a, setSelection: f } = V(z), { parent: v } = V(U), l = J(t, c);
|
|
824
|
+
function c() {
|
|
825
|
+
f(v), a((h) => h.has(v) ? new Set([...h].filter((y) => y !== v)) : /* @__PURE__ */ new Set([...h, v]));
|
|
825
826
|
}
|
|
826
827
|
return /* @__PURE__ */ F.jsx(
|
|
827
828
|
"div",
|
|
828
829
|
{
|
|
829
830
|
ref: i,
|
|
830
|
-
onClick:
|
|
831
|
+
onClick: l,
|
|
831
832
|
...o
|
|
832
833
|
}
|
|
833
834
|
);
|