react-composable-treeview 1.0.0
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 +98 -0
- package/dist/contexts/groupContext.d.ts +7 -0
- package/dist/contexts/treeViewContext.d.ts +13 -0
- package/dist/hooks/useComposedRefs.d.ts +6 -0
- package/dist/hooks/useControlledState.d.ts +7 -0
- package/dist/hooks/useIndex.d.ts +2 -0
- package/dist/hooks/useNodeMap.d.ts +16 -0
- package/dist/index.cjs.js +28 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.es.js +846 -0
- package/dist/index.es.js.map +1 -0
- package/dist/treeView.d.ts +22 -0
- package/dist/utils.d.ts +1 -0
- package/package.json +52 -0
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,846 @@
|
|
|
1
|
+
import Le, { createContext as Ne, useRef as I, useCallback as Q, useState as $e, forwardRef as q, useContext as V } from "react";
|
|
2
|
+
var se = { exports: {} }, G = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.min.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var Ie;
|
|
13
|
+
function br() {
|
|
14
|
+
if (Ie)
|
|
15
|
+
return G;
|
|
16
|
+
Ie = 1;
|
|
17
|
+
var t = Le, 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(h, p, y) {
|
|
19
|
+
var g, x = {}, w = null, O = null;
|
|
20
|
+
y !== void 0 && (w = "" + y), p.key !== void 0 && (w = "" + p.key), p.ref !== void 0 && (O = p.ref);
|
|
21
|
+
for (g in p)
|
|
22
|
+
a.call(p, g) && !f.hasOwnProperty(g) && (x[g] = p[g]);
|
|
23
|
+
if (h && h.defaultProps)
|
|
24
|
+
for (g in p = h.defaultProps, p)
|
|
25
|
+
x[g] === void 0 && (x[g] = p[g]);
|
|
26
|
+
return { $$typeof: o, type: h, key: w, ref: O, props: x, _owner: d.current };
|
|
27
|
+
}
|
|
28
|
+
return G.Fragment = i, G.jsx = s, G.jsxs = s, G;
|
|
29
|
+
}
|
|
30
|
+
var B = {};
|
|
31
|
+
/**
|
|
32
|
+
* @license React
|
|
33
|
+
* react-jsx-runtime.development.js
|
|
34
|
+
*
|
|
35
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
36
|
+
*
|
|
37
|
+
* This source code is licensed under the MIT license found in the
|
|
38
|
+
* LICENSE file in the root directory of this source tree.
|
|
39
|
+
*/
|
|
40
|
+
var Ve;
|
|
41
|
+
function Rr() {
|
|
42
|
+
return Ve || (Ve = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
+
var t = Le, 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"), h = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), k = Symbol.iterator, E = "@@iterator";
|
|
44
|
+
function j(e) {
|
|
45
|
+
if (e === null || typeof e != "object")
|
|
46
|
+
return null;
|
|
47
|
+
var r = k && e[k] || e[E];
|
|
48
|
+
return typeof r == "function" ? r : null;
|
|
49
|
+
}
|
|
50
|
+
var S = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
+
function b(e) {
|
|
52
|
+
{
|
|
53
|
+
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), u = 1; u < r; u++)
|
|
54
|
+
n[u - 1] = arguments[u];
|
|
55
|
+
T("error", e, n);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function T(e, r, n) {
|
|
59
|
+
{
|
|
60
|
+
var u = S.ReactDebugCurrentFrame, v = u.getStackAddendum();
|
|
61
|
+
v !== "" && (r += "%s", n = n.concat([v]));
|
|
62
|
+
var _ = n.map(function(l) {
|
|
63
|
+
return String(l);
|
|
64
|
+
});
|
|
65
|
+
_.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, _);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
var J = !1, Ye = !1, Ue = !1, Ge = !1, Be = !1, le;
|
|
69
|
+
le = Symbol.for("react.module.reference");
|
|
70
|
+
function qe(e) {
|
|
71
|
+
return !!(typeof e == "string" || typeof e == "function" || e === a || e === f || Be || e === d || e === y || e === g || Ge || e === O || J || Ye || Ue || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === x || e.$$typeof === s || e.$$typeof === h || e.$$typeof === p || // This needs to include all possible module reference object
|
|
72
|
+
// types supported by any Flight configuration anywhere since
|
|
73
|
+
// we don't know which Flight build this will end up being used
|
|
74
|
+
// with.
|
|
75
|
+
e.$$typeof === le || e.getModuleId !== void 0));
|
|
76
|
+
}
|
|
77
|
+
function Ke(e, r, n) {
|
|
78
|
+
var u = e.displayName;
|
|
79
|
+
if (u)
|
|
80
|
+
return u;
|
|
81
|
+
var v = r.displayName || r.name || "";
|
|
82
|
+
return v !== "" ? n + "(" + v + ")" : n;
|
|
83
|
+
}
|
|
84
|
+
function de(e) {
|
|
85
|
+
return e.displayName || "Context";
|
|
86
|
+
}
|
|
87
|
+
function A(e) {
|
|
88
|
+
if (e == null)
|
|
89
|
+
return null;
|
|
90
|
+
if (typeof e.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
91
|
+
return e.displayName || e.name || null;
|
|
92
|
+
if (typeof e == "string")
|
|
93
|
+
return e;
|
|
94
|
+
switch (e) {
|
|
95
|
+
case a:
|
|
96
|
+
return "Fragment";
|
|
97
|
+
case i:
|
|
98
|
+
return "Portal";
|
|
99
|
+
case f:
|
|
100
|
+
return "Profiler";
|
|
101
|
+
case d:
|
|
102
|
+
return "StrictMode";
|
|
103
|
+
case y:
|
|
104
|
+
return "Suspense";
|
|
105
|
+
case g:
|
|
106
|
+
return "SuspenseList";
|
|
107
|
+
}
|
|
108
|
+
if (typeof e == "object")
|
|
109
|
+
switch (e.$$typeof) {
|
|
110
|
+
case h:
|
|
111
|
+
var r = e;
|
|
112
|
+
return de(r) + ".Consumer";
|
|
113
|
+
case s:
|
|
114
|
+
var n = e;
|
|
115
|
+
return de(n._context) + ".Provider";
|
|
116
|
+
case p:
|
|
117
|
+
return Ke(e, e.render, "ForwardRef");
|
|
118
|
+
case x:
|
|
119
|
+
var u = e.displayName || null;
|
|
120
|
+
return u !== null ? u : A(e.type) || "Memo";
|
|
121
|
+
case w: {
|
|
122
|
+
var v = e, _ = v._payload, l = v._init;
|
|
123
|
+
try {
|
|
124
|
+
return A(l(_));
|
|
125
|
+
} catch {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
var L = Object.assign, Y = 0, ve, he, pe, _e, ge, be, Re;
|
|
133
|
+
function Ee() {
|
|
134
|
+
}
|
|
135
|
+
Ee.__reactDisabledLog = !0;
|
|
136
|
+
function Je() {
|
|
137
|
+
{
|
|
138
|
+
if (Y === 0) {
|
|
139
|
+
ve = console.log, he = console.info, pe = console.warn, _e = console.error, ge = console.group, be = console.groupCollapsed, Re = console.groupEnd;
|
|
140
|
+
var e = {
|
|
141
|
+
configurable: !0,
|
|
142
|
+
enumerable: !0,
|
|
143
|
+
value: Ee,
|
|
144
|
+
writable: !0
|
|
145
|
+
};
|
|
146
|
+
Object.defineProperties(console, {
|
|
147
|
+
info: e,
|
|
148
|
+
log: e,
|
|
149
|
+
warn: e,
|
|
150
|
+
error: e,
|
|
151
|
+
group: e,
|
|
152
|
+
groupCollapsed: e,
|
|
153
|
+
groupEnd: e
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
Y++;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function Me() {
|
|
160
|
+
{
|
|
161
|
+
if (Y--, Y === 0) {
|
|
162
|
+
var e = {
|
|
163
|
+
configurable: !0,
|
|
164
|
+
enumerable: !0,
|
|
165
|
+
writable: !0
|
|
166
|
+
};
|
|
167
|
+
Object.defineProperties(console, {
|
|
168
|
+
log: L({}, e, {
|
|
169
|
+
value: ve
|
|
170
|
+
}),
|
|
171
|
+
info: L({}, e, {
|
|
172
|
+
value: he
|
|
173
|
+
}),
|
|
174
|
+
warn: L({}, e, {
|
|
175
|
+
value: pe
|
|
176
|
+
}),
|
|
177
|
+
error: L({}, e, {
|
|
178
|
+
value: _e
|
|
179
|
+
}),
|
|
180
|
+
group: L({}, e, {
|
|
181
|
+
value: ge
|
|
182
|
+
}),
|
|
183
|
+
groupCollapsed: L({}, e, {
|
|
184
|
+
value: be
|
|
185
|
+
}),
|
|
186
|
+
groupEnd: L({}, e, {
|
|
187
|
+
value: Re
|
|
188
|
+
})
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
Y < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
var re = S.ReactCurrentDispatcher, te;
|
|
195
|
+
function M(e, r, n) {
|
|
196
|
+
{
|
|
197
|
+
if (te === void 0)
|
|
198
|
+
try {
|
|
199
|
+
throw Error();
|
|
200
|
+
} catch (v) {
|
|
201
|
+
var u = v.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
+
te = u && u[1] || "";
|
|
203
|
+
}
|
|
204
|
+
return `
|
|
205
|
+
` + te + e;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
var ne = !1, z;
|
|
209
|
+
{
|
|
210
|
+
var ze = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
+
z = new ze();
|
|
212
|
+
}
|
|
213
|
+
function me(e, r) {
|
|
214
|
+
if (!e || ne)
|
|
215
|
+
return "";
|
|
216
|
+
{
|
|
217
|
+
var n = z.get(e);
|
|
218
|
+
if (n !== void 0)
|
|
219
|
+
return n;
|
|
220
|
+
}
|
|
221
|
+
var u;
|
|
222
|
+
ne = !0;
|
|
223
|
+
var v = Error.prepareStackTrace;
|
|
224
|
+
Error.prepareStackTrace = void 0;
|
|
225
|
+
var _;
|
|
226
|
+
_ = re.current, re.current = null, Je();
|
|
227
|
+
try {
|
|
228
|
+
if (r) {
|
|
229
|
+
var l = function() {
|
|
230
|
+
throw Error();
|
|
231
|
+
};
|
|
232
|
+
if (Object.defineProperty(l.prototype, "props", {
|
|
233
|
+
set: function() {
|
|
234
|
+
throw Error();
|
|
235
|
+
}
|
|
236
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
|
+
try {
|
|
238
|
+
Reflect.construct(l, []);
|
|
239
|
+
} catch (F) {
|
|
240
|
+
u = F;
|
|
241
|
+
}
|
|
242
|
+
Reflect.construct(e, [], l);
|
|
243
|
+
} else {
|
|
244
|
+
try {
|
|
245
|
+
l.call();
|
|
246
|
+
} catch (F) {
|
|
247
|
+
u = F;
|
|
248
|
+
}
|
|
249
|
+
e.call(l.prototype);
|
|
250
|
+
}
|
|
251
|
+
} else {
|
|
252
|
+
try {
|
|
253
|
+
throw Error();
|
|
254
|
+
} catch (F) {
|
|
255
|
+
u = F;
|
|
256
|
+
}
|
|
257
|
+
e();
|
|
258
|
+
}
|
|
259
|
+
} catch (F) {
|
|
260
|
+
if (F && u && typeof F.stack == "string") {
|
|
261
|
+
for (var c = F.stack.split(`
|
|
262
|
+
`), C = u.stack.split(`
|
|
263
|
+
`), R = c.length - 1, m = C.length - 1; R >= 1 && m >= 0 && c[R] !== C[m]; )
|
|
264
|
+
m--;
|
|
265
|
+
for (; R >= 1 && m >= 0; R--, m--)
|
|
266
|
+
if (c[R] !== C[m]) {
|
|
267
|
+
if (R !== 1 || m !== 1)
|
|
268
|
+
do
|
|
269
|
+
if (R--, m--, m < 0 || c[R] !== C[m]) {
|
|
270
|
+
var P = `
|
|
271
|
+
` + c[R].replace(" at new ", " at ");
|
|
272
|
+
return e.displayName && P.includes("<anonymous>") && (P = P.replace("<anonymous>", e.displayName)), typeof e == "function" && z.set(e, P), P;
|
|
273
|
+
}
|
|
274
|
+
while (R >= 1 && m >= 0);
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
} finally {
|
|
279
|
+
ne = !1, re.current = _, Me(), Error.prepareStackTrace = v;
|
|
280
|
+
}
|
|
281
|
+
var $ = e ? e.displayName || e.name : "", De = $ ? M($) : "";
|
|
282
|
+
return typeof e == "function" && z.set(e, De), De;
|
|
283
|
+
}
|
|
284
|
+
function Xe(e, r, n) {
|
|
285
|
+
return me(e, !1);
|
|
286
|
+
}
|
|
287
|
+
function He(e) {
|
|
288
|
+
var r = e.prototype;
|
|
289
|
+
return !!(r && r.isReactComponent);
|
|
290
|
+
}
|
|
291
|
+
function X(e, r, n) {
|
|
292
|
+
if (e == null)
|
|
293
|
+
return "";
|
|
294
|
+
if (typeof e == "function")
|
|
295
|
+
return me(e, He(e));
|
|
296
|
+
if (typeof e == "string")
|
|
297
|
+
return M(e);
|
|
298
|
+
switch (e) {
|
|
299
|
+
case y:
|
|
300
|
+
return M("Suspense");
|
|
301
|
+
case g:
|
|
302
|
+
return M("SuspenseList");
|
|
303
|
+
}
|
|
304
|
+
if (typeof e == "object")
|
|
305
|
+
switch (e.$$typeof) {
|
|
306
|
+
case p:
|
|
307
|
+
return Xe(e.render);
|
|
308
|
+
case x:
|
|
309
|
+
return X(e.type, r, n);
|
|
310
|
+
case w: {
|
|
311
|
+
var u = e, v = u._payload, _ = u._init;
|
|
312
|
+
try {
|
|
313
|
+
return X(_(v), r, n);
|
|
314
|
+
} catch {
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return "";
|
|
319
|
+
}
|
|
320
|
+
var H = Object.prototype.hasOwnProperty, ye = {}, we = S.ReactDebugCurrentFrame;
|
|
321
|
+
function Z(e) {
|
|
322
|
+
if (e) {
|
|
323
|
+
var r = e._owner, n = X(e.type, e._source, r ? r.type : null);
|
|
324
|
+
we.setExtraStackFrame(n);
|
|
325
|
+
} else
|
|
326
|
+
we.setExtraStackFrame(null);
|
|
327
|
+
}
|
|
328
|
+
function Ze(e, r, n, u, v) {
|
|
329
|
+
{
|
|
330
|
+
var _ = Function.call.bind(H);
|
|
331
|
+
for (var l in e)
|
|
332
|
+
if (_(e, l)) {
|
|
333
|
+
var c = void 0;
|
|
334
|
+
try {
|
|
335
|
+
if (typeof e[l] != "function") {
|
|
336
|
+
var C = Error((u || "React class") + ": " + n + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
|
+
throw C.name = "Invariant Violation", C;
|
|
338
|
+
}
|
|
339
|
+
c = e[l](r, l, u, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
+
} catch (R) {
|
|
341
|
+
c = R;
|
|
342
|
+
}
|
|
343
|
+
c && !(c instanceof Error) && (Z(v), b("%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), Z(null)), c instanceof Error && !(c.message in ye) && (ye[c.message] = !0, Z(v), b("Failed %s type: %s", n, c.message), Z(null));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
var Qe = Array.isArray;
|
|
348
|
+
function oe(e) {
|
|
349
|
+
return Qe(e);
|
|
350
|
+
}
|
|
351
|
+
function er(e) {
|
|
352
|
+
{
|
|
353
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
354
|
+
return n;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
function rr(e) {
|
|
358
|
+
try {
|
|
359
|
+
return Te(e), !1;
|
|
360
|
+
} catch {
|
|
361
|
+
return !0;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function Te(e) {
|
|
365
|
+
return "" + e;
|
|
366
|
+
}
|
|
367
|
+
function xe(e) {
|
|
368
|
+
if (rr(e))
|
|
369
|
+
return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", er(e)), Te(e);
|
|
370
|
+
}
|
|
371
|
+
var U = S.ReactCurrentOwner, tr = {
|
|
372
|
+
key: !0,
|
|
373
|
+
ref: !0,
|
|
374
|
+
__self: !0,
|
|
375
|
+
__source: !0
|
|
376
|
+
}, Ce, Se, ae;
|
|
377
|
+
ae = {};
|
|
378
|
+
function nr(e) {
|
|
379
|
+
if (H.call(e, "ref")) {
|
|
380
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
381
|
+
if (r && r.isReactWarning)
|
|
382
|
+
return !1;
|
|
383
|
+
}
|
|
384
|
+
return e.ref !== void 0;
|
|
385
|
+
}
|
|
386
|
+
function or(e) {
|
|
387
|
+
if (H.call(e, "key")) {
|
|
388
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
389
|
+
if (r && r.isReactWarning)
|
|
390
|
+
return !1;
|
|
391
|
+
}
|
|
392
|
+
return e.key !== void 0;
|
|
393
|
+
}
|
|
394
|
+
function ar(e, r) {
|
|
395
|
+
if (typeof e.ref == "string" && U.current && r && U.current.stateNode !== r) {
|
|
396
|
+
var n = A(U.current.type);
|
|
397
|
+
ae[n] || (b('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', A(U.current.type), e.ref), ae[n] = !0);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
function ir(e, r) {
|
|
401
|
+
{
|
|
402
|
+
var n = function() {
|
|
403
|
+
Ce || (Ce = !0, b("%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
|
+
};
|
|
405
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
406
|
+
get: n,
|
|
407
|
+
configurable: !0
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function ur(e, r) {
|
|
412
|
+
{
|
|
413
|
+
var n = function() {
|
|
414
|
+
Se || (Se = !0, b("%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
|
+
};
|
|
416
|
+
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
417
|
+
get: n,
|
|
418
|
+
configurable: !0
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
var cr = function(e, r, n, u, v, _, l) {
|
|
423
|
+
var c = {
|
|
424
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
425
|
+
$$typeof: o,
|
|
426
|
+
// Built-in properties that belong on the element
|
|
427
|
+
type: e,
|
|
428
|
+
key: r,
|
|
429
|
+
ref: n,
|
|
430
|
+
props: l,
|
|
431
|
+
// Record the component responsible for creating this element.
|
|
432
|
+
_owner: _
|
|
433
|
+
};
|
|
434
|
+
return c._store = {}, Object.defineProperty(c._store, "validated", {
|
|
435
|
+
configurable: !1,
|
|
436
|
+
enumerable: !1,
|
|
437
|
+
writable: !0,
|
|
438
|
+
value: !1
|
|
439
|
+
}), Object.defineProperty(c, "_self", {
|
|
440
|
+
configurable: !1,
|
|
441
|
+
enumerable: !1,
|
|
442
|
+
writable: !1,
|
|
443
|
+
value: u
|
|
444
|
+
}), Object.defineProperty(c, "_source", {
|
|
445
|
+
configurable: !1,
|
|
446
|
+
enumerable: !1,
|
|
447
|
+
writable: !1,
|
|
448
|
+
value: v
|
|
449
|
+
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
|
|
450
|
+
};
|
|
451
|
+
function sr(e, r, n, u, v) {
|
|
452
|
+
{
|
|
453
|
+
var _, l = {}, c = null, C = null;
|
|
454
|
+
n !== void 0 && (xe(n), c = "" + n), or(r) && (xe(r.key), c = "" + r.key), nr(r) && (C = r.ref, ar(r, v));
|
|
455
|
+
for (_ in r)
|
|
456
|
+
H.call(r, _) && !tr.hasOwnProperty(_) && (l[_] = r[_]);
|
|
457
|
+
if (e && e.defaultProps) {
|
|
458
|
+
var R = e.defaultProps;
|
|
459
|
+
for (_ in R)
|
|
460
|
+
l[_] === void 0 && (l[_] = R[_]);
|
|
461
|
+
}
|
|
462
|
+
if (c || C) {
|
|
463
|
+
var m = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
464
|
+
c && ir(l, m), C && ur(l, m);
|
|
465
|
+
}
|
|
466
|
+
return cr(e, c, C, v, u, U.current, l);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
var ie = S.ReactCurrentOwner, Pe = S.ReactDebugCurrentFrame;
|
|
470
|
+
function N(e) {
|
|
471
|
+
if (e) {
|
|
472
|
+
var r = e._owner, n = X(e.type, e._source, r ? r.type : null);
|
|
473
|
+
Pe.setExtraStackFrame(n);
|
|
474
|
+
} else
|
|
475
|
+
Pe.setExtraStackFrame(null);
|
|
476
|
+
}
|
|
477
|
+
var ue;
|
|
478
|
+
ue = !1;
|
|
479
|
+
function ce(e) {
|
|
480
|
+
return typeof e == "object" && e !== null && e.$$typeof === o;
|
|
481
|
+
}
|
|
482
|
+
function Oe() {
|
|
483
|
+
{
|
|
484
|
+
if (ie.current) {
|
|
485
|
+
var e = A(ie.current.type);
|
|
486
|
+
if (e)
|
|
487
|
+
return `
|
|
488
|
+
|
|
489
|
+
Check the render method of \`` + e + "`.";
|
|
490
|
+
}
|
|
491
|
+
return "";
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
function fr(e) {
|
|
495
|
+
{
|
|
496
|
+
if (e !== void 0) {
|
|
497
|
+
var r = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
|
|
498
|
+
return `
|
|
499
|
+
|
|
500
|
+
Check your code at ` + r + ":" + n + ".";
|
|
501
|
+
}
|
|
502
|
+
return "";
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
var ke = {};
|
|
506
|
+
function lr(e) {
|
|
507
|
+
{
|
|
508
|
+
var r = Oe();
|
|
509
|
+
if (!r) {
|
|
510
|
+
var n = typeof e == "string" ? e : e.displayName || e.name;
|
|
511
|
+
n && (r = `
|
|
512
|
+
|
|
513
|
+
Check the top-level render call using <` + n + ">.");
|
|
514
|
+
}
|
|
515
|
+
return r;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
function je(e, r) {
|
|
519
|
+
{
|
|
520
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
521
|
+
return;
|
|
522
|
+
e._store.validated = !0;
|
|
523
|
+
var n = lr(r);
|
|
524
|
+
if (ke[n])
|
|
525
|
+
return;
|
|
526
|
+
ke[n] = !0;
|
|
527
|
+
var u = "";
|
|
528
|
+
e && e._owner && e._owner !== ie.current && (u = " It was passed a child from " + A(e._owner.type) + "."), N(e), b('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), N(null);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
function Ae(e, r) {
|
|
532
|
+
{
|
|
533
|
+
if (typeof e != "object")
|
|
534
|
+
return;
|
|
535
|
+
if (oe(e))
|
|
536
|
+
for (var n = 0; n < e.length; n++) {
|
|
537
|
+
var u = e[n];
|
|
538
|
+
ce(u) && je(u, r);
|
|
539
|
+
}
|
|
540
|
+
else if (ce(e))
|
|
541
|
+
e._store && (e._store.validated = !0);
|
|
542
|
+
else if (e) {
|
|
543
|
+
var v = j(e);
|
|
544
|
+
if (typeof v == "function" && v !== e.entries)
|
|
545
|
+
for (var _ = v.call(e), l; !(l = _.next()).done; )
|
|
546
|
+
ce(l.value) && je(l.value, r);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
function dr(e) {
|
|
551
|
+
{
|
|
552
|
+
var r = e.type;
|
|
553
|
+
if (r == null || typeof r == "string")
|
|
554
|
+
return;
|
|
555
|
+
var n;
|
|
556
|
+
if (typeof r == "function")
|
|
557
|
+
n = r.propTypes;
|
|
558
|
+
else if (typeof r == "object" && (r.$$typeof === p || // Note: Memo only checks outer props here.
|
|
559
|
+
// Inner props are checked in the reconciler.
|
|
560
|
+
r.$$typeof === x))
|
|
561
|
+
n = r.propTypes;
|
|
562
|
+
else
|
|
563
|
+
return;
|
|
564
|
+
if (n) {
|
|
565
|
+
var u = A(r);
|
|
566
|
+
Ze(n, e.props, "prop", u, e);
|
|
567
|
+
} else if (r.PropTypes !== void 0 && !ue) {
|
|
568
|
+
ue = !0;
|
|
569
|
+
var v = A(r);
|
|
570
|
+
b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", v || "Unknown");
|
|
571
|
+
}
|
|
572
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
function vr(e) {
|
|
576
|
+
{
|
|
577
|
+
for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
|
|
578
|
+
var u = r[n];
|
|
579
|
+
if (u !== "children" && u !== "key") {
|
|
580
|
+
N(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", u), N(null);
|
|
581
|
+
break;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
e.ref !== null && (N(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), N(null));
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
function Fe(e, r, n, u, v, _) {
|
|
588
|
+
{
|
|
589
|
+
var l = qe(e);
|
|
590
|
+
if (!l) {
|
|
591
|
+
var c = "";
|
|
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(v);
|
|
594
|
+
C ? c += C : c += Oe();
|
|
595
|
+
var R;
|
|
596
|
+
e === null ? R = "null" : oe(e) ? R = "array" : e !== void 0 && e.$$typeof === o ? (R = "<" + (A(e.type) || "Unknown") + " />", c = " Did you accidentally export a JSX literal instead of a component?") : R = typeof e, b("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
|
+
}
|
|
598
|
+
var m = sr(e, r, n, v, _);
|
|
599
|
+
if (m == null)
|
|
600
|
+
return m;
|
|
601
|
+
if (l) {
|
|
602
|
+
var P = r.children;
|
|
603
|
+
if (P !== void 0)
|
|
604
|
+
if (u)
|
|
605
|
+
if (oe(P)) {
|
|
606
|
+
for (var $ = 0; $ < P.length; $++)
|
|
607
|
+
Ae(P[$], e);
|
|
608
|
+
Object.freeze && Object.freeze(P);
|
|
609
|
+
} else
|
|
610
|
+
b("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
|
+
else
|
|
612
|
+
Ae(P, e);
|
|
613
|
+
}
|
|
614
|
+
return e === a ? vr(m) : dr(m), m;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
function hr(e, r, n) {
|
|
618
|
+
return Fe(e, r, n, !0);
|
|
619
|
+
}
|
|
620
|
+
function pr(e, r, n) {
|
|
621
|
+
return Fe(e, r, n, !1);
|
|
622
|
+
}
|
|
623
|
+
var _r = pr, gr = hr;
|
|
624
|
+
B.Fragment = a, B.jsx = _r, B.jsxs = gr;
|
|
625
|
+
}()), B;
|
|
626
|
+
}
|
|
627
|
+
process.env.NODE_ENV === "production" ? se.exports = br() : se.exports = Rr();
|
|
628
|
+
var D = se.exports;
|
|
629
|
+
const K = Ne({
|
|
630
|
+
rootValue: /* @__PURE__ */ new Set(),
|
|
631
|
+
setRootValue: () => {
|
|
632
|
+
},
|
|
633
|
+
selection: null,
|
|
634
|
+
setSelection: () => {
|
|
635
|
+
},
|
|
636
|
+
focus: { current: "" },
|
|
637
|
+
nodeMap: { current: {} },
|
|
638
|
+
pushToNodeMap: () => {
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
function Er() {
|
|
642
|
+
const t = I({
|
|
643
|
+
__root__: { value: "__root__", parent: "", children: {}, index: 0, childrenLength: 0, isGroup: !0, ref: { current: null } }
|
|
644
|
+
}), o = I({}), i = Q((a, d, f, s, h) => {
|
|
645
|
+
if (!t.current[d]) {
|
|
646
|
+
o.current[d] ? o.current[d].push([a, d, f, s, h]) : o.current[d] = [[a, d, f, s, h]];
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
if (t.current[a] = { value: a, parent: d, children: {}, childrenLength: 0, index: f, isGroup: s, ref: h }, 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 p of o.current[a])
|
|
651
|
+
i(...p);
|
|
652
|
+
delete o.current[a];
|
|
653
|
+
}
|
|
654
|
+
}, []);
|
|
655
|
+
return [t, i];
|
|
656
|
+
}
|
|
657
|
+
const W = Ne({
|
|
658
|
+
parent: "",
|
|
659
|
+
getIndex: () => -1
|
|
660
|
+
});
|
|
661
|
+
function mr(t, o, i) {
|
|
662
|
+
const [a, d] = $e(i);
|
|
663
|
+
return [t !== void 0 ? t : a, (h) => {
|
|
664
|
+
d(h), o && o(a);
|
|
665
|
+
}];
|
|
666
|
+
}
|
|
667
|
+
function ee(t, o) {
|
|
668
|
+
return function(a) {
|
|
669
|
+
if (t == null || t(a), !a.defaultPrevented)
|
|
670
|
+
return o == null ? void 0 : o(a);
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
function fe(...t) {
|
|
674
|
+
return Q((o) => {
|
|
675
|
+
for (const i of t)
|
|
676
|
+
typeof i == "function" ? i(o) : i != null && (i.current = o);
|
|
677
|
+
}, [t]);
|
|
678
|
+
}
|
|
679
|
+
function We() {
|
|
680
|
+
const t = I(-1), o = I({});
|
|
681
|
+
return Q((a) => (o.current[a] == null && (o.current[a] = ++t.current), o.current[a]), []);
|
|
682
|
+
}
|
|
683
|
+
const yr = ["ArrowRight", "ArrowUp", "ArrowLeft", "ArrowDown", "Home", "End", "Enter"];
|
|
684
|
+
function wr(t, o) {
|
|
685
|
+
var a;
|
|
686
|
+
const i = t[o].children[0];
|
|
687
|
+
i != null && ((a = t[i].ref.current) == null || a.focus());
|
|
688
|
+
}
|
|
689
|
+
function Tr(t, o) {
|
|
690
|
+
var a;
|
|
691
|
+
const i = t[o].parent;
|
|
692
|
+
i != "__root__" && ((a = t[i].ref.current) == null || a.focus());
|
|
693
|
+
}
|
|
694
|
+
function xr(t, o) {
|
|
695
|
+
var d, f;
|
|
696
|
+
const i = t[o].parent, a = t[o].index;
|
|
697
|
+
if (a != 0) {
|
|
698
|
+
let s = t[i].children[a - 1], h;
|
|
699
|
+
for (; t[s].isGroup && (h = t[s].children[t[s].childrenLength - 1], !(h == null || t[h].ref.current == null)); )
|
|
700
|
+
s = h;
|
|
701
|
+
(d = t[s].ref.current) == null || d.focus();
|
|
702
|
+
return;
|
|
703
|
+
}
|
|
704
|
+
i != "__root__" && ((f = t[i].ref.current) == null || f.focus());
|
|
705
|
+
}
|
|
706
|
+
function Cr(t, o) {
|
|
707
|
+
var d, f;
|
|
708
|
+
if (t[o].isGroup) {
|
|
709
|
+
const s = (d = t[t[o].children[0]]) == null ? void 0 : d.ref.current;
|
|
710
|
+
if (s) {
|
|
711
|
+
s.focus();
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
let i, a;
|
|
716
|
+
for (; i = t[o].parent, a = t[i].children[t[o].index + 1], a == null; ) {
|
|
717
|
+
if (i == "__root__")
|
|
718
|
+
return;
|
|
719
|
+
o = i;
|
|
720
|
+
}
|
|
721
|
+
(f = t[a].ref.current) == null || f.focus();
|
|
722
|
+
}
|
|
723
|
+
function Sr(t) {
|
|
724
|
+
var i;
|
|
725
|
+
const o = t.__root__.children[0];
|
|
726
|
+
(i = t[o].ref.current) == null || i.focus();
|
|
727
|
+
}
|
|
728
|
+
function Pr(t) {
|
|
729
|
+
var a;
|
|
730
|
+
let o = "__root__", i;
|
|
731
|
+
for (; t[o].isGroup && (i = t[o].children[t[o].childrenLength - 1], !(i == null || t[i].ref.current == null)); )
|
|
732
|
+
o = i;
|
|
733
|
+
(a = t[o].ref.current) == null || a.focus();
|
|
734
|
+
}
|
|
735
|
+
const Or = q(({ value: t, onValueChange: o, defaultValue: i, onKeyDown: a, ...d }, f) => {
|
|
736
|
+
const [s, h] = Er(), p = We(), [y, g] = mr(t, o, i ?? /* @__PURE__ */ new Set()), [x, w] = $e(null), O = I(null), k = fe(O, f), E = I(""), j = Q((b) => {
|
|
737
|
+
if (!(!yr.includes(b.key) || !s.current))
|
|
738
|
+
switch (b.key) {
|
|
739
|
+
case "ArrowRight":
|
|
740
|
+
if (!s.current[E.current].isGroup)
|
|
741
|
+
break;
|
|
742
|
+
y.has(E.current) ? wr(s.current, E.current) : g((T) => (T.add(E.current), new Set(T)));
|
|
743
|
+
break;
|
|
744
|
+
case "ArrowLeft":
|
|
745
|
+
y.has(E.current) ? g((T) => (T.delete(E.current), new Set(T))) : Tr(s.current, E.current);
|
|
746
|
+
break;
|
|
747
|
+
case "ArrowUp":
|
|
748
|
+
xr(s.current, E.current);
|
|
749
|
+
break;
|
|
750
|
+
case "ArrowDown":
|
|
751
|
+
Cr(s.current, E.current);
|
|
752
|
+
break;
|
|
753
|
+
case "Home":
|
|
754
|
+
Sr(s.current);
|
|
755
|
+
break;
|
|
756
|
+
case "End":
|
|
757
|
+
Pr(s.current);
|
|
758
|
+
break;
|
|
759
|
+
case "Enter":
|
|
760
|
+
w(E.current), y.has(E.current) ? g((T) => (T.delete(E.current), new Set(T))) : g((T) => (T.add(E.current), new Set(T)));
|
|
761
|
+
break;
|
|
762
|
+
}
|
|
763
|
+
}, [y]), S = ee(a, j);
|
|
764
|
+
return /* @__PURE__ */ D.jsx(K.Provider, { value: { rootValue: y, setRootValue: g, selection: x, setSelection: w, focus: E, nodeMap: s, pushToNodeMap: h }, children: /* @__PURE__ */ D.jsx(W.Provider, { value: { parent: "__root__", getIndex: p }, children: /* @__PURE__ */ D.jsx(
|
|
765
|
+
"ul",
|
|
766
|
+
{
|
|
767
|
+
ref: k,
|
|
768
|
+
role: "tree",
|
|
769
|
+
"aria-multiselectable": "false",
|
|
770
|
+
onKeyDown: S,
|
|
771
|
+
...d
|
|
772
|
+
}
|
|
773
|
+
) }) });
|
|
774
|
+
}), kr = q(({ value: t, onFocus: o, ...i }, a) => {
|
|
775
|
+
const { selection: d, focus: f, nodeMap: s, pushToNodeMap: h } = V(K), { parent: p, getIndex: y } = V(W), g = I(null), x = fe(g, a), w = ee(o, O);
|
|
776
|
+
function O(E) {
|
|
777
|
+
var j, S, b;
|
|
778
|
+
(S = (j = s.current) == null ? void 0 : j[f.current].ref.current) == null || S.setAttribute("tabindex", "-1"), (b = g.current) == null || b.setAttribute("tabindex", "0"), f.current = t, E.preventDefault();
|
|
779
|
+
}
|
|
780
|
+
const k = y(t);
|
|
781
|
+
return h(t, p, k, !1, g), f.current == "" && p == "__root__" && k == 0 && (f.current = t), /* @__PURE__ */ D.jsx(
|
|
782
|
+
"li",
|
|
783
|
+
{
|
|
784
|
+
ref: x,
|
|
785
|
+
role: "treenode",
|
|
786
|
+
"aria-selected": d == t,
|
|
787
|
+
tabIndex: f.current == t ? 0 : -1,
|
|
788
|
+
onFocus: w,
|
|
789
|
+
...i
|
|
790
|
+
}
|
|
791
|
+
);
|
|
792
|
+
}), jr = q(({ value: t, onFocus: o, ...i }, a) => {
|
|
793
|
+
const d = We(), { rootValue: f, selection: s, focus: h, nodeMap: p, pushToNodeMap: y } = V(K), { parent: g, getIndex: x } = V(W), w = I(null), O = fe(w, a), k = ee(o, E);
|
|
794
|
+
function E(S) {
|
|
795
|
+
var b, T, J;
|
|
796
|
+
(T = (b = p.current) == null ? void 0 : b[h.current].ref.current) == null || T.setAttribute("tabindex", "-1"), (J = w.current) == null || J.setAttribute("tabindex", "0"), h.current = t, S.preventDefault();
|
|
797
|
+
}
|
|
798
|
+
const j = x(t);
|
|
799
|
+
return y(t, g, j, !0, w), h.current == "" && g == "__root__" && j == 0 && (h.current = t), /* @__PURE__ */ D.jsx(W.Provider, { value: { parent: t, getIndex: d }, children: /* @__PURE__ */ D.jsx(
|
|
800
|
+
"li",
|
|
801
|
+
{
|
|
802
|
+
ref: O,
|
|
803
|
+
role: "treenode",
|
|
804
|
+
"aria-expanded": f.has(t),
|
|
805
|
+
"data-state": f.has(t) ? "open" : "closed",
|
|
806
|
+
"aria-selected": s == t,
|
|
807
|
+
tabIndex: h.current == t ? 0 : -1,
|
|
808
|
+
onFocus: k,
|
|
809
|
+
...i
|
|
810
|
+
}
|
|
811
|
+
) });
|
|
812
|
+
}), Ar = q(({ onClick: t, ...o }, i) => {
|
|
813
|
+
const { setRootValue: a, setSelection: d } = V(K), { parent: f } = V(W), s = ee(t, h);
|
|
814
|
+
function h() {
|
|
815
|
+
d(f), a((p) => (p.has(f) ? p.delete(f) : p.add(f), new Set(p)));
|
|
816
|
+
}
|
|
817
|
+
return /* @__PURE__ */ D.jsx(
|
|
818
|
+
"div",
|
|
819
|
+
{
|
|
820
|
+
ref: i,
|
|
821
|
+
onClick: s,
|
|
822
|
+
...o
|
|
823
|
+
}
|
|
824
|
+
);
|
|
825
|
+
}), Fr = q(({ ...t }, o) => {
|
|
826
|
+
const { rootValue: i } = V(K), { parent: a } = V(W);
|
|
827
|
+
if (i.has(a))
|
|
828
|
+
return /* @__PURE__ */ D.jsx(
|
|
829
|
+
"ul",
|
|
830
|
+
{
|
|
831
|
+
ref: o,
|
|
832
|
+
role: "group",
|
|
833
|
+
...t
|
|
834
|
+
}
|
|
835
|
+
);
|
|
836
|
+
}), Ir = {
|
|
837
|
+
Root: Or,
|
|
838
|
+
Group: jr,
|
|
839
|
+
Trigger: Ar,
|
|
840
|
+
Content: Fr,
|
|
841
|
+
Item: kr
|
|
842
|
+
};
|
|
843
|
+
export {
|
|
844
|
+
Ir as default
|
|
845
|
+
};
|
|
846
|
+
//# sourceMappingURL=index.es.js.map
|