@entur/tab 0.5.5-beta.0 → 0.5.5-beta.3
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/tab.cjs.js +17 -1795
- package/dist/tab.cjs.js.map +1 -1
- package/dist/tab.esm.js +12 -1790
- package/dist/tab.esm.js.map +1 -1
- package/package.json +4 -12
package/dist/tab.cjs.js
CHANGED
|
@@ -2,1793 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const utils = require("@entur/utils");
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
var propTypes = { exports: {} };
|
|
10
|
-
var reactIs = { exports: {} };
|
|
11
|
-
var reactIs_production_min = {};
|
|
12
|
-
/** @license React v16.13.1
|
|
13
|
-
* react-is.production.min.js
|
|
14
|
-
*
|
|
15
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the MIT license found in the
|
|
18
|
-
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/
|
|
20
|
-
var hasRequiredReactIs_production_min;
|
|
21
|
-
function requireReactIs_production_min() {
|
|
22
|
-
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
23
|
-
hasRequiredReactIs_production_min = 1;
|
|
24
|
-
var b = "function" === typeof Symbol && Symbol.for, c = b ? Symbol.for("react.element") : 60103, d = b ? Symbol.for("react.portal") : 60106, e = b ? Symbol.for("react.fragment") : 60107, f = b ? Symbol.for("react.strict_mode") : 60108, g = b ? Symbol.for("react.profiler") : 60114, h = b ? Symbol.for("react.provider") : 60109, k = b ? Symbol.for("react.context") : 60110, l = b ? Symbol.for("react.async_mode") : 60111, m = b ? Symbol.for("react.concurrent_mode") : 60111, n = b ? Symbol.for("react.forward_ref") : 60112, p = b ? Symbol.for("react.suspense") : 60113, q = b ? Symbol.for("react.suspense_list") : 60120, r = b ? Symbol.for("react.memo") : 60115, t = b ? Symbol.for("react.lazy") : 60116, v = b ? Symbol.for("react.block") : 60121, w = b ? Symbol.for("react.fundamental") : 60117, x = b ? Symbol.for("react.responder") : 60118, y = b ? Symbol.for("react.scope") : 60119;
|
|
25
|
-
function z(a) {
|
|
26
|
-
if ("object" === typeof a && null !== a) {
|
|
27
|
-
var u = a.$$typeof;
|
|
28
|
-
switch (u) {
|
|
29
|
-
case c:
|
|
30
|
-
switch (a = a.type, a) {
|
|
31
|
-
case l:
|
|
32
|
-
case m:
|
|
33
|
-
case e:
|
|
34
|
-
case g:
|
|
35
|
-
case f:
|
|
36
|
-
case p:
|
|
37
|
-
return a;
|
|
38
|
-
default:
|
|
39
|
-
switch (a = a && a.$$typeof, a) {
|
|
40
|
-
case k:
|
|
41
|
-
case n:
|
|
42
|
-
case t:
|
|
43
|
-
case r:
|
|
44
|
-
case h:
|
|
45
|
-
return a;
|
|
46
|
-
default:
|
|
47
|
-
return u;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
case d:
|
|
51
|
-
return u;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function A(a) {
|
|
56
|
-
return z(a) === m;
|
|
57
|
-
}
|
|
58
|
-
reactIs_production_min.AsyncMode = l;
|
|
59
|
-
reactIs_production_min.ConcurrentMode = m;
|
|
60
|
-
reactIs_production_min.ContextConsumer = k;
|
|
61
|
-
reactIs_production_min.ContextProvider = h;
|
|
62
|
-
reactIs_production_min.Element = c;
|
|
63
|
-
reactIs_production_min.ForwardRef = n;
|
|
64
|
-
reactIs_production_min.Fragment = e;
|
|
65
|
-
reactIs_production_min.Lazy = t;
|
|
66
|
-
reactIs_production_min.Memo = r;
|
|
67
|
-
reactIs_production_min.Portal = d;
|
|
68
|
-
reactIs_production_min.Profiler = g;
|
|
69
|
-
reactIs_production_min.StrictMode = f;
|
|
70
|
-
reactIs_production_min.Suspense = p;
|
|
71
|
-
reactIs_production_min.isAsyncMode = function(a) {
|
|
72
|
-
return A(a) || z(a) === l;
|
|
73
|
-
};
|
|
74
|
-
reactIs_production_min.isConcurrentMode = A;
|
|
75
|
-
reactIs_production_min.isContextConsumer = function(a) {
|
|
76
|
-
return z(a) === k;
|
|
77
|
-
};
|
|
78
|
-
reactIs_production_min.isContextProvider = function(a) {
|
|
79
|
-
return z(a) === h;
|
|
80
|
-
};
|
|
81
|
-
reactIs_production_min.isElement = function(a) {
|
|
82
|
-
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
83
|
-
};
|
|
84
|
-
reactIs_production_min.isForwardRef = function(a) {
|
|
85
|
-
return z(a) === n;
|
|
86
|
-
};
|
|
87
|
-
reactIs_production_min.isFragment = function(a) {
|
|
88
|
-
return z(a) === e;
|
|
89
|
-
};
|
|
90
|
-
reactIs_production_min.isLazy = function(a) {
|
|
91
|
-
return z(a) === t;
|
|
92
|
-
};
|
|
93
|
-
reactIs_production_min.isMemo = function(a) {
|
|
94
|
-
return z(a) === r;
|
|
95
|
-
};
|
|
96
|
-
reactIs_production_min.isPortal = function(a) {
|
|
97
|
-
return z(a) === d;
|
|
98
|
-
};
|
|
99
|
-
reactIs_production_min.isProfiler = function(a) {
|
|
100
|
-
return z(a) === g;
|
|
101
|
-
};
|
|
102
|
-
reactIs_production_min.isStrictMode = function(a) {
|
|
103
|
-
return z(a) === f;
|
|
104
|
-
};
|
|
105
|
-
reactIs_production_min.isSuspense = function(a) {
|
|
106
|
-
return z(a) === p;
|
|
107
|
-
};
|
|
108
|
-
reactIs_production_min.isValidElementType = function(a) {
|
|
109
|
-
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
110
|
-
};
|
|
111
|
-
reactIs_production_min.typeOf = z;
|
|
112
|
-
return reactIs_production_min;
|
|
113
|
-
}
|
|
114
|
-
var reactIs_development = {};
|
|
115
|
-
/** @license React v16.13.1
|
|
116
|
-
* react-is.development.js
|
|
117
|
-
*
|
|
118
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
119
|
-
*
|
|
120
|
-
* This source code is licensed under the MIT license found in the
|
|
121
|
-
* LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/
|
|
123
|
-
var hasRequiredReactIs_development;
|
|
124
|
-
function requireReactIs_development() {
|
|
125
|
-
if (hasRequiredReactIs_development) return reactIs_development;
|
|
126
|
-
hasRequiredReactIs_development = 1;
|
|
127
|
-
if (process.env.NODE_ENV !== "production") {
|
|
128
|
-
(function() {
|
|
129
|
-
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
130
|
-
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
|
|
131
|
-
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
|
|
132
|
-
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
|
|
133
|
-
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
|
|
134
|
-
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
|
|
135
|
-
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
|
|
136
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
|
|
137
|
-
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
|
|
138
|
-
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
|
|
139
|
-
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
|
|
140
|
-
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
|
|
141
|
-
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
|
|
142
|
-
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
|
|
143
|
-
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
|
|
144
|
-
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
|
|
145
|
-
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
|
|
146
|
-
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
|
|
147
|
-
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
|
|
148
|
-
function isValidElementType(type) {
|
|
149
|
-
return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
150
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
151
|
-
}
|
|
152
|
-
function typeOf(object) {
|
|
153
|
-
if (typeof object === "object" && object !== null) {
|
|
154
|
-
var $$typeof = object.$$typeof;
|
|
155
|
-
switch ($$typeof) {
|
|
156
|
-
case REACT_ELEMENT_TYPE:
|
|
157
|
-
var type = object.type;
|
|
158
|
-
switch (type) {
|
|
159
|
-
case REACT_ASYNC_MODE_TYPE:
|
|
160
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
161
|
-
case REACT_FRAGMENT_TYPE:
|
|
162
|
-
case REACT_PROFILER_TYPE:
|
|
163
|
-
case REACT_STRICT_MODE_TYPE:
|
|
164
|
-
case REACT_SUSPENSE_TYPE:
|
|
165
|
-
return type;
|
|
166
|
-
default:
|
|
167
|
-
var $$typeofType = type && type.$$typeof;
|
|
168
|
-
switch ($$typeofType) {
|
|
169
|
-
case REACT_CONTEXT_TYPE:
|
|
170
|
-
case REACT_FORWARD_REF_TYPE:
|
|
171
|
-
case REACT_LAZY_TYPE:
|
|
172
|
-
case REACT_MEMO_TYPE:
|
|
173
|
-
case REACT_PROVIDER_TYPE:
|
|
174
|
-
return $$typeofType;
|
|
175
|
-
default:
|
|
176
|
-
return $$typeof;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
case REACT_PORTAL_TYPE:
|
|
180
|
-
return $$typeof;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return void 0;
|
|
184
|
-
}
|
|
185
|
-
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
186
|
-
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
187
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
188
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
189
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
190
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
191
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
192
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
193
|
-
var Memo = REACT_MEMO_TYPE;
|
|
194
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
195
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
196
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
197
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
198
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
199
|
-
function isAsyncMode(object) {
|
|
200
|
-
{
|
|
201
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
202
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
203
|
-
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
207
|
-
}
|
|
208
|
-
function isConcurrentMode(object) {
|
|
209
|
-
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
210
|
-
}
|
|
211
|
-
function isContextConsumer(object) {
|
|
212
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
213
|
-
}
|
|
214
|
-
function isContextProvider(object) {
|
|
215
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
216
|
-
}
|
|
217
|
-
function isElement(object) {
|
|
218
|
-
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
219
|
-
}
|
|
220
|
-
function isForwardRef(object) {
|
|
221
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
222
|
-
}
|
|
223
|
-
function isFragment(object) {
|
|
224
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
225
|
-
}
|
|
226
|
-
function isLazy(object) {
|
|
227
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
228
|
-
}
|
|
229
|
-
function isMemo(object) {
|
|
230
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
231
|
-
}
|
|
232
|
-
function isPortal(object) {
|
|
233
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
234
|
-
}
|
|
235
|
-
function isProfiler(object) {
|
|
236
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
237
|
-
}
|
|
238
|
-
function isStrictMode(object) {
|
|
239
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
240
|
-
}
|
|
241
|
-
function isSuspense(object) {
|
|
242
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
243
|
-
}
|
|
244
|
-
reactIs_development.AsyncMode = AsyncMode;
|
|
245
|
-
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
246
|
-
reactIs_development.ContextConsumer = ContextConsumer;
|
|
247
|
-
reactIs_development.ContextProvider = ContextProvider;
|
|
248
|
-
reactIs_development.Element = Element;
|
|
249
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
250
|
-
reactIs_development.Fragment = Fragment;
|
|
251
|
-
reactIs_development.Lazy = Lazy;
|
|
252
|
-
reactIs_development.Memo = Memo;
|
|
253
|
-
reactIs_development.Portal = Portal;
|
|
254
|
-
reactIs_development.Profiler = Profiler;
|
|
255
|
-
reactIs_development.StrictMode = StrictMode;
|
|
256
|
-
reactIs_development.Suspense = Suspense;
|
|
257
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
258
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
259
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
260
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
261
|
-
reactIs_development.isElement = isElement;
|
|
262
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
263
|
-
reactIs_development.isFragment = isFragment;
|
|
264
|
-
reactIs_development.isLazy = isLazy;
|
|
265
|
-
reactIs_development.isMemo = isMemo;
|
|
266
|
-
reactIs_development.isPortal = isPortal;
|
|
267
|
-
reactIs_development.isProfiler = isProfiler;
|
|
268
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
269
|
-
reactIs_development.isSuspense = isSuspense;
|
|
270
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
271
|
-
reactIs_development.typeOf = typeOf;
|
|
272
|
-
})();
|
|
273
|
-
}
|
|
274
|
-
return reactIs_development;
|
|
275
|
-
}
|
|
276
|
-
var hasRequiredReactIs;
|
|
277
|
-
function requireReactIs() {
|
|
278
|
-
if (hasRequiredReactIs) return reactIs.exports;
|
|
279
|
-
hasRequiredReactIs = 1;
|
|
280
|
-
if (process.env.NODE_ENV === "production") {
|
|
281
|
-
reactIs.exports = requireReactIs_production_min();
|
|
282
|
-
} else {
|
|
283
|
-
reactIs.exports = requireReactIs_development();
|
|
284
|
-
}
|
|
285
|
-
return reactIs.exports;
|
|
286
|
-
}
|
|
287
|
-
/*
|
|
288
|
-
object-assign
|
|
289
|
-
(c) Sindre Sorhus
|
|
290
|
-
@license MIT
|
|
291
|
-
*/
|
|
292
|
-
var objectAssign;
|
|
293
|
-
var hasRequiredObjectAssign;
|
|
294
|
-
function requireObjectAssign() {
|
|
295
|
-
if (hasRequiredObjectAssign) return objectAssign;
|
|
296
|
-
hasRequiredObjectAssign = 1;
|
|
297
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
298
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
299
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
300
|
-
function toObject(val) {
|
|
301
|
-
if (val === null || val === void 0) {
|
|
302
|
-
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
303
|
-
}
|
|
304
|
-
return Object(val);
|
|
305
|
-
}
|
|
306
|
-
function shouldUseNative() {
|
|
307
|
-
try {
|
|
308
|
-
if (!Object.assign) {
|
|
309
|
-
return false;
|
|
310
|
-
}
|
|
311
|
-
var test1 = new String("abc");
|
|
312
|
-
test1[5] = "de";
|
|
313
|
-
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
314
|
-
return false;
|
|
315
|
-
}
|
|
316
|
-
var test2 = {};
|
|
317
|
-
for (var i = 0; i < 10; i++) {
|
|
318
|
-
test2["_" + String.fromCharCode(i)] = i;
|
|
319
|
-
}
|
|
320
|
-
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
|
|
321
|
-
return test2[n];
|
|
322
|
-
});
|
|
323
|
-
if (order2.join("") !== "0123456789") {
|
|
324
|
-
return false;
|
|
325
|
-
}
|
|
326
|
-
var test3 = {};
|
|
327
|
-
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
328
|
-
test3[letter] = letter;
|
|
329
|
-
});
|
|
330
|
-
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
331
|
-
return false;
|
|
332
|
-
}
|
|
333
|
-
return true;
|
|
334
|
-
} catch (err) {
|
|
335
|
-
return false;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
objectAssign = shouldUseNative() ? Object.assign : function(target, source) {
|
|
339
|
-
var from;
|
|
340
|
-
var to = toObject(target);
|
|
341
|
-
var symbols;
|
|
342
|
-
for (var s = 1; s < arguments.length; s++) {
|
|
343
|
-
from = Object(arguments[s]);
|
|
344
|
-
for (var key in from) {
|
|
345
|
-
if (hasOwnProperty.call(from, key)) {
|
|
346
|
-
to[key] = from[key];
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
if (getOwnPropertySymbols) {
|
|
350
|
-
symbols = getOwnPropertySymbols(from);
|
|
351
|
-
for (var i = 0; i < symbols.length; i++) {
|
|
352
|
-
if (propIsEnumerable.call(from, symbols[i])) {
|
|
353
|
-
to[symbols[i]] = from[symbols[i]];
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
return to;
|
|
359
|
-
};
|
|
360
|
-
return objectAssign;
|
|
361
|
-
}
|
|
362
|
-
var ReactPropTypesSecret_1;
|
|
363
|
-
var hasRequiredReactPropTypesSecret;
|
|
364
|
-
function requireReactPropTypesSecret() {
|
|
365
|
-
if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
|
|
366
|
-
hasRequiredReactPropTypesSecret = 1;
|
|
367
|
-
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
368
|
-
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
369
|
-
return ReactPropTypesSecret_1;
|
|
370
|
-
}
|
|
371
|
-
var has;
|
|
372
|
-
var hasRequiredHas;
|
|
373
|
-
function requireHas() {
|
|
374
|
-
if (hasRequiredHas) return has;
|
|
375
|
-
hasRequiredHas = 1;
|
|
376
|
-
has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
377
|
-
return has;
|
|
378
|
-
}
|
|
379
|
-
var checkPropTypes_1;
|
|
380
|
-
var hasRequiredCheckPropTypes;
|
|
381
|
-
function requireCheckPropTypes() {
|
|
382
|
-
if (hasRequiredCheckPropTypes) return checkPropTypes_1;
|
|
383
|
-
hasRequiredCheckPropTypes = 1;
|
|
384
|
-
var printWarning = function() {
|
|
385
|
-
};
|
|
386
|
-
if (process.env.NODE_ENV !== "production") {
|
|
387
|
-
var ReactPropTypesSecret = /* @__PURE__ */ requireReactPropTypesSecret();
|
|
388
|
-
var loggedTypeFailures = {};
|
|
389
|
-
var has2 = /* @__PURE__ */ requireHas();
|
|
390
|
-
printWarning = function(text) {
|
|
391
|
-
var message = "Warning: " + text;
|
|
392
|
-
if (typeof console !== "undefined") {
|
|
393
|
-
console.error(message);
|
|
394
|
-
}
|
|
395
|
-
try {
|
|
396
|
-
throw new Error(message);
|
|
397
|
-
} catch (x) {
|
|
398
|
-
}
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
402
|
-
if (process.env.NODE_ENV !== "production") {
|
|
403
|
-
for (var typeSpecName in typeSpecs) {
|
|
404
|
-
if (has2(typeSpecs, typeSpecName)) {
|
|
405
|
-
var error;
|
|
406
|
-
try {
|
|
407
|
-
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
408
|
-
var err = Error(
|
|
409
|
-
(componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
410
|
-
);
|
|
411
|
-
err.name = "Invariant Violation";
|
|
412
|
-
throw err;
|
|
413
|
-
}
|
|
414
|
-
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
415
|
-
} catch (ex) {
|
|
416
|
-
error = ex;
|
|
417
|
-
}
|
|
418
|
-
if (error && !(error instanceof Error)) {
|
|
419
|
-
printWarning(
|
|
420
|
-
(componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
421
|
-
);
|
|
422
|
-
}
|
|
423
|
-
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
424
|
-
loggedTypeFailures[error.message] = true;
|
|
425
|
-
var stack = getStack ? getStack() : "";
|
|
426
|
-
printWarning(
|
|
427
|
-
"Failed " + location + " type: " + error.message + (stack != null ? stack : "")
|
|
428
|
-
);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
checkPropTypes.resetWarningCache = function() {
|
|
435
|
-
if (process.env.NODE_ENV !== "production") {
|
|
436
|
-
loggedTypeFailures = {};
|
|
437
|
-
}
|
|
438
|
-
};
|
|
439
|
-
checkPropTypes_1 = checkPropTypes;
|
|
440
|
-
return checkPropTypes_1;
|
|
441
|
-
}
|
|
442
|
-
var factoryWithTypeCheckers;
|
|
443
|
-
var hasRequiredFactoryWithTypeCheckers;
|
|
444
|
-
function requireFactoryWithTypeCheckers() {
|
|
445
|
-
if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
|
|
446
|
-
hasRequiredFactoryWithTypeCheckers = 1;
|
|
447
|
-
var ReactIs = requireReactIs();
|
|
448
|
-
var assign = requireObjectAssign();
|
|
449
|
-
var ReactPropTypesSecret = /* @__PURE__ */ requireReactPropTypesSecret();
|
|
450
|
-
var has2 = /* @__PURE__ */ requireHas();
|
|
451
|
-
var checkPropTypes = /* @__PURE__ */ requireCheckPropTypes();
|
|
452
|
-
var printWarning = function() {
|
|
453
|
-
};
|
|
454
|
-
if (process.env.NODE_ENV !== "production") {
|
|
455
|
-
printWarning = function(text) {
|
|
456
|
-
var message = "Warning: " + text;
|
|
457
|
-
if (typeof console !== "undefined") {
|
|
458
|
-
console.error(message);
|
|
459
|
-
}
|
|
460
|
-
try {
|
|
461
|
-
throw new Error(message);
|
|
462
|
-
} catch (x) {
|
|
463
|
-
}
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
function emptyFunctionThatReturnsNull() {
|
|
467
|
-
return null;
|
|
468
|
-
}
|
|
469
|
-
factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
470
|
-
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
471
|
-
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
472
|
-
function getIteratorFn(maybeIterable) {
|
|
473
|
-
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
474
|
-
if (typeof iteratorFn === "function") {
|
|
475
|
-
return iteratorFn;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
var ANONYMOUS = "<<anonymous>>";
|
|
479
|
-
var ReactPropTypes = {
|
|
480
|
-
array: createPrimitiveTypeChecker("array"),
|
|
481
|
-
bigint: createPrimitiveTypeChecker("bigint"),
|
|
482
|
-
bool: createPrimitiveTypeChecker("boolean"),
|
|
483
|
-
func: createPrimitiveTypeChecker("function"),
|
|
484
|
-
number: createPrimitiveTypeChecker("number"),
|
|
485
|
-
object: createPrimitiveTypeChecker("object"),
|
|
486
|
-
string: createPrimitiveTypeChecker("string"),
|
|
487
|
-
symbol: createPrimitiveTypeChecker("symbol"),
|
|
488
|
-
any: createAnyTypeChecker(),
|
|
489
|
-
arrayOf: createArrayOfTypeChecker,
|
|
490
|
-
element: createElementTypeChecker(),
|
|
491
|
-
elementType: createElementTypeTypeChecker(),
|
|
492
|
-
instanceOf: createInstanceTypeChecker,
|
|
493
|
-
node: createNodeChecker(),
|
|
494
|
-
objectOf: createObjectOfTypeChecker,
|
|
495
|
-
oneOf: createEnumTypeChecker,
|
|
496
|
-
oneOfType: createUnionTypeChecker,
|
|
497
|
-
shape: createShapeTypeChecker,
|
|
498
|
-
exact: createStrictShapeTypeChecker
|
|
499
|
-
};
|
|
500
|
-
function is(x, y) {
|
|
501
|
-
if (x === y) {
|
|
502
|
-
return x !== 0 || 1 / x === 1 / y;
|
|
503
|
-
} else {
|
|
504
|
-
return x !== x && y !== y;
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
function PropTypeError(message, data) {
|
|
508
|
-
this.message = message;
|
|
509
|
-
this.data = data && typeof data === "object" ? data : {};
|
|
510
|
-
this.stack = "";
|
|
511
|
-
}
|
|
512
|
-
PropTypeError.prototype = Error.prototype;
|
|
513
|
-
function createChainableTypeChecker(validate) {
|
|
514
|
-
if (process.env.NODE_ENV !== "production") {
|
|
515
|
-
var manualPropTypeCallCache = {};
|
|
516
|
-
var manualPropTypeWarningCount = 0;
|
|
517
|
-
}
|
|
518
|
-
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
519
|
-
componentName = componentName || ANONYMOUS;
|
|
520
|
-
propFullName = propFullName || propName;
|
|
521
|
-
if (secret !== ReactPropTypesSecret) {
|
|
522
|
-
if (throwOnDirectAccess) {
|
|
523
|
-
var err = new Error(
|
|
524
|
-
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
525
|
-
);
|
|
526
|
-
err.name = "Invariant Violation";
|
|
527
|
-
throw err;
|
|
528
|
-
} else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
|
|
529
|
-
var cacheKey = componentName + ":" + propName;
|
|
530
|
-
if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
531
|
-
manualPropTypeWarningCount < 3) {
|
|
532
|
-
printWarning(
|
|
533
|
-
"You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
534
|
-
);
|
|
535
|
-
manualPropTypeCallCache[cacheKey] = true;
|
|
536
|
-
manualPropTypeWarningCount++;
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
if (props[propName] == null) {
|
|
541
|
-
if (isRequired) {
|
|
542
|
-
if (props[propName] === null) {
|
|
543
|
-
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
|
|
544
|
-
}
|
|
545
|
-
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
|
|
546
|
-
}
|
|
547
|
-
return null;
|
|
548
|
-
} else {
|
|
549
|
-
return validate(props, propName, componentName, location, propFullName);
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
var chainedCheckType = checkType.bind(null, false);
|
|
553
|
-
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
554
|
-
return chainedCheckType;
|
|
555
|
-
}
|
|
556
|
-
function createPrimitiveTypeChecker(expectedType) {
|
|
557
|
-
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
558
|
-
var propValue = props[propName];
|
|
559
|
-
var propType = getPropType(propValue);
|
|
560
|
-
if (propType !== expectedType) {
|
|
561
|
-
var preciseType = getPreciseType(propValue);
|
|
562
|
-
return new PropTypeError(
|
|
563
|
-
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
|
|
564
|
-
{ expectedType }
|
|
565
|
-
);
|
|
566
|
-
}
|
|
567
|
-
return null;
|
|
568
|
-
}
|
|
569
|
-
return createChainableTypeChecker(validate);
|
|
570
|
-
}
|
|
571
|
-
function createAnyTypeChecker() {
|
|
572
|
-
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
573
|
-
}
|
|
574
|
-
function createArrayOfTypeChecker(typeChecker) {
|
|
575
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
576
|
-
if (typeof typeChecker !== "function") {
|
|
577
|
-
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
|
578
|
-
}
|
|
579
|
-
var propValue = props[propName];
|
|
580
|
-
if (!Array.isArray(propValue)) {
|
|
581
|
-
var propType = getPropType(propValue);
|
|
582
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
|
|
583
|
-
}
|
|
584
|
-
for (var i = 0; i < propValue.length; i++) {
|
|
585
|
-
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
|
|
586
|
-
if (error instanceof Error) {
|
|
587
|
-
return error;
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
return null;
|
|
591
|
-
}
|
|
592
|
-
return createChainableTypeChecker(validate);
|
|
593
|
-
}
|
|
594
|
-
function createElementTypeChecker() {
|
|
595
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
596
|
-
var propValue = props[propName];
|
|
597
|
-
if (!isValidElement(propValue)) {
|
|
598
|
-
var propType = getPropType(propValue);
|
|
599
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
600
|
-
}
|
|
601
|
-
return null;
|
|
602
|
-
}
|
|
603
|
-
return createChainableTypeChecker(validate);
|
|
604
|
-
}
|
|
605
|
-
function createElementTypeTypeChecker() {
|
|
606
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
607
|
-
var propValue = props[propName];
|
|
608
|
-
if (!ReactIs.isValidElementType(propValue)) {
|
|
609
|
-
var propType = getPropType(propValue);
|
|
610
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
|
|
611
|
-
}
|
|
612
|
-
return null;
|
|
613
|
-
}
|
|
614
|
-
return createChainableTypeChecker(validate);
|
|
615
|
-
}
|
|
616
|
-
function createInstanceTypeChecker(expectedClass) {
|
|
617
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
618
|
-
if (!(props[propName] instanceof expectedClass)) {
|
|
619
|
-
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
620
|
-
var actualClassName = getClassName(props[propName]);
|
|
621
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
622
|
-
}
|
|
623
|
-
return null;
|
|
624
|
-
}
|
|
625
|
-
return createChainableTypeChecker(validate);
|
|
626
|
-
}
|
|
627
|
-
function createEnumTypeChecker(expectedValues) {
|
|
628
|
-
if (!Array.isArray(expectedValues)) {
|
|
629
|
-
if (process.env.NODE_ENV !== "production") {
|
|
630
|
-
if (arguments.length > 1) {
|
|
631
|
-
printWarning(
|
|
632
|
-
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
633
|
-
);
|
|
634
|
-
} else {
|
|
635
|
-
printWarning("Invalid argument supplied to oneOf, expected an array.");
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
return emptyFunctionThatReturnsNull;
|
|
639
|
-
}
|
|
640
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
641
|
-
var propValue = props[propName];
|
|
642
|
-
for (var i = 0; i < expectedValues.length; i++) {
|
|
643
|
-
if (is(propValue, expectedValues[i])) {
|
|
644
|
-
return null;
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
648
|
-
var type = getPreciseType(value);
|
|
649
|
-
if (type === "symbol") {
|
|
650
|
-
return String(value);
|
|
651
|
-
}
|
|
652
|
-
return value;
|
|
653
|
-
});
|
|
654
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
|
655
|
-
}
|
|
656
|
-
return createChainableTypeChecker(validate);
|
|
657
|
-
}
|
|
658
|
-
function createObjectOfTypeChecker(typeChecker) {
|
|
659
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
660
|
-
if (typeof typeChecker !== "function") {
|
|
661
|
-
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
|
662
|
-
}
|
|
663
|
-
var propValue = props[propName];
|
|
664
|
-
var propType = getPropType(propValue);
|
|
665
|
-
if (propType !== "object") {
|
|
666
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
|
|
667
|
-
}
|
|
668
|
-
for (var key in propValue) {
|
|
669
|
-
if (has2(propValue, key)) {
|
|
670
|
-
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
671
|
-
if (error instanceof Error) {
|
|
672
|
-
return error;
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
return null;
|
|
677
|
-
}
|
|
678
|
-
return createChainableTypeChecker(validate);
|
|
679
|
-
}
|
|
680
|
-
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
681
|
-
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
682
|
-
process.env.NODE_ENV !== "production" ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
|
|
683
|
-
return emptyFunctionThatReturnsNull;
|
|
684
|
-
}
|
|
685
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
686
|
-
var checker = arrayOfTypeCheckers[i];
|
|
687
|
-
if (typeof checker !== "function") {
|
|
688
|
-
printWarning(
|
|
689
|
-
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
|
|
690
|
-
);
|
|
691
|
-
return emptyFunctionThatReturnsNull;
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
695
|
-
var expectedTypes = [];
|
|
696
|
-
for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
|
|
697
|
-
var checker2 = arrayOfTypeCheckers[i2];
|
|
698
|
-
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
699
|
-
if (checkerResult == null) {
|
|
700
|
-
return null;
|
|
701
|
-
}
|
|
702
|
-
if (checkerResult.data && has2(checkerResult.data, "expectedType")) {
|
|
703
|
-
expectedTypes.push(checkerResult.data.expectedType);
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
|
707
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
|
708
|
-
}
|
|
709
|
-
return createChainableTypeChecker(validate);
|
|
710
|
-
}
|
|
711
|
-
function createNodeChecker() {
|
|
712
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
713
|
-
if (!isNode(props[propName])) {
|
|
714
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
|
715
|
-
}
|
|
716
|
-
return null;
|
|
717
|
-
}
|
|
718
|
-
return createChainableTypeChecker(validate);
|
|
719
|
-
}
|
|
720
|
-
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
721
|
-
return new PropTypeError(
|
|
722
|
-
(componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
|
|
723
|
-
);
|
|
724
|
-
}
|
|
725
|
-
function createShapeTypeChecker(shapeTypes) {
|
|
726
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
727
|
-
var propValue = props[propName];
|
|
728
|
-
var propType = getPropType(propValue);
|
|
729
|
-
if (propType !== "object") {
|
|
730
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
731
|
-
}
|
|
732
|
-
for (var key in shapeTypes) {
|
|
733
|
-
var checker = shapeTypes[key];
|
|
734
|
-
if (typeof checker !== "function") {
|
|
735
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
736
|
-
}
|
|
737
|
-
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
738
|
-
if (error) {
|
|
739
|
-
return error;
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
return null;
|
|
743
|
-
}
|
|
744
|
-
return createChainableTypeChecker(validate);
|
|
745
|
-
}
|
|
746
|
-
function createStrictShapeTypeChecker(shapeTypes) {
|
|
747
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
748
|
-
var propValue = props[propName];
|
|
749
|
-
var propType = getPropType(propValue);
|
|
750
|
-
if (propType !== "object") {
|
|
751
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
752
|
-
}
|
|
753
|
-
var allKeys = assign({}, props[propName], shapeTypes);
|
|
754
|
-
for (var key in allKeys) {
|
|
755
|
-
var checker = shapeTypes[key];
|
|
756
|
-
if (has2(shapeTypes, key) && typeof checker !== "function") {
|
|
757
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
758
|
-
}
|
|
759
|
-
if (!checker) {
|
|
760
|
-
return new PropTypeError(
|
|
761
|
-
"Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
|
|
762
|
-
);
|
|
763
|
-
}
|
|
764
|
-
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
765
|
-
if (error) {
|
|
766
|
-
return error;
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
return null;
|
|
770
|
-
}
|
|
771
|
-
return createChainableTypeChecker(validate);
|
|
772
|
-
}
|
|
773
|
-
function isNode(propValue) {
|
|
774
|
-
switch (typeof propValue) {
|
|
775
|
-
case "number":
|
|
776
|
-
case "string":
|
|
777
|
-
case "undefined":
|
|
778
|
-
return true;
|
|
779
|
-
case "boolean":
|
|
780
|
-
return !propValue;
|
|
781
|
-
case "object":
|
|
782
|
-
if (Array.isArray(propValue)) {
|
|
783
|
-
return propValue.every(isNode);
|
|
784
|
-
}
|
|
785
|
-
if (propValue === null || isValidElement(propValue)) {
|
|
786
|
-
return true;
|
|
787
|
-
}
|
|
788
|
-
var iteratorFn = getIteratorFn(propValue);
|
|
789
|
-
if (iteratorFn) {
|
|
790
|
-
var iterator = iteratorFn.call(propValue);
|
|
791
|
-
var step;
|
|
792
|
-
if (iteratorFn !== propValue.entries) {
|
|
793
|
-
while (!(step = iterator.next()).done) {
|
|
794
|
-
if (!isNode(step.value)) {
|
|
795
|
-
return false;
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
} else {
|
|
799
|
-
while (!(step = iterator.next()).done) {
|
|
800
|
-
var entry = step.value;
|
|
801
|
-
if (entry) {
|
|
802
|
-
if (!isNode(entry[1])) {
|
|
803
|
-
return false;
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
} else {
|
|
809
|
-
return false;
|
|
810
|
-
}
|
|
811
|
-
return true;
|
|
812
|
-
default:
|
|
813
|
-
return false;
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
function isSymbol(propType, propValue) {
|
|
817
|
-
if (propType === "symbol") {
|
|
818
|
-
return true;
|
|
819
|
-
}
|
|
820
|
-
if (!propValue) {
|
|
821
|
-
return false;
|
|
822
|
-
}
|
|
823
|
-
if (propValue["@@toStringTag"] === "Symbol") {
|
|
824
|
-
return true;
|
|
825
|
-
}
|
|
826
|
-
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
|
827
|
-
return true;
|
|
828
|
-
}
|
|
829
|
-
return false;
|
|
830
|
-
}
|
|
831
|
-
function getPropType(propValue) {
|
|
832
|
-
var propType = typeof propValue;
|
|
833
|
-
if (Array.isArray(propValue)) {
|
|
834
|
-
return "array";
|
|
835
|
-
}
|
|
836
|
-
if (propValue instanceof RegExp) {
|
|
837
|
-
return "object";
|
|
838
|
-
}
|
|
839
|
-
if (isSymbol(propType, propValue)) {
|
|
840
|
-
return "symbol";
|
|
841
|
-
}
|
|
842
|
-
return propType;
|
|
843
|
-
}
|
|
844
|
-
function getPreciseType(propValue) {
|
|
845
|
-
if (typeof propValue === "undefined" || propValue === null) {
|
|
846
|
-
return "" + propValue;
|
|
847
|
-
}
|
|
848
|
-
var propType = getPropType(propValue);
|
|
849
|
-
if (propType === "object") {
|
|
850
|
-
if (propValue instanceof Date) {
|
|
851
|
-
return "date";
|
|
852
|
-
} else if (propValue instanceof RegExp) {
|
|
853
|
-
return "regexp";
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
return propType;
|
|
857
|
-
}
|
|
858
|
-
function getPostfixForTypeWarning(value) {
|
|
859
|
-
var type = getPreciseType(value);
|
|
860
|
-
switch (type) {
|
|
861
|
-
case "array":
|
|
862
|
-
case "object":
|
|
863
|
-
return "an " + type;
|
|
864
|
-
case "boolean":
|
|
865
|
-
case "date":
|
|
866
|
-
case "regexp":
|
|
867
|
-
return "a " + type;
|
|
868
|
-
default:
|
|
869
|
-
return type;
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
function getClassName(propValue) {
|
|
873
|
-
if (!propValue.constructor || !propValue.constructor.name) {
|
|
874
|
-
return ANONYMOUS;
|
|
875
|
-
}
|
|
876
|
-
return propValue.constructor.name;
|
|
877
|
-
}
|
|
878
|
-
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
879
|
-
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
880
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
881
|
-
return ReactPropTypes;
|
|
882
|
-
};
|
|
883
|
-
return factoryWithTypeCheckers;
|
|
884
|
-
}
|
|
885
|
-
var factoryWithThrowingShims;
|
|
886
|
-
var hasRequiredFactoryWithThrowingShims;
|
|
887
|
-
function requireFactoryWithThrowingShims() {
|
|
888
|
-
if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
|
|
889
|
-
hasRequiredFactoryWithThrowingShims = 1;
|
|
890
|
-
var ReactPropTypesSecret = /* @__PURE__ */ requireReactPropTypesSecret();
|
|
891
|
-
function emptyFunction() {
|
|
892
|
-
}
|
|
893
|
-
function emptyFunctionWithReset() {
|
|
894
|
-
}
|
|
895
|
-
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
896
|
-
factoryWithThrowingShims = function() {
|
|
897
|
-
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
898
|
-
if (secret === ReactPropTypesSecret) {
|
|
899
|
-
return;
|
|
900
|
-
}
|
|
901
|
-
var err = new Error(
|
|
902
|
-
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
903
|
-
);
|
|
904
|
-
err.name = "Invariant Violation";
|
|
905
|
-
throw err;
|
|
906
|
-
}
|
|
907
|
-
shim.isRequired = shim;
|
|
908
|
-
function getShim() {
|
|
909
|
-
return shim;
|
|
910
|
-
}
|
|
911
|
-
var ReactPropTypes = {
|
|
912
|
-
array: shim,
|
|
913
|
-
bigint: shim,
|
|
914
|
-
bool: shim,
|
|
915
|
-
func: shim,
|
|
916
|
-
number: shim,
|
|
917
|
-
object: shim,
|
|
918
|
-
string: shim,
|
|
919
|
-
symbol: shim,
|
|
920
|
-
any: shim,
|
|
921
|
-
arrayOf: getShim,
|
|
922
|
-
element: shim,
|
|
923
|
-
elementType: shim,
|
|
924
|
-
instanceOf: getShim,
|
|
925
|
-
node: shim,
|
|
926
|
-
objectOf: getShim,
|
|
927
|
-
oneOf: getShim,
|
|
928
|
-
oneOfType: getShim,
|
|
929
|
-
shape: getShim,
|
|
930
|
-
exact: getShim,
|
|
931
|
-
checkPropTypes: emptyFunctionWithReset,
|
|
932
|
-
resetWarningCache: emptyFunction
|
|
933
|
-
};
|
|
934
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
935
|
-
return ReactPropTypes;
|
|
936
|
-
};
|
|
937
|
-
return factoryWithThrowingShims;
|
|
938
|
-
}
|
|
939
|
-
var hasRequiredPropTypes;
|
|
940
|
-
function requirePropTypes() {
|
|
941
|
-
if (hasRequiredPropTypes) return propTypes.exports;
|
|
942
|
-
hasRequiredPropTypes = 1;
|
|
943
|
-
if (process.env.NODE_ENV !== "production") {
|
|
944
|
-
var ReactIs = requireReactIs();
|
|
945
|
-
var throwOnDirectAccess = true;
|
|
946
|
-
propTypes.exports = /* @__PURE__ */ requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
947
|
-
} else {
|
|
948
|
-
propTypes.exports = /* @__PURE__ */ requireFactoryWithThrowingShims()();
|
|
949
|
-
}
|
|
950
|
-
return propTypes.exports;
|
|
951
|
-
}
|
|
952
|
-
var propTypesExports = /* @__PURE__ */ requirePropTypes();
|
|
953
|
-
const PropTypes = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
|
|
954
|
-
function useForceUpdate() {
|
|
955
|
-
var _useState = react.useState(/* @__PURE__ */ Object.create(null)), dispatch = _useState[1];
|
|
956
|
-
return react.useCallback(function() {
|
|
957
|
-
dispatch(/* @__PURE__ */ Object.create(null));
|
|
958
|
-
}, []);
|
|
959
|
-
}
|
|
960
|
-
function canUseDOM() {
|
|
961
|
-
return !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
962
|
-
}
|
|
963
|
-
var useIsomorphicLayoutEffect = /* @__PURE__ */ canUseDOM() ? react.useLayoutEffect : react.useEffect;
|
|
964
|
-
function usePrevious(value) {
|
|
965
|
-
var ref = react.useRef(null);
|
|
966
|
-
react.useEffect(function() {
|
|
967
|
-
ref.current = value;
|
|
968
|
-
}, [value]);
|
|
969
|
-
return ref.current;
|
|
970
|
-
}
|
|
971
|
-
function createNamedContext(name, defaultValue) {
|
|
972
|
-
var Ctx = /* @__PURE__ */ react.createContext(defaultValue);
|
|
973
|
-
if (process.env.NODE_ENV !== "production") {
|
|
974
|
-
Ctx.displayName = name;
|
|
975
|
-
}
|
|
976
|
-
return Ctx;
|
|
977
|
-
}
|
|
978
|
-
function noop() {
|
|
979
|
-
}
|
|
980
|
-
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
981
|
-
if (source == null) return {};
|
|
982
|
-
var target = {};
|
|
983
|
-
var sourceKeys = Object.keys(source);
|
|
984
|
-
var key, i;
|
|
985
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
986
|
-
key = sourceKeys[i];
|
|
987
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
988
|
-
target[key] = source[key];
|
|
989
|
-
}
|
|
990
|
-
return target;
|
|
991
|
-
}
|
|
992
|
-
function _extends$1() {
|
|
993
|
-
_extends$1 = Object.assign || function(target) {
|
|
994
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
995
|
-
var source = arguments[i];
|
|
996
|
-
for (var key in source) {
|
|
997
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
998
|
-
target[key] = source[key];
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
return target;
|
|
1003
|
-
};
|
|
1004
|
-
return _extends$1.apply(this, arguments);
|
|
1005
|
-
}
|
|
1006
|
-
var _excluded$1 = ["element", "index"];
|
|
1007
|
-
function createDescendantContext(name, initialValue) {
|
|
1008
|
-
if (initialValue === void 0) {
|
|
1009
|
-
initialValue = {};
|
|
1010
|
-
}
|
|
1011
|
-
var descendants = [];
|
|
1012
|
-
return createNamedContext(name, _extends$1({
|
|
1013
|
-
descendants,
|
|
1014
|
-
registerDescendant: noop,
|
|
1015
|
-
unregisterDescendant: noop
|
|
1016
|
-
}, initialValue));
|
|
1017
|
-
}
|
|
1018
|
-
function useDescendant(descendant, context, indexProp) {
|
|
1019
|
-
var forceUpdate = useForceUpdate();
|
|
1020
|
-
var _React$useContext = react.useContext(context), registerDescendant = _React$useContext.registerDescendant, unregisterDescendant = _React$useContext.unregisterDescendant, descendants = _React$useContext.descendants;
|
|
1021
|
-
var index = indexProp != null ? indexProp : descendants.findIndex(function(item) {
|
|
1022
|
-
return item.element === descendant.element;
|
|
1023
|
-
});
|
|
1024
|
-
var previousDescendants = usePrevious(descendants);
|
|
1025
|
-
var someDescendantsHaveChanged = descendants.some(function(descendant2, index2) {
|
|
1026
|
-
var _previousDescendants$;
|
|
1027
|
-
return descendant2.element !== (previousDescendants == null ? void 0 : (_previousDescendants$ = previousDescendants[index2]) == null ? void 0 : _previousDescendants$.element);
|
|
1028
|
-
});
|
|
1029
|
-
useIsomorphicLayoutEffect(function() {
|
|
1030
|
-
if (!descendant.element) forceUpdate();
|
|
1031
|
-
registerDescendant(_extends$1({}, descendant, {
|
|
1032
|
-
index
|
|
1033
|
-
}));
|
|
1034
|
-
return function() {
|
|
1035
|
-
return unregisterDescendant(descendant.element);
|
|
1036
|
-
};
|
|
1037
|
-
}, [forceUpdate, index, registerDescendant, someDescendantsHaveChanged, unregisterDescendant].concat(Object.values(descendant)));
|
|
1038
|
-
return index;
|
|
1039
|
-
}
|
|
1040
|
-
function useDescendantsInit() {
|
|
1041
|
-
return react.useState([]);
|
|
1042
|
-
}
|
|
1043
|
-
function useDescendants(ctx) {
|
|
1044
|
-
return react.useContext(ctx).descendants;
|
|
1045
|
-
}
|
|
1046
|
-
function DescendantProvider(_ref) {
|
|
1047
|
-
var Ctx = _ref.context, children = _ref.children, items = _ref.items, set = _ref.set;
|
|
1048
|
-
var registerDescendant = react.useCallback(
|
|
1049
|
-
function(_ref2) {
|
|
1050
|
-
var element = _ref2.element, explicitIndex = _ref2.index, rest = _objectWithoutPropertiesLoose$1(_ref2, _excluded$1);
|
|
1051
|
-
if (!element) {
|
|
1052
|
-
return;
|
|
1053
|
-
}
|
|
1054
|
-
set(function(items2) {
|
|
1055
|
-
var newItems;
|
|
1056
|
-
if (explicitIndex != null) {
|
|
1057
|
-
newItems = [].concat(items2, [_extends$1({}, rest, {
|
|
1058
|
-
element,
|
|
1059
|
-
index: explicitIndex
|
|
1060
|
-
})]);
|
|
1061
|
-
} else if (items2.length === 0) {
|
|
1062
|
-
newItems = [].concat(items2, [_extends$1({}, rest, {
|
|
1063
|
-
element,
|
|
1064
|
-
index: 0
|
|
1065
|
-
})]);
|
|
1066
|
-
} else if (items2.find(function(item) {
|
|
1067
|
-
return item.element === element;
|
|
1068
|
-
})) {
|
|
1069
|
-
newItems = items2;
|
|
1070
|
-
} else {
|
|
1071
|
-
var index = items2.findIndex(function(item) {
|
|
1072
|
-
if (!item.element || !element) {
|
|
1073
|
-
return false;
|
|
1074
|
-
}
|
|
1075
|
-
return Boolean(item.element.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_PRECEDING);
|
|
1076
|
-
});
|
|
1077
|
-
var newItem = _extends$1({}, rest, {
|
|
1078
|
-
element,
|
|
1079
|
-
index
|
|
1080
|
-
});
|
|
1081
|
-
if (index === -1) {
|
|
1082
|
-
newItems = [].concat(items2, [newItem]);
|
|
1083
|
-
} else {
|
|
1084
|
-
newItems = [].concat(items2.slice(0, index), [newItem], items2.slice(index));
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1087
|
-
return newItems.map(function(item, index2) {
|
|
1088
|
-
return _extends$1({}, item, {
|
|
1089
|
-
index: index2
|
|
1090
|
-
});
|
|
1091
|
-
});
|
|
1092
|
-
});
|
|
1093
|
-
},
|
|
1094
|
-
// set is a state setter initialized by the useDescendantsInit hook.
|
|
1095
|
-
// We can safely ignore the lint warning here because it will not change
|
|
1096
|
-
// between renders.
|
|
1097
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1098
|
-
[]
|
|
1099
|
-
);
|
|
1100
|
-
var unregisterDescendant = react.useCallback(
|
|
1101
|
-
function(element) {
|
|
1102
|
-
if (!element) {
|
|
1103
|
-
return;
|
|
1104
|
-
}
|
|
1105
|
-
set(function(items2) {
|
|
1106
|
-
return items2.filter(function(item) {
|
|
1107
|
-
return element !== item.element;
|
|
1108
|
-
});
|
|
1109
|
-
});
|
|
1110
|
-
},
|
|
1111
|
-
// set is a state setter initialized by the useDescendantsInit hook.
|
|
1112
|
-
// We can safely ignore the lint warning here because it will not change
|
|
1113
|
-
// between renders.
|
|
1114
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1115
|
-
[]
|
|
1116
|
-
);
|
|
1117
|
-
return /* @__PURE__ */ react.createElement(Ctx.Provider, {
|
|
1118
|
-
value: react.useMemo(function() {
|
|
1119
|
-
return {
|
|
1120
|
-
descendants: items,
|
|
1121
|
-
registerDescendant,
|
|
1122
|
-
unregisterDescendant
|
|
1123
|
-
};
|
|
1124
|
-
}, [items, registerDescendant, unregisterDescendant])
|
|
1125
|
-
}, children);
|
|
1126
|
-
}
|
|
1127
|
-
function useDescendantKeyDown(context, options) {
|
|
1128
|
-
var _React$useContext2 = react.useContext(context), descendants = _React$useContext2.descendants;
|
|
1129
|
-
var callback = options.callback, currentIndex = options.currentIndex, filter = options.filter, _options$key = options.key, key = _options$key === void 0 ? "index" : _options$key, _options$orientation = options.orientation, orientation = _options$orientation === void 0 ? "vertical" : _options$orientation, _options$rtl = options.rtl, rtl = _options$rtl === void 0 ? false : _options$rtl;
|
|
1130
|
-
return function handleKeyDown(event) {
|
|
1131
|
-
if (!["ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Home", "End"].includes(event.key)) {
|
|
1132
|
-
return;
|
|
1133
|
-
}
|
|
1134
|
-
var index = currentIndex != null ? currentIndex : -1;
|
|
1135
|
-
var selectableDescendants = filter ? descendants.filter(filter) : descendants;
|
|
1136
|
-
if (filter) {
|
|
1137
|
-
index = selectableDescendants.findIndex(function(descendant) {
|
|
1138
|
-
return descendant.index === currentIndex;
|
|
1139
|
-
});
|
|
1140
|
-
}
|
|
1141
|
-
if (!selectableDescendants.length) {
|
|
1142
|
-
return;
|
|
1143
|
-
}
|
|
1144
|
-
function getNextOption() {
|
|
1145
|
-
var atBottom = index === selectableDescendants.length - 1;
|
|
1146
|
-
return atBottom ? getFirstOption() : selectableDescendants[(index + 1) % selectableDescendants.length];
|
|
1147
|
-
}
|
|
1148
|
-
function getPreviousOption() {
|
|
1149
|
-
var atTop = index === 0;
|
|
1150
|
-
return atTop ? getLastOption() : selectableDescendants[(index - 1 + selectableDescendants.length) % selectableDescendants.length];
|
|
1151
|
-
}
|
|
1152
|
-
function getFirstOption() {
|
|
1153
|
-
return selectableDescendants[0];
|
|
1154
|
-
}
|
|
1155
|
-
function getLastOption() {
|
|
1156
|
-
return selectableDescendants[selectableDescendants.length - 1];
|
|
1157
|
-
}
|
|
1158
|
-
switch (event.key) {
|
|
1159
|
-
case "ArrowDown":
|
|
1160
|
-
if (orientation === "vertical" || orientation === "both") {
|
|
1161
|
-
event.preventDefault();
|
|
1162
|
-
var next = getNextOption();
|
|
1163
|
-
callback(key === "option" ? next : next[key]);
|
|
1164
|
-
}
|
|
1165
|
-
break;
|
|
1166
|
-
case "ArrowUp":
|
|
1167
|
-
if (orientation === "vertical" || orientation === "both") {
|
|
1168
|
-
event.preventDefault();
|
|
1169
|
-
var prev = getPreviousOption();
|
|
1170
|
-
callback(key === "option" ? prev : prev[key]);
|
|
1171
|
-
}
|
|
1172
|
-
break;
|
|
1173
|
-
case "ArrowLeft":
|
|
1174
|
-
if (orientation === "horizontal" || orientation === "both") {
|
|
1175
|
-
event.preventDefault();
|
|
1176
|
-
var nextOrPrev = (rtl ? getNextOption : getPreviousOption)();
|
|
1177
|
-
callback(key === "option" ? nextOrPrev : nextOrPrev[key]);
|
|
1178
|
-
}
|
|
1179
|
-
break;
|
|
1180
|
-
case "ArrowRight":
|
|
1181
|
-
if (orientation === "horizontal" || orientation === "both") {
|
|
1182
|
-
event.preventDefault();
|
|
1183
|
-
var prevOrNext = (rtl ? getPreviousOption : getNextOption)();
|
|
1184
|
-
callback(key === "option" ? prevOrNext : prevOrNext[key]);
|
|
1185
|
-
}
|
|
1186
|
-
break;
|
|
1187
|
-
case "PageUp":
|
|
1188
|
-
event.preventDefault();
|
|
1189
|
-
var prevOrFirst = (event.ctrlKey ? getPreviousOption : getFirstOption)();
|
|
1190
|
-
callback(key === "option" ? prevOrFirst : prevOrFirst[key]);
|
|
1191
|
-
break;
|
|
1192
|
-
case "Home":
|
|
1193
|
-
event.preventDefault();
|
|
1194
|
-
var first = getFirstOption();
|
|
1195
|
-
callback(key === "option" ? first : first[key]);
|
|
1196
|
-
break;
|
|
1197
|
-
case "PageDown":
|
|
1198
|
-
event.preventDefault();
|
|
1199
|
-
var nextOrLast = (event.ctrlKey ? getNextOption : getLastOption)();
|
|
1200
|
-
callback(key === "option" ? nextOrLast : nextOrLast[key]);
|
|
1201
|
-
break;
|
|
1202
|
-
case "End":
|
|
1203
|
-
event.preventDefault();
|
|
1204
|
-
var last = getLastOption();
|
|
1205
|
-
callback(key === "option" ? last : last[key]);
|
|
1206
|
-
break;
|
|
1207
|
-
}
|
|
1208
|
-
};
|
|
1209
|
-
}
|
|
1210
|
-
function getOwnerDocument(element) {
|
|
1211
|
-
return canUseDOM() ? element ? element.ownerDocument : document : null;
|
|
1212
|
-
}
|
|
1213
|
-
function getOwnerWindow(element) {
|
|
1214
|
-
var ownerDocument = getOwnerDocument(element);
|
|
1215
|
-
return ownerDocument ? ownerDocument.defaultView || window : null;
|
|
1216
|
-
}
|
|
1217
|
-
function getComputedStyles(element) {
|
|
1218
|
-
var ownerWindow = getOwnerWindow(element);
|
|
1219
|
-
if (ownerWindow) {
|
|
1220
|
-
return ownerWindow.getComputedStyle(element, null);
|
|
1221
|
-
}
|
|
1222
|
-
return null;
|
|
1223
|
-
}
|
|
1224
|
-
function getComputedStyle(element, styleProp) {
|
|
1225
|
-
var _getComputedStyles;
|
|
1226
|
-
return ((_getComputedStyles = getComputedStyles(element)) == null ? void 0 : _getComputedStyles.getPropertyValue(styleProp)) || null;
|
|
1227
|
-
}
|
|
1228
|
-
function cloneValidElement(element, props) {
|
|
1229
|
-
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
1230
|
-
children[_key - 2] = arguments[_key];
|
|
1231
|
-
}
|
|
1232
|
-
return /* @__PURE__ */ react.isValidElement(element) ? react.cloneElement.apply(void 0, [element, props].concat(children)) : element;
|
|
1233
|
-
}
|
|
1234
|
-
function useControlledState(controlledValue, defaultValue) {
|
|
1235
|
-
var controlledRef = react.useRef(controlledValue != null);
|
|
1236
|
-
var _useState = react.useState(defaultValue), valueState = _useState[0], setValue = _useState[1];
|
|
1237
|
-
var set = react.useCallback(function(n) {
|
|
1238
|
-
if (!controlledRef.current) {
|
|
1239
|
-
setValue(n);
|
|
1240
|
-
}
|
|
1241
|
-
}, []);
|
|
1242
|
-
return [controlledRef.current ? controlledValue : valueState, set];
|
|
1243
|
-
}
|
|
1244
|
-
function isBoolean(value) {
|
|
1245
|
-
return typeof value === "boolean";
|
|
1246
|
-
}
|
|
1247
|
-
function isFunction(value) {
|
|
1248
|
-
return !!(value && {}.toString.call(value) == "[object Function]");
|
|
1249
|
-
}
|
|
1250
|
-
function isNumber(value) {
|
|
1251
|
-
return typeof value === "number" && !isNaN(value);
|
|
1252
|
-
}
|
|
1253
|
-
function makeId() {
|
|
1254
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1255
|
-
args[_key] = arguments[_key];
|
|
1256
|
-
}
|
|
1257
|
-
return args.filter(function(val) {
|
|
1258
|
-
return val != null;
|
|
1259
|
-
}).join("--");
|
|
1260
|
-
}
|
|
1261
|
-
var checkedPkgs = {};
|
|
1262
|
-
function checkStyles(packageName) {
|
|
1263
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1264
|
-
var _ref = typeof process !== "undefined" ? process.env : {
|
|
1265
|
-
NODE_ENV: "development"
|
|
1266
|
-
}, environment = _ref.NODE_ENV;
|
|
1267
|
-
if (checkedPkgs[packageName]) return;
|
|
1268
|
-
checkedPkgs[packageName] = true;
|
|
1269
|
-
if (environment === "development" && parseInt(window.getComputedStyle(document.body).getPropertyValue("--reach-" + packageName), 10) !== 1) {
|
|
1270
|
-
console.warn("@reach/" + packageName + ' styles not found. If you are using a bundler like webpack or parcel include this in the entry file of your app before any of your own styles:\n \n import "@reach/' + packageName + `/styles.css";
|
|
1271
|
-
|
|
1272
|
-
Otherwise you'll need to include them some other way:
|
|
1273
|
-
|
|
1274
|
-
<link rel="stylesheet" type="text/css" href="node_modules/@reach/` + packageName + '/styles.css" />\n \n For more information visit https://ui.reach.tech/styling.\n ');
|
|
1275
|
-
}
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
function useCheckStyles(packageName) {
|
|
1279
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1280
|
-
var name = react.useRef(packageName);
|
|
1281
|
-
react.useEffect(function() {
|
|
1282
|
-
return void (name.current = packageName);
|
|
1283
|
-
}, [packageName]);
|
|
1284
|
-
react.useEffect(function() {
|
|
1285
|
-
return checkStyles(name.current);
|
|
1286
|
-
}, []);
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
function useControlledSwitchWarning(controlledValue, controlledPropName, componentName) {
|
|
1290
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1291
|
-
var controlledRef = react.useRef(controlledValue != null);
|
|
1292
|
-
var nameCache = react.useRef({
|
|
1293
|
-
componentName,
|
|
1294
|
-
controlledPropName
|
|
1295
|
-
});
|
|
1296
|
-
react.useEffect(function() {
|
|
1297
|
-
nameCache.current = {
|
|
1298
|
-
componentName,
|
|
1299
|
-
controlledPropName
|
|
1300
|
-
};
|
|
1301
|
-
}, [componentName, controlledPropName]);
|
|
1302
|
-
react.useEffect(function() {
|
|
1303
|
-
var wasControlled = controlledRef.current;
|
|
1304
|
-
var _nameCache$current = nameCache.current, componentName2 = _nameCache$current.componentName, controlledPropName2 = _nameCache$current.controlledPropName;
|
|
1305
|
-
var isControlled = controlledValue != null;
|
|
1306
|
-
if (wasControlled !== isControlled) {
|
|
1307
|
-
console.error("A component is changing an " + (wasControlled ? "" : "un") + "controlled `" + controlledPropName2 + "` state of " + componentName2 + " to be " + (wasControlled ? "un" : "") + "controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled " + componentName2 + " element for the lifetime of the component.\n More info: https://fb.me/react-controlled-components");
|
|
1308
|
-
}
|
|
1309
|
-
}, [controlledValue]);
|
|
1310
|
-
}
|
|
1311
|
-
}
|
|
1312
|
-
function _arrayLikeToArray(arr, len) {
|
|
1313
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
1314
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
1315
|
-
return arr2;
|
|
1316
|
-
}
|
|
1317
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
1318
|
-
if (!o) return;
|
|
1319
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
1320
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1321
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1322
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
1323
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
1324
|
-
}
|
|
1325
|
-
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
1326
|
-
var it;
|
|
1327
|
-
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
|
|
1328
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) {
|
|
1329
|
-
if (it) o = it;
|
|
1330
|
-
var i = 0;
|
|
1331
|
-
return function() {
|
|
1332
|
-
if (i >= o.length) return {
|
|
1333
|
-
done: true
|
|
1334
|
-
};
|
|
1335
|
-
return {
|
|
1336
|
-
done: false,
|
|
1337
|
-
value: o[i++]
|
|
1338
|
-
};
|
|
1339
|
-
};
|
|
1340
|
-
}
|
|
1341
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1342
|
-
}
|
|
1343
|
-
it = o[Symbol.iterator]();
|
|
1344
|
-
return it.next.bind(it);
|
|
1345
|
-
}
|
|
1346
|
-
function assignRef(ref, value) {
|
|
1347
|
-
if (ref == null) return;
|
|
1348
|
-
if (isFunction(ref)) {
|
|
1349
|
-
ref(value);
|
|
1350
|
-
} else {
|
|
1351
|
-
try {
|
|
1352
|
-
ref.current = value;
|
|
1353
|
-
} catch (error) {
|
|
1354
|
-
throw new Error('Cannot assign value "' + value + '" to ref "' + ref + '"');
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
}
|
|
1358
|
-
function useComposedRefs() {
|
|
1359
|
-
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1360
|
-
refs[_key] = arguments[_key];
|
|
1361
|
-
}
|
|
1362
|
-
return react.useCallback(function(node) {
|
|
1363
|
-
for (var _iterator = _createForOfIteratorHelperLoose(refs), _step; !(_step = _iterator()).done; ) {
|
|
1364
|
-
var ref = _step.value;
|
|
1365
|
-
assignRef(ref, node);
|
|
1366
|
-
}
|
|
1367
|
-
}, refs);
|
|
1368
|
-
}
|
|
1369
|
-
function useUpdateEffect(effect, deps) {
|
|
1370
|
-
var mounted = react.useRef(false);
|
|
1371
|
-
react.useEffect(function() {
|
|
1372
|
-
if (mounted.current) {
|
|
1373
|
-
effect();
|
|
1374
|
-
} else {
|
|
1375
|
-
mounted.current = true;
|
|
1376
|
-
}
|
|
1377
|
-
}, deps);
|
|
1378
|
-
}
|
|
1379
|
-
function composeEventHandlers(theirHandler, ourHandler) {
|
|
1380
|
-
return function(event) {
|
|
1381
|
-
theirHandler && theirHandler(event);
|
|
1382
|
-
if (!event.defaultPrevented) {
|
|
1383
|
-
return ourHandler(event);
|
|
1384
|
-
}
|
|
1385
|
-
};
|
|
1386
|
-
}
|
|
1387
|
-
var serverHandoffComplete = false;
|
|
1388
|
-
var id = 0;
|
|
1389
|
-
var genId = function genId2() {
|
|
1390
|
-
return ++id;
|
|
1391
|
-
};
|
|
1392
|
-
function useId(idFromProps) {
|
|
1393
|
-
var initialId = idFromProps || (serverHandoffComplete ? genId() : null);
|
|
1394
|
-
var _React$useState = react.useState(initialId), id2 = _React$useState[0], setId = _React$useState[1];
|
|
1395
|
-
useIsomorphicLayoutEffect(function() {
|
|
1396
|
-
if (id2 === null) {
|
|
1397
|
-
setId(genId());
|
|
1398
|
-
}
|
|
1399
|
-
}, []);
|
|
1400
|
-
react.useEffect(function() {
|
|
1401
|
-
if (serverHandoffComplete === false) {
|
|
1402
|
-
serverHandoffComplete = true;
|
|
1403
|
-
}
|
|
1404
|
-
}, []);
|
|
1405
|
-
return id2 != null ? String(id2) : void 0;
|
|
1406
|
-
}
|
|
1407
|
-
function _extends() {
|
|
1408
|
-
_extends = Object.assign || function(target) {
|
|
1409
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
1410
|
-
var source = arguments[i];
|
|
1411
|
-
for (var key in source) {
|
|
1412
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1413
|
-
target[key] = source[key];
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
return target;
|
|
1418
|
-
};
|
|
1419
|
-
return _extends.apply(this, arguments);
|
|
1420
|
-
}
|
|
1421
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1422
|
-
if (source == null) return {};
|
|
1423
|
-
var target = {};
|
|
1424
|
-
var sourceKeys = Object.keys(source);
|
|
1425
|
-
var key, i;
|
|
1426
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
1427
|
-
key = sourceKeys[i];
|
|
1428
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
1429
|
-
target[key] = source[key];
|
|
1430
|
-
}
|
|
1431
|
-
return target;
|
|
1432
|
-
}
|
|
1433
|
-
var _excluded = ["as", "children", "defaultIndex", "orientation", "index", "keyboardActivation", "onChange", "readOnly"], _excluded2 = ["children", "as", "onKeyDown"], _excluded3 = ["isSelected", "children", "as", "index", "disabled", "onBlur", "onFocus"], _excluded4 = ["children", "as"], _excluded5 = ["children", "aria-label", "as"];
|
|
1434
|
-
var TabsDescendantsContext = /* @__PURE__ */ createDescendantContext("TabsDescendantsContext");
|
|
1435
|
-
var TabPanelDescendantsContext = /* @__PURE__ */ createDescendantContext("TabPanelDescendantsContext");
|
|
1436
|
-
var TabsContext = /* @__PURE__ */ createNamedContext("TabsContext", {});
|
|
1437
|
-
var TabsKeyboardActivation;
|
|
1438
|
-
(function(TabsKeyboardActivation2) {
|
|
1439
|
-
TabsKeyboardActivation2["Auto"] = "auto";
|
|
1440
|
-
TabsKeyboardActivation2["Manual"] = "manual";
|
|
1441
|
-
})(TabsKeyboardActivation || (TabsKeyboardActivation = {}));
|
|
1442
|
-
var TabsOrientation;
|
|
1443
|
-
(function(TabsOrientation2) {
|
|
1444
|
-
TabsOrientation2["Horizontal"] = "horizontal";
|
|
1445
|
-
TabsOrientation2["Vertical"] = "vertical";
|
|
1446
|
-
})(TabsOrientation || (TabsOrientation = {}));
|
|
1447
|
-
var Tabs$1 = /* @__PURE__ */ react.forwardRef(function Tabs(_ref, ref) {
|
|
1448
|
-
var _props$id;
|
|
1449
|
-
var _ref$as = _ref.as, Comp = _ref$as === void 0 ? "div" : _ref$as, children = _ref.children, defaultIndex = _ref.defaultIndex, _ref$orientation = _ref.orientation, orientation = _ref$orientation === void 0 ? TabsOrientation.Horizontal : _ref$orientation, _ref$index = _ref.index, controlledIndex = _ref$index === void 0 ? void 0 : _ref$index, _ref$keyboardActivati = _ref.keyboardActivation, keyboardActivation = _ref$keyboardActivati === void 0 ? TabsKeyboardActivation.Auto : _ref$keyboardActivati, onChange = _ref.onChange, _ref$readOnly = _ref.readOnly, readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly, props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
1450
|
-
var isControlled = react.useRef(controlledIndex != null);
|
|
1451
|
-
useControlledSwitchWarning(controlledIndex, "index", "Tabs");
|
|
1452
|
-
var _id = useId(props.id);
|
|
1453
|
-
var id2 = (_props$id = props.id) != null ? _props$id : makeId("tabs", _id);
|
|
1454
|
-
var userInteractedRef = react.useRef(false);
|
|
1455
|
-
var selectedPanelRef = react.useRef(null);
|
|
1456
|
-
var isRTL = react.useRef(false);
|
|
1457
|
-
var _useControlledState = useControlledState(controlledIndex, defaultIndex != null ? defaultIndex : 0), selectedIndex = _useControlledState[0], setSelectedIndex = _useControlledState[1];
|
|
1458
|
-
var _React$useState = react.useState(-1), focusedIndex = _React$useState[0], setFocusedIndex = _React$useState[1];
|
|
1459
|
-
var _useDescendantsInit = useDescendantsInit(), tabs = _useDescendantsInit[0], setTabs = _useDescendantsInit[1];
|
|
1460
|
-
var context = react.useMemo(function() {
|
|
1461
|
-
return {
|
|
1462
|
-
focusedIndex,
|
|
1463
|
-
id: id2,
|
|
1464
|
-
isControlled: isControlled.current,
|
|
1465
|
-
isRTL,
|
|
1466
|
-
keyboardActivation,
|
|
1467
|
-
onFocusPanel: function onFocusPanel() {
|
|
1468
|
-
if (selectedPanelRef.current && isFunction(selectedPanelRef.current.focus)) {
|
|
1469
|
-
selectedPanelRef.current.focus();
|
|
1470
|
-
}
|
|
1471
|
-
},
|
|
1472
|
-
onSelectTab: readOnly ? noop : function(index) {
|
|
1473
|
-
userInteractedRef.current = true;
|
|
1474
|
-
onChange && onChange(index);
|
|
1475
|
-
setSelectedIndex(index);
|
|
1476
|
-
},
|
|
1477
|
-
onSelectTabWithKeyboard: readOnly ? noop : function(index) {
|
|
1478
|
-
userInteractedRef.current = true;
|
|
1479
|
-
switch (keyboardActivation) {
|
|
1480
|
-
case TabsKeyboardActivation.Manual:
|
|
1481
|
-
var tabElement = tabs[index] && tabs[index].element;
|
|
1482
|
-
if (tabElement && isFunction(tabElement.focus)) {
|
|
1483
|
-
tabElement.focus();
|
|
1484
|
-
}
|
|
1485
|
-
return;
|
|
1486
|
-
case TabsKeyboardActivation.Auto:
|
|
1487
|
-
default:
|
|
1488
|
-
onChange && onChange(index);
|
|
1489
|
-
setSelectedIndex(index);
|
|
1490
|
-
return;
|
|
1491
|
-
}
|
|
1492
|
-
},
|
|
1493
|
-
orientation,
|
|
1494
|
-
selectedIndex,
|
|
1495
|
-
selectedPanelRef,
|
|
1496
|
-
setFocusedIndex,
|
|
1497
|
-
setSelectedIndex,
|
|
1498
|
-
userInteractedRef
|
|
1499
|
-
};
|
|
1500
|
-
}, [focusedIndex, id2, keyboardActivation, onChange, orientation, readOnly, selectedIndex, setSelectedIndex, tabs]);
|
|
1501
|
-
useCheckStyles("tabs");
|
|
1502
|
-
return /* @__PURE__ */ react.createElement(DescendantProvider, {
|
|
1503
|
-
context: TabsDescendantsContext,
|
|
1504
|
-
items: tabs,
|
|
1505
|
-
set: setTabs
|
|
1506
|
-
}, /* @__PURE__ */ react.createElement(TabsContext.Provider, {
|
|
1507
|
-
value: context
|
|
1508
|
-
}, /* @__PURE__ */ react.createElement(Comp, _extends({}, props, {
|
|
1509
|
-
ref,
|
|
1510
|
-
"data-reach-tabs": "",
|
|
1511
|
-
"data-orientation": orientation,
|
|
1512
|
-
id: props.id
|
|
1513
|
-
}), isFunction(children) ? children({
|
|
1514
|
-
focusedIndex,
|
|
1515
|
-
id: id2,
|
|
1516
|
-
selectedIndex
|
|
1517
|
-
}) : children)));
|
|
1518
|
-
});
|
|
1519
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1520
|
-
Tabs$1.displayName = "Tabs";
|
|
1521
|
-
Tabs$1.propTypes = {
|
|
1522
|
-
children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,
|
|
1523
|
-
onChange: PropTypes.func,
|
|
1524
|
-
orientation: /* @__PURE__ */ PropTypes.oneOf(/* @__PURE__ */ Object.values(TabsOrientation)),
|
|
1525
|
-
index: function index(props, name, compName, location, propName) {
|
|
1526
|
-
var val = props[name];
|
|
1527
|
-
if (props.index > -1 && props.onChange == null && props.readOnly !== true) {
|
|
1528
|
-
return new Error("You provided a value prop to `" + compName + "` without an `onChange` handler. This will render a read-only tabs element. If the tabs should be mutable use `defaultIndex`. Otherwise, set `onChange`.");
|
|
1529
|
-
} else if (val != null && !isNumber(val)) {
|
|
1530
|
-
return new Error("Invalid prop `" + propName + "` supplied to `" + compName + "`. Expected `number`, received `" + (Array.isArray(val) ? "array" : typeof val) + "`.");
|
|
1531
|
-
}
|
|
1532
|
-
return null;
|
|
1533
|
-
},
|
|
1534
|
-
defaultIndex: PropTypes.number
|
|
1535
|
-
};
|
|
1536
|
-
}
|
|
1537
|
-
var TabListImpl = /* @__PURE__ */ react.forwardRef(function TabList(_ref2, forwardedRef) {
|
|
1538
|
-
var children = _ref2.children, _ref2$as = _ref2.as, Comp = _ref2$as === void 0 ? "div" : _ref2$as, onKeyDown = _ref2.onKeyDown, props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
1539
|
-
var _React$useContext = react.useContext(TabsContext), focusedIndex = _React$useContext.focusedIndex, isControlled = _React$useContext.isControlled, isRTL = _React$useContext.isRTL, keyboardActivation = _React$useContext.keyboardActivation, onSelectTabWithKeyboard = _React$useContext.onSelectTabWithKeyboard, orientation = _React$useContext.orientation, selectedIndex = _React$useContext.selectedIndex, setSelectedIndex = _React$useContext.setSelectedIndex;
|
|
1540
|
-
var tabs = useDescendants(TabsDescendantsContext);
|
|
1541
|
-
var ownRef = react.useRef(null);
|
|
1542
|
-
var ref = useComposedRefs(forwardedRef, ownRef);
|
|
1543
|
-
react.useEffect(function() {
|
|
1544
|
-
if (ownRef.current && (ownRef.current.ownerDocument && ownRef.current.ownerDocument.dir === "rtl" || getComputedStyle(ownRef.current, "direction") === "rtl")) {
|
|
1545
|
-
isRTL.current = true;
|
|
1546
|
-
}
|
|
1547
|
-
}, [isRTL]);
|
|
1548
|
-
var handleKeyDown = composeEventHandlers(onKeyDown, useDescendantKeyDown(TabsDescendantsContext, {
|
|
1549
|
-
currentIndex: keyboardActivation === TabsKeyboardActivation.Manual ? focusedIndex : selectedIndex,
|
|
1550
|
-
orientation,
|
|
1551
|
-
callback: onSelectTabWithKeyboard,
|
|
1552
|
-
filter: function filter(tab) {
|
|
1553
|
-
return !tab.disabled;
|
|
1554
|
-
},
|
|
1555
|
-
rtl: isRTL.current
|
|
1556
|
-
}));
|
|
1557
|
-
useIsomorphicLayoutEffect(function() {
|
|
1558
|
-
var _tabs$selectedIndex;
|
|
1559
|
-
if (!isControlled && boolOrBoolString((_tabs$selectedIndex = tabs[selectedIndex]) == null ? void 0 : _tabs$selectedIndex.disabled)) {
|
|
1560
|
-
var next = tabs.find(function(tab) {
|
|
1561
|
-
return !tab.disabled;
|
|
1562
|
-
});
|
|
1563
|
-
if (next) {
|
|
1564
|
-
setSelectedIndex(next.index);
|
|
1565
|
-
}
|
|
1566
|
-
}
|
|
1567
|
-
}, [tabs, isControlled, selectedIndex, setSelectedIndex]);
|
|
1568
|
-
return /* @__PURE__ */ react.createElement(
|
|
1569
|
-
Comp,
|
|
1570
|
-
_extends({
|
|
1571
|
-
role: "tablist",
|
|
1572
|
-
"aria-orientation": orientation
|
|
1573
|
-
}, props, {
|
|
1574
|
-
"data-reach-tab-list": "",
|
|
1575
|
-
ref,
|
|
1576
|
-
onKeyDown: handleKeyDown
|
|
1577
|
-
}),
|
|
1578
|
-
react.Children.map(children, function(child, index) {
|
|
1579
|
-
return cloneValidElement(child, {
|
|
1580
|
-
isSelected: index === selectedIndex
|
|
1581
|
-
});
|
|
1582
|
-
})
|
|
1583
|
-
);
|
|
1584
|
-
});
|
|
1585
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1586
|
-
TabListImpl.displayName = "TabList";
|
|
1587
|
-
TabListImpl.propTypes = {
|
|
1588
|
-
as: PropTypes.any,
|
|
1589
|
-
children: PropTypes.node
|
|
1590
|
-
};
|
|
1591
|
-
}
|
|
1592
|
-
var TabList$1 = /* @__PURE__ */ react.memo(TabListImpl);
|
|
1593
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1594
|
-
TabList$1.displayName = "TabList";
|
|
1595
|
-
}
|
|
1596
|
-
var Tab$1 = /* @__PURE__ */ react.forwardRef(function Tab(_ref3, forwardedRef) {
|
|
1597
|
-
_ref3.isSelected;
|
|
1598
|
-
var children = _ref3.children, _ref3$as = _ref3.as, Comp = _ref3$as === void 0 ? "button" : _ref3$as, indexProp = _ref3.index, disabled = _ref3.disabled, onBlur = _ref3.onBlur, onFocus = _ref3.onFocus, props = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
1599
|
-
var _React$useContext2 = react.useContext(TabsContext), tabsId = _React$useContext2.id, onSelectTab = _React$useContext2.onSelectTab, orientation = _React$useContext2.orientation, selectedIndex = _React$useContext2.selectedIndex, userInteractedRef = _React$useContext2.userInteractedRef, setFocusedIndex = _React$useContext2.setFocusedIndex;
|
|
1600
|
-
var ownRef = react.useRef(null);
|
|
1601
|
-
var ref = useComposedRefs(forwardedRef, ownRef);
|
|
1602
|
-
var index = useDescendant({
|
|
1603
|
-
element: ownRef.current,
|
|
1604
|
-
disabled: !!disabled
|
|
1605
|
-
}, TabsDescendantsContext, indexProp);
|
|
1606
|
-
var htmlType = Comp === "button" && props.type == null ? "button" : props.type;
|
|
1607
|
-
var isSelected = index === selectedIndex;
|
|
1608
|
-
function onSelect() {
|
|
1609
|
-
onSelectTab(index);
|
|
1610
|
-
}
|
|
1611
|
-
useUpdateEffect(function() {
|
|
1612
|
-
if (isSelected && ownRef.current && userInteractedRef.current) {
|
|
1613
|
-
userInteractedRef.current = false;
|
|
1614
|
-
if (isFunction(ownRef.current.focus)) {
|
|
1615
|
-
ownRef.current.focus();
|
|
1616
|
-
}
|
|
1617
|
-
}
|
|
1618
|
-
}, [isSelected, userInteractedRef]);
|
|
1619
|
-
return /* @__PURE__ */ react.createElement(
|
|
1620
|
-
Comp,
|
|
1621
|
-
_extends({
|
|
1622
|
-
"aria-controls": makeId(tabsId, "panel", index),
|
|
1623
|
-
"aria-disabled": disabled,
|
|
1624
|
-
"aria-selected": isSelected,
|
|
1625
|
-
role: "tab",
|
|
1626
|
-
tabIndex: isSelected ? 0 : -1
|
|
1627
|
-
}, props, {
|
|
1628
|
-
ref,
|
|
1629
|
-
"data-reach-tab": "",
|
|
1630
|
-
"data-orientation": orientation,
|
|
1631
|
-
"data-selected": isSelected ? "" : void 0,
|
|
1632
|
-
disabled,
|
|
1633
|
-
id: makeId(tabsId, "tab", index),
|
|
1634
|
-
onClick: onSelect,
|
|
1635
|
-
onFocus: composeEventHandlers(onFocus, function() {
|
|
1636
|
-
setFocusedIndex(index);
|
|
1637
|
-
}),
|
|
1638
|
-
onBlur: composeEventHandlers(onBlur, function() {
|
|
1639
|
-
setFocusedIndex(-1);
|
|
1640
|
-
}),
|
|
1641
|
-
type: htmlType
|
|
1642
|
-
}),
|
|
1643
|
-
children
|
|
1644
|
-
);
|
|
1645
|
-
});
|
|
1646
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1647
|
-
Tab$1.displayName = "Tab";
|
|
1648
|
-
Tab$1.propTypes = {
|
|
1649
|
-
children: PropTypes.node,
|
|
1650
|
-
disabled: PropTypes.bool
|
|
1651
|
-
};
|
|
1652
|
-
}
|
|
1653
|
-
var TabPanelsImpl = /* @__PURE__ */ react.forwardRef(function TabPanels(_ref4, forwardedRef) {
|
|
1654
|
-
var children = _ref4.children, _ref4$as = _ref4.as, Comp = _ref4$as === void 0 ? "div" : _ref4$as, props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
|
|
1655
|
-
var ownRef = react.useRef();
|
|
1656
|
-
var ref = useComposedRefs(ownRef, forwardedRef);
|
|
1657
|
-
var _useDescendantsInit2 = useDescendantsInit(), tabPanels = _useDescendantsInit2[0], setTabPanels = _useDescendantsInit2[1];
|
|
1658
|
-
return /* @__PURE__ */ react.createElement(DescendantProvider, {
|
|
1659
|
-
context: TabPanelDescendantsContext,
|
|
1660
|
-
items: tabPanels,
|
|
1661
|
-
set: setTabPanels
|
|
1662
|
-
}, /* @__PURE__ */ react.createElement(Comp, _extends({}, props, {
|
|
1663
|
-
ref,
|
|
1664
|
-
"data-reach-tab-panels": ""
|
|
1665
|
-
}), children));
|
|
1666
|
-
});
|
|
1667
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1668
|
-
TabPanelsImpl.displayName = "TabPanels";
|
|
1669
|
-
TabPanelsImpl.propTypes = {
|
|
1670
|
-
as: PropTypes.any,
|
|
1671
|
-
children: PropTypes.node
|
|
1672
|
-
};
|
|
1673
|
-
}
|
|
1674
|
-
var TabPanels$1 = /* @__PURE__ */ react.memo(TabPanelsImpl);
|
|
1675
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1676
|
-
TabPanels$1.displayName = "TabPanels";
|
|
1677
|
-
}
|
|
1678
|
-
var TabPanel$1 = /* @__PURE__ */ react.forwardRef(function TabPanel(_ref5, forwardedRef) {
|
|
1679
|
-
var children = _ref5.children;
|
|
1680
|
-
_ref5["aria-label"];
|
|
1681
|
-
var _ref5$as = _ref5.as, Comp = _ref5$as === void 0 ? "div" : _ref5$as, props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
|
|
1682
|
-
var _React$useContext3 = react.useContext(TabsContext), selectedPanelRef = _React$useContext3.selectedPanelRef, selectedIndex = _React$useContext3.selectedIndex, tabsId = _React$useContext3.id;
|
|
1683
|
-
var ownRef = react.useRef(null);
|
|
1684
|
-
var index = useDescendant({
|
|
1685
|
-
element: ownRef.current
|
|
1686
|
-
}, TabPanelDescendantsContext);
|
|
1687
|
-
var id2 = makeId(tabsId, "panel", index);
|
|
1688
|
-
var isSelected = index === selectedIndex;
|
|
1689
|
-
var readyToHide = react.useRef(false);
|
|
1690
|
-
var hidden = readyToHide.current ? !isSelected : false;
|
|
1691
|
-
react.useEffect(function() {
|
|
1692
|
-
readyToHide.current = true;
|
|
1693
|
-
}, []);
|
|
1694
|
-
var ref = useComposedRefs(forwardedRef, ownRef, isSelected ? selectedPanelRef : null);
|
|
1695
|
-
return /* @__PURE__ */ react.createElement(
|
|
1696
|
-
Comp,
|
|
1697
|
-
_extends({
|
|
1698
|
-
"aria-labelledby": makeId(tabsId, "tab", index),
|
|
1699
|
-
hidden,
|
|
1700
|
-
role: "tabpanel",
|
|
1701
|
-
tabIndex: isSelected ? 0 : -1
|
|
1702
|
-
}, props, {
|
|
1703
|
-
ref,
|
|
1704
|
-
"data-reach-tab-panel": "",
|
|
1705
|
-
id: id2
|
|
1706
|
-
}),
|
|
1707
|
-
children
|
|
1708
|
-
);
|
|
1709
|
-
});
|
|
1710
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1711
|
-
TabPanel$1.displayName = "TabPanel";
|
|
1712
|
-
TabPanel$1.propTypes = {
|
|
1713
|
-
as: PropTypes.any,
|
|
1714
|
-
children: PropTypes.node
|
|
1715
|
-
};
|
|
1716
|
-
}
|
|
1717
|
-
function boolOrBoolString(value) {
|
|
1718
|
-
return value === "true" ? true : isBoolean(value) ? value : false;
|
|
1719
|
-
}
|
|
1720
|
-
var classnames = { exports: {} };
|
|
1721
|
-
/*!
|
|
1722
|
-
Copyright (c) 2018 Jed Watson.
|
|
1723
|
-
Licensed under the MIT License (MIT), see
|
|
1724
|
-
http://jedwatson.github.io/classnames
|
|
1725
|
-
*/
|
|
1726
|
-
var hasRequiredClassnames;
|
|
1727
|
-
function requireClassnames() {
|
|
1728
|
-
if (hasRequiredClassnames) return classnames.exports;
|
|
1729
|
-
hasRequiredClassnames = 1;
|
|
1730
|
-
(function(module2) {
|
|
1731
|
-
(function() {
|
|
1732
|
-
var hasOwn = {}.hasOwnProperty;
|
|
1733
|
-
function classNames2() {
|
|
1734
|
-
var classes = "";
|
|
1735
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
1736
|
-
var arg = arguments[i];
|
|
1737
|
-
if (arg) {
|
|
1738
|
-
classes = appendClass(classes, parseValue(arg));
|
|
1739
|
-
}
|
|
1740
|
-
}
|
|
1741
|
-
return classes;
|
|
1742
|
-
}
|
|
1743
|
-
function parseValue(arg) {
|
|
1744
|
-
if (typeof arg === "string" || typeof arg === "number") {
|
|
1745
|
-
return arg;
|
|
1746
|
-
}
|
|
1747
|
-
if (typeof arg !== "object") {
|
|
1748
|
-
return "";
|
|
1749
|
-
}
|
|
1750
|
-
if (Array.isArray(arg)) {
|
|
1751
|
-
return classNames2.apply(null, arg);
|
|
1752
|
-
}
|
|
1753
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
1754
|
-
return arg.toString();
|
|
1755
|
-
}
|
|
1756
|
-
var classes = "";
|
|
1757
|
-
for (var key in arg) {
|
|
1758
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1759
|
-
classes = appendClass(classes, key);
|
|
1760
|
-
}
|
|
1761
|
-
}
|
|
1762
|
-
return classes;
|
|
1763
|
-
}
|
|
1764
|
-
function appendClass(value, newClass) {
|
|
1765
|
-
if (!newClass) {
|
|
1766
|
-
return value;
|
|
1767
|
-
}
|
|
1768
|
-
if (value) {
|
|
1769
|
-
return value + " " + newClass;
|
|
1770
|
-
}
|
|
1771
|
-
return value + newClass;
|
|
1772
|
-
}
|
|
1773
|
-
if (module2.exports) {
|
|
1774
|
-
classNames2.default = classNames2;
|
|
1775
|
-
module2.exports = classNames2;
|
|
1776
|
-
} else {
|
|
1777
|
-
window.classNames = classNames2;
|
|
1778
|
-
}
|
|
1779
|
-
})();
|
|
1780
|
-
})(classnames);
|
|
1781
|
-
return classnames.exports;
|
|
1782
|
-
}
|
|
1783
|
-
var classnamesExports = requireClassnames();
|
|
1784
|
-
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
1785
|
-
const Tab2 = ({
|
|
5
|
+
const tabs = require("@reach/tabs");
|
|
6
|
+
const classNames = require("classnames");
|
|
7
|
+
const Tab = ({
|
|
1786
8
|
className,
|
|
1787
9
|
removeActiveLine = false,
|
|
1788
10
|
...rest
|
|
1789
11
|
}) => {
|
|
1790
12
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1791
|
-
Tab
|
|
13
|
+
tabs.Tab,
|
|
1792
14
|
{
|
|
1793
15
|
className: classNames(
|
|
1794
16
|
"eds-tab",
|
|
@@ -1799,12 +21,12 @@ const Tab2 = ({
|
|
|
1799
21
|
}
|
|
1800
22
|
);
|
|
1801
23
|
};
|
|
1802
|
-
const
|
|
1803
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tabs
|
|
24
|
+
const Tabs = ({ className, ...rest }) => {
|
|
25
|
+
return /* @__PURE__ */ jsxRuntime.jsx(tabs.Tabs, { className: classNames("eds-tabs", className), ...rest });
|
|
1804
26
|
};
|
|
1805
|
-
const
|
|
27
|
+
const TabPanel = ({ className, ...rest }) => {
|
|
1806
28
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1807
|
-
TabPanel
|
|
29
|
+
tabs.TabPanel,
|
|
1808
30
|
{
|
|
1809
31
|
className: classNames("eds-tab-panel", className),
|
|
1810
32
|
...rest,
|
|
@@ -1812,22 +34,22 @@ const TabPanel2 = ({ className, ...rest }) => {
|
|
|
1812
34
|
}
|
|
1813
35
|
);
|
|
1814
36
|
};
|
|
1815
|
-
const
|
|
37
|
+
const TabPanels = ({ className, ...rest }) => {
|
|
1816
38
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1817
|
-
TabPanels
|
|
39
|
+
tabs.TabPanels,
|
|
1818
40
|
{
|
|
1819
41
|
className: classNames("eds-tab-panels", className),
|
|
1820
42
|
...rest
|
|
1821
43
|
}
|
|
1822
44
|
);
|
|
1823
45
|
};
|
|
1824
|
-
const
|
|
46
|
+
const TabList = ({
|
|
1825
47
|
className,
|
|
1826
48
|
width,
|
|
1827
49
|
...rest
|
|
1828
50
|
}) => {
|
|
1829
51
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1830
|
-
TabList
|
|
52
|
+
tabs.TabList,
|
|
1831
53
|
{
|
|
1832
54
|
className: classNames("eds-tab-list", className, {
|
|
1833
55
|
"eds-tab-list--width-fluid": width === "fluid"
|
|
@@ -1837,9 +59,9 @@ const TabList2 = ({
|
|
|
1837
59
|
);
|
|
1838
60
|
};
|
|
1839
61
|
utils.warnAboutMissingStyles("tab");
|
|
1840
|
-
exports.Tab =
|
|
1841
|
-
exports.TabList =
|
|
1842
|
-
exports.TabPanel =
|
|
1843
|
-
exports.TabPanels =
|
|
1844
|
-
exports.Tabs =
|
|
62
|
+
exports.Tab = Tab;
|
|
63
|
+
exports.TabList = TabList;
|
|
64
|
+
exports.TabPanel = TabPanel;
|
|
65
|
+
exports.TabPanels = TabPanels;
|
|
66
|
+
exports.Tabs = Tabs;
|
|
1845
67
|
//# sourceMappingURL=tab.cjs.js.map
|