@progressiveui/react 1.22.1 → 2.0.1
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/.storybook/WfpTheme.js +1 -1
- package/.storybook/main.ts +10 -7
- package/.storybook/preview.tsx +0 -25
- package/es/dist/components/Accordion/hooks/useAccordionItemEffect.d.ts +1 -1
- package/es/dist/components/Footer/Footer.d.ts +0 -8
- package/es/dist/components/Footer/index.d.ts +2 -2
- package/es/dist/components/Input/useInput.d.ts +2 -0
- package/es/dist/components/MainNavigation/index.d.ts +3 -4
- package/es/dist/hooks/useHeightTransition.d.ts +1 -1
- package/es/dist/index.d.ts +1 -1
- package/es/index.js +231 -1316
- package/lib/dist/components/Accordion/hooks/useAccordionItemEffect.d.ts +1 -1
- package/lib/dist/components/Footer/Footer.d.ts +0 -8
- package/lib/dist/components/Footer/index.d.ts +2 -2
- package/lib/dist/components/Input/useInput.d.ts +2 -0
- package/lib/dist/components/MainNavigation/index.d.ts +3 -4
- package/lib/dist/hooks/useHeightTransition.d.ts +1 -1
- package/lib/dist/index.d.ts +1 -1
- package/lib/index.js +256 -1353
- package/package.json +69 -79
- package/src/components/Accordion/hooks/useAccordion.ts +13 -9
- package/src/components/BannerNavigation/BannerNavigation.stories.tsx +0 -2
- package/src/components/Button/Button.stories.tsx +0 -16
- package/src/components/Button/Button.tsx +14 -11
- package/src/components/ContextMenu/ContextMenu.stories.tsx +0 -2
- package/src/components/Empty/Empty.stories.tsx +1 -2
- package/src/components/Footer/Footer.tsx +2 -42
- package/src/components/Footer/index.ts +2 -2
- package/src/components/Hero/Hero.stories.tsx +0 -2
- package/src/components/MainNavigation/MainNavigation.stories.tsx +1 -4
- package/src/components/MainNavigation/MainNavigation.tsx +1 -23
- package/src/components/MainNavigation/index.ts +3 -4
- package/src/components/Pagination/Pagination.stories.tsx +0 -2
- package/src/components/Search/Search.tsx +1 -1
- package/src/components/Text/Text.tsx +7 -4
- package/src/components/Toggle/Toggle.tsx +4 -4
- package/src/index.ts +0 -1
- package/umd/dist/components/Accordion/hooks/useAccordionItemEffect.d.ts +1 -1
- package/umd/dist/components/Footer/Footer.d.ts +0 -8
- package/umd/dist/components/Footer/index.d.ts +2 -2
- package/umd/dist/components/Input/useInput.d.ts +2 -0
- package/umd/dist/components/MainNavigation/index.d.ts +3 -4
- package/umd/dist/hooks/useHeightTransition.d.ts +1 -1
- package/umd/dist/index.d.ts +1 -1
- package/umd/index.js +231 -1316
- package/umd/index.min.js +1 -1
- package/src/components/MainNavigation/MainNavigationExternal.tsx +0 -338
package/umd/index.js
CHANGED
|
@@ -5,39 +5,12 @@
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import React__default, { createContext, useState, useEffect, useContext, useId, useLayoutEffect, useRef, useMemo, useCallback } from 'react';
|
|
7
7
|
import { useTransitionMap } from 'react-transition-state';
|
|
8
|
-
import { ChevronDown, WarningSolid, Search as Search$1, Close, User as User$1, Home, CalendarAltRegular, ArrowRight,
|
|
8
|
+
import { ChevronDown, WarningSolid, Search as Search$1, Close, User as User$1, Home, CalendarAltRegular, ArrowRight, Twitter, Facebook, Instagram, LinkedIn, YouTube, TikTok, InfoSolid, Cross, Check, Error as Error$1, CheckmarkCircle, InfoCircle, CaretDown, CaretUp, ChevronLeft, ChevronRight, ChevronUp, Ellipsis, WarningOutline, Locked, OverflowMenu, Checkmark, Menu } from '@progressiveui/icons-react';
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import PropTypes, { oneOf } from 'prop-types';
|
|
11
11
|
import ReactDOM from 'react-dom';
|
|
12
12
|
import { usePopperTooltip } from 'react-popper-tooltip';
|
|
13
13
|
|
|
14
|
-
function _iterableToArrayLimit(r, l) {
|
|
15
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
16
|
-
if (null != t) {
|
|
17
|
-
var e,
|
|
18
|
-
n,
|
|
19
|
-
i,
|
|
20
|
-
u,
|
|
21
|
-
a = [],
|
|
22
|
-
f = !0,
|
|
23
|
-
o = !1;
|
|
24
|
-
try {
|
|
25
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
26
|
-
if (Object(t) !== t) return;
|
|
27
|
-
f = !1;
|
|
28
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
29
|
-
} catch (r) {
|
|
30
|
-
o = !0, n = r;
|
|
31
|
-
} finally {
|
|
32
|
-
try {
|
|
33
|
-
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
34
|
-
} finally {
|
|
35
|
-
if (o) throw n;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return a;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
14
|
function _typeof(o) {
|
|
42
15
|
"@babel/helpers - typeof";
|
|
43
16
|
|
|
@@ -47,28 +20,6 @@ function _typeof(o) {
|
|
|
47
20
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
48
21
|
}, _typeof(o);
|
|
49
22
|
}
|
|
50
|
-
function _slicedToArray(arr, i) {
|
|
51
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
52
|
-
}
|
|
53
|
-
function _arrayWithHoles(arr) {
|
|
54
|
-
if (Array.isArray(arr)) return arr;
|
|
55
|
-
}
|
|
56
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
57
|
-
if (!o) return;
|
|
58
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
59
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
60
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
61
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
62
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
63
|
-
}
|
|
64
|
-
function _arrayLikeToArray(arr, len) {
|
|
65
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
66
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
67
|
-
return arr2;
|
|
68
|
-
}
|
|
69
|
-
function _nonIterableRest() {
|
|
70
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
71
|
-
}
|
|
72
23
|
|
|
73
24
|
function __rest(s, e) {
|
|
74
25
|
var t = {};
|
|
@@ -91,1122 +42,220 @@ var hasRequiredReactJsxRuntime_development;
|
|
|
91
42
|
function requireReactJsxRuntime_development() {
|
|
92
43
|
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
93
44
|
hasRequiredReactJsxRuntime_development = 1;
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
113
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
114
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
115
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
116
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
117
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
118
|
-
function getIteratorFn(maybeIterable) {
|
|
119
|
-
if (maybeIterable === null || _typeof(maybeIterable) !== 'object') {
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
123
|
-
if (typeof maybeIterator === 'function') {
|
|
124
|
-
return maybeIterator;
|
|
125
|
-
}
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
129
|
-
function error(format) {
|
|
130
|
-
{
|
|
131
|
-
{
|
|
132
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
133
|
-
args[_key2 - 1] = arguments[_key2];
|
|
134
|
-
}
|
|
135
|
-
printWarning('error', format, args);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
45
|
+
(function () {
|
|
46
|
+
function getComponentNameFromType(type) {
|
|
47
|
+
if (null == type) return null;
|
|
48
|
+
if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
49
|
+
if ("string" === typeof type) return type;
|
|
50
|
+
switch (type) {
|
|
51
|
+
case REACT_FRAGMENT_TYPE:
|
|
52
|
+
return "Fragment";
|
|
53
|
+
case REACT_PROFILER_TYPE:
|
|
54
|
+
return "Profiler";
|
|
55
|
+
case REACT_STRICT_MODE_TYPE:
|
|
56
|
+
return "StrictMode";
|
|
57
|
+
case REACT_SUSPENSE_TYPE:
|
|
58
|
+
return "Suspense";
|
|
59
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
60
|
+
return "SuspenseList";
|
|
61
|
+
case REACT_ACTIVITY_TYPE:
|
|
62
|
+
return "Activity";
|
|
138
63
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
var argsWithFormat = args.map(function (item) {
|
|
151
|
-
return String(item);
|
|
152
|
-
}); // Careful: RN currently depends on this prefix
|
|
153
|
-
|
|
154
|
-
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
155
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
156
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
|
157
|
-
|
|
158
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// -----------------------------------------------------------------------------
|
|
163
|
-
|
|
164
|
-
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
165
|
-
var enableCacheElement = false;
|
|
166
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
167
|
-
|
|
168
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
169
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
170
|
-
// issues in DEV builds.
|
|
171
|
-
|
|
172
|
-
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
173
|
-
|
|
174
|
-
var REACT_MODULE_REFERENCE;
|
|
175
|
-
{
|
|
176
|
-
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
177
|
-
}
|
|
178
|
-
function isValidElementType(type) {
|
|
179
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
180
|
-
return true;
|
|
181
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
182
|
-
|
|
183
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
184
|
-
return true;
|
|
185
|
-
}
|
|
186
|
-
if (_typeof(type) === 'object' && type !== null) {
|
|
187
|
-
if (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 ||
|
|
188
|
-
// This needs to include all possible module reference object
|
|
189
|
-
// types supported by any Flight configuration anywhere since
|
|
190
|
-
// we don't know which Flight build this will end up being used
|
|
191
|
-
// with.
|
|
192
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
return false;
|
|
197
|
-
}
|
|
198
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
199
|
-
var displayName = outerType.displayName;
|
|
200
|
-
if (displayName) {
|
|
201
|
-
return displayName;
|
|
202
|
-
}
|
|
203
|
-
var functionName = innerType.displayName || innerType.name || '';
|
|
204
|
-
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
205
|
-
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
206
|
-
|
|
207
|
-
function getContextName(type) {
|
|
208
|
-
return type.displayName || 'Context';
|
|
209
|
-
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
|
210
|
-
|
|
211
|
-
function getComponentNameFromType(type) {
|
|
212
|
-
if (type == null) {
|
|
213
|
-
// Host root, text node or just invalid type.
|
|
214
|
-
return null;
|
|
215
|
-
}
|
|
216
|
-
{
|
|
217
|
-
if (typeof type.tag === 'number') {
|
|
218
|
-
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
if (typeof type === 'function') {
|
|
222
|
-
return type.displayName || type.name || null;
|
|
223
|
-
}
|
|
224
|
-
if (typeof type === 'string') {
|
|
64
|
+
if ("object" === _typeof(type)) switch ("number" === typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
|
|
65
|
+
case REACT_PORTAL_TYPE:
|
|
66
|
+
return "Portal";
|
|
67
|
+
case REACT_CONTEXT_TYPE:
|
|
68
|
+
return (type.displayName || "Context") + ".Provider";
|
|
69
|
+
case REACT_CONSUMER_TYPE:
|
|
70
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
71
|
+
case REACT_FORWARD_REF_TYPE:
|
|
72
|
+
var innerType = type.render;
|
|
73
|
+
type = type.displayName;
|
|
74
|
+
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
|
225
75
|
return type;
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
return 'Portal';
|
|
232
|
-
case REACT_PROFILER_TYPE:
|
|
233
|
-
return 'Profiler';
|
|
234
|
-
case REACT_STRICT_MODE_TYPE:
|
|
235
|
-
return 'StrictMode';
|
|
236
|
-
case REACT_SUSPENSE_TYPE:
|
|
237
|
-
return 'Suspense';
|
|
238
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
239
|
-
return 'SuspenseList';
|
|
240
|
-
}
|
|
241
|
-
if (_typeof(type) === 'object') {
|
|
242
|
-
switch (type.$$typeof) {
|
|
243
|
-
case REACT_CONTEXT_TYPE:
|
|
244
|
-
var context = type;
|
|
245
|
-
return getContextName(context) + '.Consumer';
|
|
246
|
-
case REACT_PROVIDER_TYPE:
|
|
247
|
-
var provider = type;
|
|
248
|
-
return getContextName(provider._context) + '.Provider';
|
|
249
|
-
case REACT_FORWARD_REF_TYPE:
|
|
250
|
-
return getWrappedName(type, type.render, 'ForwardRef');
|
|
251
|
-
case REACT_MEMO_TYPE:
|
|
252
|
-
var outerName = type.displayName || null;
|
|
253
|
-
if (outerName !== null) {
|
|
254
|
-
return outerName;
|
|
255
|
-
}
|
|
256
|
-
return getComponentNameFromType(type.type) || 'Memo';
|
|
257
|
-
case REACT_LAZY_TYPE:
|
|
258
|
-
{
|
|
259
|
-
var lazyComponent = type;
|
|
260
|
-
var payload = lazyComponent._payload;
|
|
261
|
-
var init = lazyComponent._init;
|
|
262
|
-
try {
|
|
263
|
-
return getComponentNameFromType(init(payload));
|
|
264
|
-
} catch (x) {
|
|
265
|
-
return null;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// eslint-disable-next-line no-fallthrough
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
return null;
|
|
273
|
-
}
|
|
274
|
-
var assign = Object.assign;
|
|
275
|
-
|
|
276
|
-
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
277
|
-
// replaying on render function. This currently only patches the object
|
|
278
|
-
// lazily which won't cover if the log function was extracted eagerly.
|
|
279
|
-
// We could also eagerly patch the method.
|
|
280
|
-
var disabledDepth = 0;
|
|
281
|
-
var prevLog;
|
|
282
|
-
var prevInfo;
|
|
283
|
-
var prevWarn;
|
|
284
|
-
var prevError;
|
|
285
|
-
var prevGroup;
|
|
286
|
-
var prevGroupCollapsed;
|
|
287
|
-
var prevGroupEnd;
|
|
288
|
-
function disabledLog() {}
|
|
289
|
-
disabledLog.__reactDisabledLog = true;
|
|
290
|
-
function disableLogs() {
|
|
291
|
-
{
|
|
292
|
-
if (disabledDepth === 0) {
|
|
293
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
294
|
-
prevLog = console.log;
|
|
295
|
-
prevInfo = console.info;
|
|
296
|
-
prevWarn = console.warn;
|
|
297
|
-
prevError = console.error;
|
|
298
|
-
prevGroup = console.group;
|
|
299
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
300
|
-
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
301
|
-
|
|
302
|
-
var props = {
|
|
303
|
-
configurable: true,
|
|
304
|
-
enumerable: true,
|
|
305
|
-
value: disabledLog,
|
|
306
|
-
writable: true
|
|
307
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
308
|
-
|
|
309
|
-
Object.defineProperties(console, {
|
|
310
|
-
info: props,
|
|
311
|
-
log: props,
|
|
312
|
-
warn: props,
|
|
313
|
-
error: props,
|
|
314
|
-
group: props,
|
|
315
|
-
groupCollapsed: props,
|
|
316
|
-
groupEnd: props
|
|
317
|
-
});
|
|
318
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
319
|
-
}
|
|
320
|
-
disabledDepth++;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
function reenableLogs() {
|
|
324
|
-
{
|
|
325
|
-
disabledDepth--;
|
|
326
|
-
if (disabledDepth === 0) {
|
|
327
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
328
|
-
var props = {
|
|
329
|
-
configurable: true,
|
|
330
|
-
enumerable: true,
|
|
331
|
-
writable: true
|
|
332
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
333
|
-
|
|
334
|
-
Object.defineProperties(console, {
|
|
335
|
-
log: assign({}, props, {
|
|
336
|
-
value: prevLog
|
|
337
|
-
}),
|
|
338
|
-
info: assign({}, props, {
|
|
339
|
-
value: prevInfo
|
|
340
|
-
}),
|
|
341
|
-
warn: assign({}, props, {
|
|
342
|
-
value: prevWarn
|
|
343
|
-
}),
|
|
344
|
-
error: assign({}, props, {
|
|
345
|
-
value: prevError
|
|
346
|
-
}),
|
|
347
|
-
group: assign({}, props, {
|
|
348
|
-
value: prevGroup
|
|
349
|
-
}),
|
|
350
|
-
groupCollapsed: assign({}, props, {
|
|
351
|
-
value: prevGroupCollapsed
|
|
352
|
-
}),
|
|
353
|
-
groupEnd: assign({}, props, {
|
|
354
|
-
value: prevGroupEnd
|
|
355
|
-
})
|
|
356
|
-
});
|
|
357
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
358
|
-
}
|
|
359
|
-
if (disabledDepth < 0) {
|
|
360
|
-
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
365
|
-
var prefix;
|
|
366
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
367
|
-
{
|
|
368
|
-
if (prefix === undefined) {
|
|
369
|
-
// Extract the VM specific prefix used by each line.
|
|
370
|
-
try {
|
|
371
|
-
throw Error();
|
|
372
|
-
} catch (x) {
|
|
373
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
374
|
-
prefix = match && match[1] || '';
|
|
375
|
-
}
|
|
376
|
-
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
377
|
-
|
|
378
|
-
return '\n' + prefix + name;
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
var reentry = false;
|
|
382
|
-
var componentFrameCache;
|
|
383
|
-
{
|
|
384
|
-
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
385
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
386
|
-
}
|
|
387
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
388
|
-
// If something asked for a stack inside a fake render, it should get ignored.
|
|
389
|
-
if (!fn || reentry) {
|
|
390
|
-
return '';
|
|
391
|
-
}
|
|
392
|
-
{
|
|
393
|
-
var frame = componentFrameCache.get(fn);
|
|
394
|
-
if (frame !== undefined) {
|
|
395
|
-
return frame;
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
var control;
|
|
399
|
-
reentry = true;
|
|
400
|
-
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
401
|
-
|
|
402
|
-
Error.prepareStackTrace = undefined;
|
|
403
|
-
var previousDispatcher;
|
|
404
|
-
{
|
|
405
|
-
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
406
|
-
// for warnings.
|
|
407
|
-
|
|
408
|
-
ReactCurrentDispatcher.current = null;
|
|
409
|
-
disableLogs();
|
|
410
|
-
}
|
|
411
|
-
try {
|
|
412
|
-
// This should throw.
|
|
413
|
-
if (construct) {
|
|
414
|
-
// Something should be setting the props in the constructor.
|
|
415
|
-
var Fake = function Fake() {
|
|
416
|
-
throw Error();
|
|
417
|
-
}; // $FlowFixMe
|
|
418
|
-
|
|
419
|
-
Object.defineProperty(Fake.prototype, 'props', {
|
|
420
|
-
set: function set() {
|
|
421
|
-
// We use a throwing setter instead of frozen or non-writable props
|
|
422
|
-
// because that won't throw in a non-strict mode function.
|
|
423
|
-
throw Error();
|
|
424
|
-
}
|
|
425
|
-
});
|
|
426
|
-
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === 'object' && Reflect.construct) {
|
|
427
|
-
// We construct a different control for this case to include any extra
|
|
428
|
-
// frames added by the construct call.
|
|
429
|
-
try {
|
|
430
|
-
Reflect.construct(Fake, []);
|
|
431
|
-
} catch (x) {
|
|
432
|
-
control = x;
|
|
433
|
-
}
|
|
434
|
-
Reflect.construct(fn, [], Fake);
|
|
435
|
-
} else {
|
|
436
|
-
try {
|
|
437
|
-
Fake.call();
|
|
438
|
-
} catch (x) {
|
|
439
|
-
control = x;
|
|
440
|
-
}
|
|
441
|
-
fn.call(Fake.prototype);
|
|
442
|
-
}
|
|
443
|
-
} else {
|
|
444
|
-
try {
|
|
445
|
-
throw Error();
|
|
446
|
-
} catch (x) {
|
|
447
|
-
control = x;
|
|
448
|
-
}
|
|
449
|
-
fn();
|
|
450
|
-
}
|
|
451
|
-
} catch (sample) {
|
|
452
|
-
// This is inlined manually because closure doesn't do it for us.
|
|
453
|
-
if (sample && control && typeof sample.stack === 'string') {
|
|
454
|
-
// This extracts the first frame from the sample that isn't also in the control.
|
|
455
|
-
// Skipping one frame that we assume is the frame that calls the two.
|
|
456
|
-
var sampleLines = sample.stack.split('\n');
|
|
457
|
-
var controlLines = control.stack.split('\n');
|
|
458
|
-
var s = sampleLines.length - 1;
|
|
459
|
-
var c = controlLines.length - 1;
|
|
460
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
461
|
-
// We expect at least one stack frame to be shared.
|
|
462
|
-
// Typically this will be the root most one. However, stack frames may be
|
|
463
|
-
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
464
|
-
// earlier than the other. We assume that the sample is longer or the same
|
|
465
|
-
// and there for cut off earlier. So we should find the root most frame in
|
|
466
|
-
// the sample somewhere in the control.
|
|
467
|
-
c--;
|
|
468
|
-
}
|
|
469
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
470
|
-
// Next we find the first one that isn't the same which should be the
|
|
471
|
-
// frame that called our sample function and the control.
|
|
472
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
473
|
-
// In V8, the first line is describing the message but other VMs don't.
|
|
474
|
-
// If we're about to return the first line, and the control is also on the same
|
|
475
|
-
// line, that's a pretty good indicator that our sample threw at same line as
|
|
476
|
-
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
477
|
-
// This can happen if you passed a class to function component, or non-function.
|
|
478
|
-
if (s !== 1 || c !== 1) {
|
|
479
|
-
do {
|
|
480
|
-
s--;
|
|
481
|
-
c--; // We may still have similar intermediate frames from the construct call.
|
|
482
|
-
// The next one that isn't the same should be our match though.
|
|
483
|
-
|
|
484
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
485
|
-
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
486
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
|
487
|
-
// but we have a user-provided "displayName"
|
|
488
|
-
// splice it in to make the stack more readable.
|
|
489
|
-
|
|
490
|
-
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
491
|
-
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
492
|
-
}
|
|
493
|
-
{
|
|
494
|
-
if (typeof fn === 'function') {
|
|
495
|
-
componentFrameCache.set(fn, _frame);
|
|
496
|
-
}
|
|
497
|
-
} // Return the line we found.
|
|
498
|
-
|
|
499
|
-
return _frame;
|
|
500
|
-
}
|
|
501
|
-
} while (s >= 1 && c >= 0);
|
|
502
|
-
}
|
|
503
|
-
break;
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
} finally {
|
|
508
|
-
reentry = false;
|
|
509
|
-
{
|
|
510
|
-
ReactCurrentDispatcher.current = previousDispatcher;
|
|
511
|
-
reenableLogs();
|
|
512
|
-
}
|
|
513
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
514
|
-
} // Fallback to just using the name if we couldn't make it throw.
|
|
515
|
-
|
|
516
|
-
var name = fn ? fn.displayName || fn.name : '';
|
|
517
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
518
|
-
{
|
|
519
|
-
if (typeof fn === 'function') {
|
|
520
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
return syntheticFrame;
|
|
524
|
-
}
|
|
525
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
526
|
-
{
|
|
527
|
-
return describeNativeComponentFrame(fn, false);
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
function shouldConstruct(Component) {
|
|
531
|
-
var prototype = Component.prototype;
|
|
532
|
-
return !!(prototype && prototype.isReactComponent);
|
|
533
|
-
}
|
|
534
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
535
|
-
if (type == null) {
|
|
536
|
-
return '';
|
|
537
|
-
}
|
|
538
|
-
if (typeof type === 'function') {
|
|
539
|
-
{
|
|
540
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
if (typeof type === 'string') {
|
|
544
|
-
return describeBuiltInComponentFrame(type);
|
|
545
|
-
}
|
|
546
|
-
switch (type) {
|
|
547
|
-
case REACT_SUSPENSE_TYPE:
|
|
548
|
-
return describeBuiltInComponentFrame('Suspense');
|
|
549
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
550
|
-
return describeBuiltInComponentFrame('SuspenseList');
|
|
551
|
-
}
|
|
552
|
-
if (_typeof(type) === 'object') {
|
|
553
|
-
switch (type.$$typeof) {
|
|
554
|
-
case REACT_FORWARD_REF_TYPE:
|
|
555
|
-
return describeFunctionComponentFrame(type.render);
|
|
556
|
-
case REACT_MEMO_TYPE:
|
|
557
|
-
// Memo may contain any component type so we recursively resolve it.
|
|
558
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
559
|
-
case REACT_LAZY_TYPE:
|
|
560
|
-
{
|
|
561
|
-
var lazyComponent = type;
|
|
562
|
-
var payload = lazyComponent._payload;
|
|
563
|
-
var init = lazyComponent._init;
|
|
564
|
-
try {
|
|
565
|
-
// Lazy may contain any component type so we recursively resolve it.
|
|
566
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
567
|
-
} catch (x) {}
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
return '';
|
|
572
|
-
}
|
|
573
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
574
|
-
var loggedTypeFailures = {};
|
|
575
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
576
|
-
function setCurrentlyValidatingElement(element) {
|
|
577
|
-
{
|
|
578
|
-
if (element) {
|
|
579
|
-
var owner = element._owner;
|
|
580
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
581
|
-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
582
|
-
} else {
|
|
583
|
-
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
588
|
-
{
|
|
589
|
-
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
590
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
591
|
-
for (var typeSpecName in typeSpecs) {
|
|
592
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
593
|
-
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
|
|
594
|
-
// fail the render phase where it didn't fail before. So we log it.
|
|
595
|
-
// After these have been cleaned up, we'll let them throw.
|
|
596
|
-
|
|
597
|
-
try {
|
|
598
|
-
// This is intentionally an invariant that gets caught. It's the same
|
|
599
|
-
// behavior as without this statement except with a better message.
|
|
600
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
601
|
-
// eslint-disable-next-line react-internal/prod-error-codes
|
|
602
|
-
var err = Error((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`.');
|
|
603
|
-
err.name = 'Invariant Violation';
|
|
604
|
-
throw err;
|
|
605
|
-
}
|
|
606
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
607
|
-
} catch (ex) {
|
|
608
|
-
error$1 = ex;
|
|
609
|
-
}
|
|
610
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
611
|
-
setCurrentlyValidatingElement(element);
|
|
612
|
-
error('%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).', componentName || 'React class', location, typeSpecName, _typeof(error$1));
|
|
613
|
-
setCurrentlyValidatingElement(null);
|
|
614
|
-
}
|
|
615
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
616
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
617
|
-
// same error.
|
|
618
|
-
loggedTypeFailures[error$1.message] = true;
|
|
619
|
-
setCurrentlyValidatingElement(element);
|
|
620
|
-
error('Failed %s type: %s', location, error$1.message);
|
|
621
|
-
setCurrentlyValidatingElement(null);
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
628
|
-
|
|
629
|
-
function isArray(a) {
|
|
630
|
-
return isArrayImpl(a);
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
/*
|
|
634
|
-
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
635
|
-
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
636
|
-
*
|
|
637
|
-
* The functions in this module will throw an easier-to-understand,
|
|
638
|
-
* easier-to-debug exception with a clear errors message message explaining the
|
|
639
|
-
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
640
|
-
* of the `value` object).
|
|
641
|
-
*/
|
|
642
|
-
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
643
|
-
function typeName(value) {
|
|
644
|
-
{
|
|
645
|
-
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
646
|
-
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
647
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
|
648
|
-
return type;
|
|
649
|
-
}
|
|
650
|
-
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
651
|
-
|
|
652
|
-
function willCoercionThrow(value) {
|
|
653
|
-
{
|
|
76
|
+
case REACT_MEMO_TYPE:
|
|
77
|
+
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
|
78
|
+
case REACT_LAZY_TYPE:
|
|
79
|
+
innerType = type._payload;
|
|
80
|
+
type = type._init;
|
|
654
81
|
try {
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
} catch (e) {
|
|
658
|
-
return true;
|
|
659
|
-
}
|
|
660
|
-
}
|
|
82
|
+
return getComponentNameFromType(type(innerType));
|
|
83
|
+
} catch (x) {}
|
|
661
84
|
}
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
// methods are needed to perform accurate arithmetic or comparison.)
|
|
674
|
-
//
|
|
675
|
-
// To fix the problem, coerce this object or symbol value to a string before
|
|
676
|
-
// passing it to React. The most reliable way is usually `String(value)`.
|
|
677
|
-
//
|
|
678
|
-
// To find which value is throwing, check the browser or debugger console.
|
|
679
|
-
// Before this exception was thrown, there should be `console.error` output
|
|
680
|
-
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
681
|
-
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
682
|
-
// In most cases, this console output also shows the component and its
|
|
683
|
-
// ancestor components where the exception happened.
|
|
684
|
-
//
|
|
685
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
686
|
-
return '' + value;
|
|
687
|
-
}
|
|
688
|
-
function checkKeyStringCoercion(value) {
|
|
689
|
-
{
|
|
690
|
-
if (willCoercionThrow(value)) {
|
|
691
|
-
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
692
|
-
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
697
|
-
var RESERVED_PROPS = {
|
|
698
|
-
key: true,
|
|
699
|
-
ref: true,
|
|
700
|
-
__self: true,
|
|
701
|
-
__source: true
|
|
702
|
-
};
|
|
703
|
-
var specialPropKeyWarningShown;
|
|
704
|
-
var specialPropRefWarningShown;
|
|
705
|
-
var didWarnAboutStringRefs;
|
|
706
|
-
{
|
|
707
|
-
didWarnAboutStringRefs = {};
|
|
708
|
-
}
|
|
709
|
-
function hasValidRef(config) {
|
|
710
|
-
{
|
|
711
|
-
if (hasOwnProperty.call(config, 'ref')) {
|
|
712
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
713
|
-
if (getter && getter.isReactWarning) {
|
|
714
|
-
return false;
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
return config.ref !== undefined;
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
function testStringCoercion(value) {
|
|
88
|
+
return "" + value;
|
|
89
|
+
}
|
|
90
|
+
function checkKeyStringCoercion(value) {
|
|
91
|
+
try {
|
|
92
|
+
testStringCoercion(value);
|
|
93
|
+
var JSCompiler_inline_result = !1;
|
|
94
|
+
} catch (e) {
|
|
95
|
+
JSCompiler_inline_result = !0;
|
|
719
96
|
}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
return config.key !== undefined;
|
|
97
|
+
if (JSCompiler_inline_result) {
|
|
98
|
+
JSCompiler_inline_result = console;
|
|
99
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
100
|
+
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
101
|
+
JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
|
|
102
|
+
return testStringCoercion(value);
|
|
730
103
|
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
}
|
|
104
|
+
}
|
|
105
|
+
function getTaskName(type) {
|
|
106
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
107
|
+
if ("object" === _typeof(type) && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
|
|
108
|
+
try {
|
|
109
|
+
var name = getComponentNameFromType(type);
|
|
110
|
+
return name ? "<" + name + ">" : "<...>";
|
|
111
|
+
} catch (x) {
|
|
112
|
+
return "<...>";
|
|
741
113
|
}
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
});
|
|
755
|
-
}
|
|
114
|
+
}
|
|
115
|
+
function getOwner() {
|
|
116
|
+
var dispatcher = ReactSharedInternals.A;
|
|
117
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
118
|
+
}
|
|
119
|
+
function UnknownOwner() {
|
|
120
|
+
return Error("react-stack-top-frame");
|
|
121
|
+
}
|
|
122
|
+
function hasValidKey(config) {
|
|
123
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
124
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
125
|
+
if (getter && getter.isReactWarning) return !1;
|
|
756
126
|
}
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
error('%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)', displayName);
|
|
763
|
-
}
|
|
764
|
-
};
|
|
765
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
766
|
-
Object.defineProperty(props, 'ref', {
|
|
767
|
-
get: warnAboutAccessingRef,
|
|
768
|
-
configurable: true
|
|
769
|
-
});
|
|
770
|
-
}
|
|
127
|
+
return void 0 !== config.key;
|
|
128
|
+
}
|
|
129
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
130
|
+
function warnAboutAccessingKey() {
|
|
131
|
+
specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, console.error("%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://react.dev/link/special-props)", displayName));
|
|
771
132
|
}
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
var ReactElement = function ReactElement(type, key, ref, self, source, owner, props) {
|
|
794
|
-
var element = {
|
|
795
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
796
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
797
|
-
// Built-in properties that belong on the element
|
|
798
|
-
type: type,
|
|
799
|
-
key: key,
|
|
800
|
-
ref: ref,
|
|
801
|
-
props: props,
|
|
802
|
-
// Record the component responsible for creating this element.
|
|
803
|
-
_owner: owner
|
|
804
|
-
};
|
|
805
|
-
{
|
|
806
|
-
// The validation flag is currently mutative. We put it on
|
|
807
|
-
// an external backing store so that we can freeze the whole object.
|
|
808
|
-
// This can be replaced with a WeakMap once they are implemented in
|
|
809
|
-
// commonly used development environments.
|
|
810
|
-
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
811
|
-
// the validation flag non-enumerable (where possible, which should
|
|
812
|
-
// include every environment we run tests in), so the test framework
|
|
813
|
-
// ignores it.
|
|
814
|
-
|
|
815
|
-
Object.defineProperty(element._store, 'validated', {
|
|
816
|
-
configurable: false,
|
|
817
|
-
enumerable: false,
|
|
818
|
-
writable: true,
|
|
819
|
-
value: false
|
|
820
|
-
}); // self and source are DEV only properties.
|
|
821
|
-
|
|
822
|
-
Object.defineProperty(element, '_self', {
|
|
823
|
-
configurable: false,
|
|
824
|
-
enumerable: false,
|
|
825
|
-
writable: false,
|
|
826
|
-
value: self
|
|
827
|
-
}); // Two elements created in two different places should be considered
|
|
828
|
-
// equal for testing purposes and therefore we hide it from enumeration.
|
|
829
|
-
|
|
830
|
-
Object.defineProperty(element, '_source', {
|
|
831
|
-
configurable: false,
|
|
832
|
-
enumerable: false,
|
|
833
|
-
writable: false,
|
|
834
|
-
value: source
|
|
835
|
-
});
|
|
836
|
-
if (Object.freeze) {
|
|
837
|
-
Object.freeze(element.props);
|
|
838
|
-
Object.freeze(element);
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
return element;
|
|
133
|
+
warnAboutAccessingKey.isReactWarning = !0;
|
|
134
|
+
Object.defineProperty(props, "key", {
|
|
135
|
+
get: warnAboutAccessingKey,
|
|
136
|
+
configurable: !0
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
140
|
+
var componentName = getComponentNameFromType(this.type);
|
|
141
|
+
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
|
|
142
|
+
componentName = this.props.ref;
|
|
143
|
+
return void 0 !== componentName ? componentName : null;
|
|
144
|
+
}
|
|
145
|
+
function ReactElement(type, key, self, source, owner, props, debugStack, debugTask) {
|
|
146
|
+
self = props.ref;
|
|
147
|
+
type = {
|
|
148
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
149
|
+
type: type,
|
|
150
|
+
key: key,
|
|
151
|
+
props: props,
|
|
152
|
+
_owner: owner
|
|
842
153
|
};
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
}
|
|
894
|
-
if (key || ref) {
|
|
895
|
-
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
896
|
-
if (key) {
|
|
897
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
898
|
-
}
|
|
899
|
-
if (ref) {
|
|
900
|
-
defineRefPropWarningGetter(props, displayName);
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
907
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
908
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
909
|
-
{
|
|
910
|
-
if (element) {
|
|
911
|
-
var owner = element._owner;
|
|
912
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
913
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
914
|
-
} else {
|
|
915
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
var propTypesMisspellWarningShown;
|
|
920
|
-
{
|
|
921
|
-
propTypesMisspellWarningShown = false;
|
|
922
|
-
}
|
|
923
|
-
/**
|
|
924
|
-
* Verifies the object is a ReactElement.
|
|
925
|
-
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
926
|
-
* @param {?object} object
|
|
927
|
-
* @return {boolean} True if `object` is a ReactElement.
|
|
928
|
-
* @final
|
|
929
|
-
*/
|
|
930
|
-
|
|
931
|
-
function isValidElement(object) {
|
|
932
|
-
{
|
|
933
|
-
return _typeof(object) === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
function getDeclarationErrorAddendum() {
|
|
937
|
-
{
|
|
938
|
-
if (ReactCurrentOwner$1.current) {
|
|
939
|
-
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
940
|
-
if (name) {
|
|
941
|
-
return '\n\nCheck the render method of `' + name + '`.';
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
return '';
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
function getSourceInfoErrorAddendum(source) {
|
|
948
|
-
{
|
|
949
|
-
if (source !== undefined) {
|
|
950
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
951
|
-
var lineNumber = source.lineNumber;
|
|
952
|
-
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
953
|
-
}
|
|
954
|
-
return '';
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
/**
|
|
958
|
-
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
959
|
-
* object keys are not valid. This allows us to keep track of children between
|
|
960
|
-
* updates.
|
|
961
|
-
*/
|
|
962
|
-
|
|
963
|
-
var ownerHasKeyUseWarning = {};
|
|
964
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
965
|
-
{
|
|
966
|
-
var info = getDeclarationErrorAddendum();
|
|
967
|
-
if (!info) {
|
|
968
|
-
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
969
|
-
if (parentName) {
|
|
970
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
return info;
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
/**
|
|
977
|
-
* Warn if the element doesn't have an explicit key assigned to it.
|
|
978
|
-
* This element is in an array. The array could grow and shrink or be
|
|
979
|
-
* reordered. All children that haven't already been validated are required to
|
|
980
|
-
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
981
|
-
* will only be shown once.
|
|
982
|
-
*
|
|
983
|
-
* @internal
|
|
984
|
-
* @param {ReactElement} element Element that requires a key.
|
|
985
|
-
* @param {*} parentType element's parent's type.
|
|
986
|
-
*/
|
|
987
|
-
|
|
988
|
-
function validateExplicitKey(element, parentType) {
|
|
989
|
-
{
|
|
990
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
991
|
-
return;
|
|
992
|
-
}
|
|
993
|
-
element._store.validated = true;
|
|
994
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
995
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
996
|
-
return;
|
|
997
|
-
}
|
|
998
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
999
|
-
// property, it may be the creator of the child that's responsible for
|
|
1000
|
-
// assigning it a key.
|
|
1001
|
-
|
|
1002
|
-
var childOwner = '';
|
|
1003
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
1004
|
-
// Give the component that originally created this child.
|
|
1005
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1006
|
-
}
|
|
1007
|
-
setCurrentlyValidatingElement$1(element);
|
|
1008
|
-
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1009
|
-
setCurrentlyValidatingElement$1(null);
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
/**
|
|
1013
|
-
* Ensure that every element either is passed in a static location, in an
|
|
1014
|
-
* array with an explicit keys property defined, or in an object literal
|
|
1015
|
-
* with valid key property.
|
|
1016
|
-
*
|
|
1017
|
-
* @internal
|
|
1018
|
-
* @param {ReactNode} node Statically passed child of any type.
|
|
1019
|
-
* @param {*} parentType node's parent's type.
|
|
1020
|
-
*/
|
|
1021
|
-
|
|
1022
|
-
function validateChildKeys(node, parentType) {
|
|
1023
|
-
{
|
|
1024
|
-
if (_typeof(node) !== 'object') {
|
|
1025
|
-
return;
|
|
1026
|
-
}
|
|
1027
|
-
if (isArray(node)) {
|
|
1028
|
-
for (var i = 0; i < node.length; i++) {
|
|
1029
|
-
var child = node[i];
|
|
1030
|
-
if (isValidElement(child)) {
|
|
1031
|
-
validateExplicitKey(child, parentType);
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
} else if (isValidElement(node)) {
|
|
1035
|
-
// This element was passed in a valid location.
|
|
1036
|
-
if (node._store) {
|
|
1037
|
-
node._store.validated = true;
|
|
1038
|
-
}
|
|
1039
|
-
} else if (node) {
|
|
1040
|
-
var iteratorFn = getIteratorFn(node);
|
|
1041
|
-
if (typeof iteratorFn === 'function') {
|
|
1042
|
-
// Entry iterators used to provide implicit keys,
|
|
1043
|
-
// but now we print a separate warning for them later.
|
|
1044
|
-
if (iteratorFn !== node.entries) {
|
|
1045
|
-
var iterator = iteratorFn.call(node);
|
|
1046
|
-
var step;
|
|
1047
|
-
while (!(step = iterator.next()).done) {
|
|
1048
|
-
if (isValidElement(step.value)) {
|
|
1049
|
-
validateExplicitKey(step.value, parentType);
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
/**
|
|
1058
|
-
* Given an element, validate that its props follow the propTypes definition,
|
|
1059
|
-
* provided by the type.
|
|
1060
|
-
*
|
|
1061
|
-
* @param {ReactElement} element
|
|
1062
|
-
*/
|
|
1063
|
-
|
|
1064
|
-
function validatePropTypes(element) {
|
|
1065
|
-
{
|
|
1066
|
-
var type = element.type;
|
|
1067
|
-
if (type === null || type === undefined || typeof type === 'string') {
|
|
1068
|
-
return;
|
|
1069
|
-
}
|
|
1070
|
-
var propTypes;
|
|
1071
|
-
if (typeof type === 'function') {
|
|
1072
|
-
propTypes = type.propTypes;
|
|
1073
|
-
} else if (_typeof(type) === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
|
1074
|
-
// Note: Memo only checks outer props here.
|
|
1075
|
-
// Inner props are checked in the reconciler.
|
|
1076
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1077
|
-
propTypes = type.propTypes;
|
|
1078
|
-
} else {
|
|
1079
|
-
return;
|
|
1080
|
-
}
|
|
1081
|
-
if (propTypes) {
|
|
1082
|
-
// Intentionally inside to avoid triggering lazy initializers:
|
|
1083
|
-
var name = getComponentNameFromType(type);
|
|
1084
|
-
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
1085
|
-
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1086
|
-
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
1087
|
-
|
|
1088
|
-
var _name = getComponentNameFromType(type);
|
|
1089
|
-
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
1090
|
-
}
|
|
1091
|
-
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
1092
|
-
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
/**
|
|
1097
|
-
* Given a fragment, validate that it can only be provided with fragment props
|
|
1098
|
-
* @param {ReactElement} fragment
|
|
1099
|
-
*/
|
|
1100
|
-
|
|
1101
|
-
function validateFragmentProps(fragment) {
|
|
1102
|
-
{
|
|
1103
|
-
var keys = Object.keys(fragment.props);
|
|
1104
|
-
for (var i = 0; i < keys.length; i++) {
|
|
1105
|
-
var key = keys[i];
|
|
1106
|
-
if (key !== 'children' && key !== 'key') {
|
|
1107
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1108
|
-
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
1109
|
-
setCurrentlyValidatingElement$1(null);
|
|
1110
|
-
break;
|
|
1111
|
-
}
|
|
1112
|
-
}
|
|
1113
|
-
if (fragment.ref !== null) {
|
|
1114
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1115
|
-
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
1116
|
-
setCurrentlyValidatingElement$1(null);
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
}
|
|
1120
|
-
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
1121
|
-
{
|
|
1122
|
-
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
1123
|
-
// succeed and there will likely be errors in render.
|
|
1124
|
-
|
|
1125
|
-
if (!validType) {
|
|
1126
|
-
var info = '';
|
|
1127
|
-
if (type === undefined || _typeof(type) === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
1128
|
-
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
1129
|
-
}
|
|
1130
|
-
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
1131
|
-
if (sourceInfo) {
|
|
1132
|
-
info += sourceInfo;
|
|
1133
|
-
} else {
|
|
1134
|
-
info += getDeclarationErrorAddendum();
|
|
1135
|
-
}
|
|
1136
|
-
var typeString;
|
|
1137
|
-
if (type === null) {
|
|
1138
|
-
typeString = 'null';
|
|
1139
|
-
} else if (isArray(type)) {
|
|
1140
|
-
typeString = 'array';
|
|
1141
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1142
|
-
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
1143
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1144
|
-
} else {
|
|
1145
|
-
typeString = _typeof(type);
|
|
1146
|
-
}
|
|
1147
|
-
error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
1148
|
-
}
|
|
1149
|
-
var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
|
|
1150
|
-
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
1151
|
-
|
|
1152
|
-
if (element == null) {
|
|
1153
|
-
return element;
|
|
1154
|
-
} // Skip key warning if the type isn't valid since our key validation logic
|
|
1155
|
-
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
1156
|
-
// We don't want exception behavior to differ between dev and prod.
|
|
1157
|
-
// (Rendering will throw with a helpful message and as soon as the type is
|
|
1158
|
-
// fixed, the key warnings will appear.)
|
|
1159
|
-
|
|
1160
|
-
if (validType) {
|
|
1161
|
-
var children = props.children;
|
|
1162
|
-
if (children !== undefined) {
|
|
1163
|
-
if (isStaticChildren) {
|
|
1164
|
-
if (isArray(children)) {
|
|
1165
|
-
for (var i = 0; i < children.length; i++) {
|
|
1166
|
-
validateChildKeys(children[i], type);
|
|
1167
|
-
}
|
|
1168
|
-
if (Object.freeze) {
|
|
1169
|
-
Object.freeze(children);
|
|
1170
|
-
}
|
|
1171
|
-
} else {
|
|
1172
|
-
error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
|
|
1173
|
-
}
|
|
1174
|
-
} else {
|
|
1175
|
-
validateChildKeys(children, type);
|
|
1176
|
-
}
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1179
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
1180
|
-
validateFragmentProps(element);
|
|
1181
|
-
} else {
|
|
1182
|
-
validatePropTypes(element);
|
|
1183
|
-
}
|
|
1184
|
-
return element;
|
|
1185
|
-
}
|
|
1186
|
-
} // These two functions exist to still get child warnings in dev
|
|
1187
|
-
// even with the prod transform. This means that jsxDEV is purely
|
|
1188
|
-
// opt-in behavior for better messages but that we won't stop
|
|
1189
|
-
// giving you warnings if you use production apis.
|
|
1190
|
-
|
|
1191
|
-
function jsxWithValidationStatic(type, props, key) {
|
|
1192
|
-
{
|
|
1193
|
-
return jsxWithValidation(type, props, key, true);
|
|
1194
|
-
}
|
|
154
|
+
null !== (void 0 !== self ? self : null) ? Object.defineProperty(type, "ref", {
|
|
155
|
+
enumerable: !1,
|
|
156
|
+
get: elementRefGetterWithDeprecationWarning
|
|
157
|
+
}) : Object.defineProperty(type, "ref", {
|
|
158
|
+
enumerable: !1,
|
|
159
|
+
value: null
|
|
160
|
+
});
|
|
161
|
+
type._store = {};
|
|
162
|
+
Object.defineProperty(type._store, "validated", {
|
|
163
|
+
configurable: !1,
|
|
164
|
+
enumerable: !1,
|
|
165
|
+
writable: !0,
|
|
166
|
+
value: 0
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
169
|
+
configurable: !1,
|
|
170
|
+
enumerable: !1,
|
|
171
|
+
writable: !0,
|
|
172
|
+
value: null
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(type, "_debugStack", {
|
|
175
|
+
configurable: !1,
|
|
176
|
+
enumerable: !1,
|
|
177
|
+
writable: !0,
|
|
178
|
+
value: debugStack
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(type, "_debugTask", {
|
|
181
|
+
configurable: !1,
|
|
182
|
+
enumerable: !1,
|
|
183
|
+
writable: !0,
|
|
184
|
+
value: debugTask
|
|
185
|
+
});
|
|
186
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
187
|
+
return type;
|
|
188
|
+
}
|
|
189
|
+
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self, debugStack, debugTask) {
|
|
190
|
+
var children = config.children;
|
|
191
|
+
if (void 0 !== children) if (isStaticChildren) {
|
|
192
|
+
if (isArrayImpl(children)) {
|
|
193
|
+
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++) validateChildKeys(children[isStaticChildren]);
|
|
194
|
+
Object.freeze && Object.freeze(children);
|
|
195
|
+
} else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
196
|
+
} else validateChildKeys(children);
|
|
197
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
198
|
+
children = getComponentNameFromType(type);
|
|
199
|
+
var keys = Object.keys(config).filter(function (k) {
|
|
200
|
+
return "key" !== k;
|
|
201
|
+
});
|
|
202
|
+
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
203
|
+
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = !0);
|
|
1195
204
|
}
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
205
|
+
children = null;
|
|
206
|
+
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
|
207
|
+
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
|
208
|
+
if ("key" in config) {
|
|
209
|
+
maybeKey = {};
|
|
210
|
+
for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
|
|
211
|
+
} else maybeKey = config;
|
|
212
|
+
children && defineKeyPropWarningGetter(maybeKey, "function" === typeof type ? type.displayName || type.name || "Unknown" : type);
|
|
213
|
+
return ReactElement(type, children, self, source, getOwner(), maybeKey, debugStack, debugTask);
|
|
214
|
+
}
|
|
215
|
+
function validateChildKeys(node) {
|
|
216
|
+
"object" === _typeof(node) && null !== node && node.$$typeof === REACT_ELEMENT_TYPE && node._store && (node._store.validated = 1);
|
|
217
|
+
}
|
|
218
|
+
var React = React__default,
|
|
219
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
220
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
221
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
222
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
|
223
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
224
|
+
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
|
225
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
226
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
227
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
228
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
229
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
230
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
231
|
+
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
|
|
232
|
+
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
233
|
+
ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
234
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
235
|
+
isArrayImpl = Array.isArray,
|
|
236
|
+
createTask = console.createTask ? console.createTask : function () {
|
|
237
|
+
return null;
|
|
238
|
+
};
|
|
239
|
+
React = {
|
|
240
|
+
"react-stack-bottom-frame": function reactStackBottomFrame(callStackForError) {
|
|
241
|
+
return callStackForError();
|
|
1200
242
|
}
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
243
|
+
};
|
|
244
|
+
var specialPropKeyWarningShown;
|
|
245
|
+
var didWarnAboutElementRef = {};
|
|
246
|
+
var unknownOwnerDebugStack = React["react-stack-bottom-frame"].bind(React, UnknownOwner)();
|
|
247
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
248
|
+
var didWarnAboutKeySpread = {};
|
|
249
|
+
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
250
|
+
reactJsxRuntime_development.jsx = function (type, config, maybeKey, source, self) {
|
|
251
|
+
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
252
|
+
return jsxDEVImpl(type, config, maybeKey, !1, source, self, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
|
|
253
|
+
};
|
|
254
|
+
reactJsxRuntime_development.jsxs = function (type, config, maybeKey, source, self) {
|
|
255
|
+
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
256
|
+
return jsxDEVImpl(type, config, maybeKey, !0, source, self, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
|
|
257
|
+
};
|
|
258
|
+
})();
|
|
1210
259
|
return reactJsxRuntime_development;
|
|
1211
260
|
}
|
|
1212
261
|
|
|
@@ -1697,14 +746,14 @@ const Input = (_a) => {
|
|
|
1697
746
|
var { additional, addonBefore, addonAfter, labelText, children, components: componentsOverride = {},
|
|
1698
747
|
//className,
|
|
1699
748
|
// iconDescription,
|
|
1700
|
-
id, className,
|
|
749
|
+
id, className, inputWrapperClassName,
|
|
1701
750
|
//placeholder,
|
|
1702
751
|
//type,
|
|
1703
752
|
//onChange,
|
|
1704
753
|
//onClick,
|
|
1705
|
-
hideLabel, name, invalid, invalidText, helperText, required } = _a, other = __rest(_a, ["additional", "addonBefore", "addonAfter", "labelText", "children", "components", "id", "className", "
|
|
754
|
+
hideLabel, name, invalid, invalidText, helperText, required } = _a, other = __rest(_a, ["additional", "addonBefore", "addonAfter", "labelText", "children", "components", "id", "className", "inputWrapperClassName", "hideLabel", "name", "invalid", "invalidText", "helperText", "required"]);
|
|
1706
755
|
const { prefix } = useSettings();
|
|
1707
|
-
|
|
756
|
+
const calculatedId = id ? id : name;
|
|
1708
757
|
/* const inputProps = {
|
|
1709
758
|
id: calculatedId,
|
|
1710
759
|
onChange: (evt) => {
|
|
@@ -1784,9 +833,10 @@ const useInput = (_a) => {
|
|
|
1784
833
|
}, placeholder,
|
|
1785
834
|
value,
|
|
1786
835
|
type });
|
|
1787
|
-
console.log("useInput", { calculatedId });
|
|
1788
836
|
const wrapperProps = {
|
|
1789
837
|
calculatedId,
|
|
838
|
+
id,
|
|
839
|
+
name,
|
|
1790
840
|
className,
|
|
1791
841
|
addonAfter,
|
|
1792
842
|
labelText,
|
|
@@ -1839,7 +889,7 @@ const Search = React.forwardRef((props, ref) => {
|
|
|
1839
889
|
onChange(evt, evt.target.value); //TODO: why are we passing evt as second arg
|
|
1840
890
|
}
|
|
1841
891
|
};
|
|
1842
|
-
const clearSearch = () => {
|
|
892
|
+
const clearSearch = (evt) => {
|
|
1843
893
|
setValue("");
|
|
1844
894
|
// setTimeout(() => {
|
|
1845
895
|
// console.log("value", value);
|
|
@@ -2434,10 +1484,10 @@ const ContextMenuItem = (_a) => {
|
|
|
2434
1484
|
return jsxRuntimeExports.jsx("div", Object.assign({ className: classes }, other));
|
|
2435
1485
|
};
|
|
2436
1486
|
|
|
2437
|
-
const Footer = ({ className, children, labelOne, linkTextOne, linkHrefOne, labelTwo, linkTextTwo, linkHrefTwo, logo,
|
|
1487
|
+
const Footer = ({ className, children, labelOne, linkTextOne, linkHrefOne, labelTwo, linkTextTwo, linkHrefTwo, logo, metaContent, metaLinks, secondary, pageWidth = "lg", }) => {
|
|
2438
1488
|
const { prefix } = useSettings();
|
|
2439
1489
|
const classes = classNames(`${prefix}--footer`, className);
|
|
2440
|
-
return (jsxRuntimeExports.jsxs("footer", Object.assign({ className: classes }, { children: [jsxRuntimeExports.jsx(Wrapper, Object.assign({ pageWidth: pageWidth }, { children: jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__content` }, { children: [children ? (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--footer__info` }, { children: children }))) : (jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__info` }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__info__item` }, { children: [jsxRuntimeExports.jsx("p", Object.assign({ className: `${prefix}--footer__label` }, { children: labelOne })), jsxRuntimeExports.jsx("ul", Object.assign({ className: `${prefix}--footer__list` }, { children: jsxRuntimeExports.jsx("li", { children: jsxRuntimeExports.jsx(Link, Object.assign({ href: linkHrefOne }, { children: linkTextOne })) }) }))] })), jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__info__item` }, { children: [jsxRuntimeExports.jsx("p", Object.assign({ className: `${prefix}--footer__label` }, { children: labelTwo })), jsxRuntimeExports.jsx("ul", Object.assign({ className: `${prefix}--footer__list` }, { children: jsxRuntimeExports.jsx("li", { children: jsxRuntimeExports.jsx(Link, Object.assign({ href: linkHrefTwo }, { children: linkTextTwo })) }) }))] }))] }))), jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__cta` }, { children: [
|
|
1490
|
+
return (jsxRuntimeExports.jsxs("footer", Object.assign({ className: classes }, { children: [jsxRuntimeExports.jsx(Wrapper, Object.assign({ pageWidth: pageWidth }, { children: jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__content` }, { children: [children ? (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--footer__info` }, { children: children }))) : (jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__info` }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__info__item` }, { children: [jsxRuntimeExports.jsx("p", Object.assign({ className: `${prefix}--footer__label` }, { children: labelOne })), jsxRuntimeExports.jsx("ul", Object.assign({ className: `${prefix}--footer__list` }, { children: jsxRuntimeExports.jsx("li", { children: jsxRuntimeExports.jsx(Link, Object.assign({ href: linkHrefOne }, { children: linkTextOne })) }) }))] })), jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__info__item` }, { children: [jsxRuntimeExports.jsx("p", Object.assign({ className: `${prefix}--footer__label` }, { children: labelTwo })), jsxRuntimeExports.jsx("ul", Object.assign({ className: `${prefix}--footer__list` }, { children: jsxRuntimeExports.jsx("li", { children: jsxRuntimeExports.jsx(Link, Object.assign({ href: linkHrefTwo }, { children: linkTextTwo })) }) }))] }))] }))), jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--footer__cta` }, { children: [logo, secondary && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--footer__secondary` }, { children: secondary })))] }))] })) })), jsxRuntimeExports.jsxs(Wrapper, Object.assign({ className: `${prefix}--footer__meta`, pageWidth: pageWidth }, { children: [metaLinks && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--footer__meta__links` }, { children: metaLinks }))), metaContent && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--footer__meta__content` }, { children: metaContent })))] }))] })));
|
|
2441
1491
|
};
|
|
2442
1492
|
Footer.displayName = "Footer";
|
|
2443
1493
|
|
|
@@ -2628,163 +1678,10 @@ const MainNavigation = ({ children, components: componentsOverride = {}, classNa
|
|
|
2628
1678
|
toggleMenu,
|
|
2629
1679
|
onChangeSub,
|
|
2630
1680
|
setOpenMobileMenu,
|
|
2631
|
-
} }, { children: jsxRuntimeExports.jsxs(Wrapper$1, Object.assign({ pageWidth: pageWidth, mobilePageWidth: mobilePageWidth, className: `${prefix}--main-navigation__wrapper` }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation__logo-wrapper` }, { children: [jsxRuntimeExports.jsx(MobileButton$1, Object.assign({ toggleMenu: toggleMenu, prefix: prefix, openMobileMenu: openMobileMenu }, { children: "Menu" })), jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--main-navigation__logo` }, { children:
|
|
1681
|
+
} }, { children: jsxRuntimeExports.jsxs(Wrapper$1, Object.assign({ pageWidth: pageWidth, mobilePageWidth: mobilePageWidth, className: `${prefix}--main-navigation__wrapper` }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation__logo-wrapper` }, { children: [jsxRuntimeExports.jsx(MobileButton$1, Object.assign({ toggleMenu: toggleMenu, prefix: prefix, openMobileMenu: openMobileMenu }, { children: "Menu" })), jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--main-navigation__logo` }, { children: logo }))] })), jsxRuntimeExports.jsx("ul", Object.assign({ className: listClasses }, { children: children }))] })) })) })));
|
|
2632
1682
|
};
|
|
2633
1683
|
MainNavigation.displayName = "MainNavigation";
|
|
2634
1684
|
|
|
2635
|
-
/** The User is used inside the MainNavigation and form, and can display an avatar and username. */
|
|
2636
|
-
const User = (props) => {
|
|
2637
|
-
const { className, children, components = {}, description, ellipsis, extendedDescription, showName, small, name, missingImage } = props, other = __rest(props, ["className", "children", "components", "description", "ellipsis", "extendedDescription", "showName", "small", "name", "missingImage"]);
|
|
2638
|
-
const { prefix } = useSettings();
|
|
2639
|
-
const defaultComponents = { Avatar };
|
|
2640
|
-
const allComponents = Object.assign(Object.assign({}, defaultComponents), components);
|
|
2641
|
-
const classes = classNames(`${prefix}--user`, className, {
|
|
2642
|
-
[`${prefix}--user--has-description`]: description,
|
|
2643
|
-
[`${prefix}--user--has-extended-description`]: extendedDescription,
|
|
2644
|
-
});
|
|
2645
|
-
const titleClasses = classNames({
|
|
2646
|
-
[`${prefix}--user__title`]: true,
|
|
2647
|
-
[`${prefix}--user__title--ellipsis`]: ellipsis,
|
|
2648
|
-
[`${prefix}--user__title--small`]: small,
|
|
2649
|
-
});
|
|
2650
|
-
return (jsxRuntimeExports.jsxs("div", Object.assign({ className: classes }, other, { children: [jsxRuntimeExports.jsx(allComponents.Avatar, Object.assign({}, props, { missingImage: missingImage })), showName && (jsxRuntimeExports.jsxs("span", Object.assign({ className: titleClasses }, { children: [jsxRuntimeExports.jsx("span", { children: name }), description && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--user__description` }, { children: description })))] }))), children, extendedDescription && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--user__extended-description` }, { children: extendedDescription })))] })));
|
|
2651
|
-
};
|
|
2652
|
-
|
|
2653
|
-
/**
|
|
2654
|
-
* useTogglable(): hook used to open/close boolean state.
|
|
2655
|
-
*/
|
|
2656
|
-
var useTogglable = function useTogglable() {
|
|
2657
|
-
var _useState = useState(false),
|
|
2658
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
2659
|
-
isOpen = _useState2[0],
|
|
2660
|
-
setState = _useState2[1];
|
|
2661
|
-
var open = function open() {
|
|
2662
|
-
return setState(true);
|
|
2663
|
-
};
|
|
2664
|
-
var close = function close() {
|
|
2665
|
-
return setState(false);
|
|
2666
|
-
};
|
|
2667
|
-
return {
|
|
2668
|
-
isOpen: isOpen,
|
|
2669
|
-
open: open,
|
|
2670
|
-
close: close
|
|
2671
|
-
};
|
|
2672
|
-
};
|
|
2673
|
-
|
|
2674
|
-
const LanguageExternal = ({ children, primaryLanguage }) => {
|
|
2675
|
-
const { prefix } = useSettings();
|
|
2676
|
-
const ref = useRef(null);
|
|
2677
|
-
const languageTogglable = useTogglable();
|
|
2678
|
-
useEffect(() => {
|
|
2679
|
-
const checkIfClickedOutside = (e) => {
|
|
2680
|
-
// If the menu is open and the clicked target is not within the menu,
|
|
2681
|
-
// then close the menu
|
|
2682
|
-
if (languageTogglable.isOpen &&
|
|
2683
|
-
ref.current &&
|
|
2684
|
-
!ref.current.contains(e.target)) {
|
|
2685
|
-
languageTogglable.close();
|
|
2686
|
-
}
|
|
2687
|
-
};
|
|
2688
|
-
document.addEventListener("mousedown", checkIfClickedOutside);
|
|
2689
|
-
return () => {
|
|
2690
|
-
// Cleanup the event listener
|
|
2691
|
-
document.removeEventListener("mousedown", checkIfClickedOutside);
|
|
2692
|
-
};
|
|
2693
|
-
}, [languageTogglable.isOpen]);
|
|
2694
|
-
return (jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--language-ext`, ref: ref }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--language-ext__trigger`, role: "presentation", onClick: () => languageTogglable.isOpen
|
|
2695
|
-
? languageTogglable.close()
|
|
2696
|
-
: languageTogglable.open() }, { children: [jsxRuntimeExports.jsx("span", { children: primaryLanguage }), languageTogglable.isOpen ? jsxRuntimeExports.jsx(ChevronUp, {}) : jsxRuntimeExports.jsx(ChevronDown, {})] })), jsxRuntimeExports.jsx("ul", Object.assign({ className: `${prefix}--language-ext__dropdown ${languageTogglable.isOpen
|
|
2697
|
-
? `${prefix}--language-ext__dropdown--is-shown`
|
|
2698
|
-
: ""}` }, { children: children }))] })));
|
|
2699
|
-
};
|
|
2700
|
-
const UserExternal = ({ username, children, userImage }) => {
|
|
2701
|
-
const { prefix } = useSettings();
|
|
2702
|
-
const ref = useRef(null);
|
|
2703
|
-
const userTogglable = useTogglable();
|
|
2704
|
-
useEffect(() => {
|
|
2705
|
-
const checkIfClickedOutside = (e) => {
|
|
2706
|
-
// If the menu is open and the clicked target is not within the menu,
|
|
2707
|
-
// then close the menu
|
|
2708
|
-
if (userTogglable.isOpen &&
|
|
2709
|
-
(ref === null || ref === void 0 ? void 0 : ref.current) &&
|
|
2710
|
-
!ref.current.contains(e.target)) {
|
|
2711
|
-
userTogglable.close();
|
|
2712
|
-
}
|
|
2713
|
-
};
|
|
2714
|
-
document.addEventListener("mousedown", checkIfClickedOutside);
|
|
2715
|
-
return () => {
|
|
2716
|
-
// Cleanup the event listener
|
|
2717
|
-
document.removeEventListener("mousedown", checkIfClickedOutside);
|
|
2718
|
-
};
|
|
2719
|
-
}, [userTogglable.isOpen]);
|
|
2720
|
-
return (jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--user-ext`, ref: ref }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--user-ext__trigger`, role: "presentation", onClick: () => userTogglable.isOpen ? userTogglable.close() : userTogglable.open() }, { children: [jsxRuntimeExports.jsx(User, { alt: "User avatar", name: username, image: userImage }), userTogglable.isOpen ? jsxRuntimeExports.jsx(ChevronUp, {}) : jsxRuntimeExports.jsx(ChevronDown, {})] })), jsxRuntimeExports.jsx("ul", Object.assign({ className: `${prefix}--user-ext__dropdown ${userTogglable.isOpen ? `${prefix}--user-ext__dropdown--is-shown` : ""}` }, { children: children }))] })));
|
|
2721
|
-
};
|
|
2722
|
-
const MainNavigationExternal = ({ productName, primaryLanguage, languageList, username, pageWidth = "full", components = {}, userImage, userDetails, children, }) => {
|
|
2723
|
-
const { prefix } = useSettings();
|
|
2724
|
-
const ref = useRef(null);
|
|
2725
|
-
const navTogglable = useTogglable();
|
|
2726
|
-
useEffect(() => {
|
|
2727
|
-
const checkIfClickedOutside = (e) => {
|
|
2728
|
-
// If the menu is open and the clicked target is not within the menu,
|
|
2729
|
-
// then close the menu
|
|
2730
|
-
if (navTogglable.isOpen &&
|
|
2731
|
-
ref.current &&
|
|
2732
|
-
!ref.current.contains(e.target)) {
|
|
2733
|
-
navTogglable.close();
|
|
2734
|
-
}
|
|
2735
|
-
};
|
|
2736
|
-
document.addEventListener("mousedown", checkIfClickedOutside);
|
|
2737
|
-
return () => {
|
|
2738
|
-
// Cleanup the event listener
|
|
2739
|
-
document.removeEventListener("mousedown", checkIfClickedOutside);
|
|
2740
|
-
};
|
|
2741
|
-
}, [navTogglable.isOpen]);
|
|
2742
|
-
const defaultComponents = {
|
|
2743
|
-
LanguageExternal,
|
|
2744
|
-
UserExternal,
|
|
2745
|
-
};
|
|
2746
|
-
const c = Object.assign(Object.assign({}, defaultComponents), components);
|
|
2747
|
-
return (jsxRuntimeExports.jsx("header", Object.assign({ className: `${prefix}--main-navigation-ext` }, { children: jsxRuntimeExports.jsxs(Wrapper, Object.assign({ pageWidth: pageWidth, className: `${prefix}--main-navigation-ext__wrapper` }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation-ext__branding` }, { children: [jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--main-navigation-ext__wfp-logo` }, { children: jsxRuntimeExports.jsx(WfpLogoVerticalEn, { className: `${prefix}--main-navigation-ext__wfp-logo-svg`, alt: "WFP", width: "100%" }) })), jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--main-navigation-ext__product-name` }, { children: productName }))] })), jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation-ext__main` }, { children: [jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation-ext__settings` }, { children: [jsxRuntimeExports.jsx(c.LanguageExternal, Object.assign({ primaryLanguage: primaryLanguage }, { children: languageList })), jsxRuntimeExports.jsx(c.UserExternal, Object.assign({ username: username, userImage: userImage }, { children: userDetails }))] })), jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation-ext__nav`, ref: ref }, { children: [jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--main-navigation-ext__mobile-menu-button` }, { children: jsxRuntimeExports.jsx(Button, Object.assign({ kind: "secondary", small: true, onClick: () => navTogglable.isOpen
|
|
2748
|
-
? navTogglable.close()
|
|
2749
|
-
: navTogglable.open() }, { children: "Menu" })) })), jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--main-navigation-ext__nav-wrapper
|
|
2750
|
-
${navTogglable.isOpen ? "wfp--main-navigation-ext--is-shown" : ""}` }, { children: jsxRuntimeExports.jsx("nav", Object.assign({ className: `${prefix}--main-navigation-ext__site-nav ${navTogglable.isOpen
|
|
2751
|
-
? "wfp--main-navigation-ext--is-shown"
|
|
2752
|
-
: ""}` }, { children: jsxRuntimeExports.jsxs("ul", Object.assign({ className: `${prefix}--main-navigation-ext__site-nav-list` }, { children: [children, jsxRuntimeExports.jsxs("div", Object.assign({ className: `${prefix}--main-navigation-ext__mobile-settings` }, { children: [jsxRuntimeExports.jsx("li", Object.assign({ className: `${prefix}--main-navigation-ext__site-link` }, { children: jsxRuntimeExports.jsx(LanguageExternal, Object.assign({ primaryLanguage: primaryLanguage }, { children: languageList })) })), jsxRuntimeExports.jsx("li", Object.assign({ className: `${prefix}--main-navigation-ext__site-link` }, { children: jsxRuntimeExports.jsx(UserExternal, Object.assign({ username: username, userImage: userImage }, { children: userDetails })) }))] }))] })) })) }))] }))] }))] })) })));
|
|
2753
|
-
};
|
|
2754
|
-
MainNavigationExternal.propTypes = {
|
|
2755
|
-
/**
|
|
2756
|
-
* The name of your product can be applied to this prop
|
|
2757
|
-
*/
|
|
2758
|
-
productName: PropTypes.node,
|
|
2759
|
-
/**
|
|
2760
|
-
* The CSS class name to be placed on the wrapping element.
|
|
2761
|
-
*/
|
|
2762
|
-
className: PropTypes.string,
|
|
2763
|
-
/**
|
|
2764
|
-
* List of laguages your site support
|
|
2765
|
-
*/
|
|
2766
|
-
languageList: PropTypes.node,
|
|
2767
|
-
/**
|
|
2768
|
-
* The name of signed in user can be applied to this prop
|
|
2769
|
-
*/
|
|
2770
|
-
username: PropTypes.node,
|
|
2771
|
-
/**
|
|
2772
|
-
* The image of signed in user can be applied to this prop
|
|
2773
|
-
*/
|
|
2774
|
-
userImage: PropTypes.string,
|
|
2775
|
-
/**
|
|
2776
|
-
* The dropdown details of user can be applied to this prop
|
|
2777
|
-
*/
|
|
2778
|
-
userDetails: PropTypes.node,
|
|
2779
|
-
/**
|
|
2780
|
-
* This prop accepts the first language your website is in. Default: English
|
|
2781
|
-
*/
|
|
2782
|
-
primaryLanguage: PropTypes.string,
|
|
2783
|
-
};
|
|
2784
|
-
MainNavigationExternal.defaultProps = {
|
|
2785
|
-
primaryLanguage: "English",
|
|
2786
|
-
};
|
|
2787
|
-
|
|
2788
1685
|
/** The useMainNavigation() is a hook to access the current state of the MainNavigation and manipulate it. */
|
|
2789
1686
|
function useMainNavigation() {
|
|
2790
1687
|
const settings = useContext(MainNavigationContext);
|
|
@@ -4290,6 +3187,24 @@ const Toggle = React.forwardRef((props, ref) => {
|
|
|
4290
3187
|
});
|
|
4291
3188
|
Toggle.displayName = "Toggle";
|
|
4292
3189
|
|
|
3190
|
+
/** The User is used inside the MainNavigation and form, and can display an avatar and username. */
|
|
3191
|
+
const User = (props) => {
|
|
3192
|
+
const { className, children, components = {}, description, ellipsis, extendedDescription, showName, small, name, missingImage } = props, other = __rest(props, ["className", "children", "components", "description", "ellipsis", "extendedDescription", "showName", "small", "name", "missingImage"]);
|
|
3193
|
+
const { prefix } = useSettings();
|
|
3194
|
+
const defaultComponents = { Avatar };
|
|
3195
|
+
const allComponents = Object.assign(Object.assign({}, defaultComponents), components);
|
|
3196
|
+
const classes = classNames(`${prefix}--user`, className, {
|
|
3197
|
+
[`${prefix}--user--has-description`]: description,
|
|
3198
|
+
[`${prefix}--user--has-extended-description`]: extendedDescription,
|
|
3199
|
+
});
|
|
3200
|
+
const titleClasses = classNames({
|
|
3201
|
+
[`${prefix}--user__title`]: true,
|
|
3202
|
+
[`${prefix}--user__title--ellipsis`]: ellipsis,
|
|
3203
|
+
[`${prefix}--user__title--small`]: small,
|
|
3204
|
+
});
|
|
3205
|
+
return (jsxRuntimeExports.jsxs("div", Object.assign({ className: classes }, other, { children: [jsxRuntimeExports.jsx(allComponents.Avatar, Object.assign({}, props, { missingImage: missingImage })), showName && (jsxRuntimeExports.jsxs("span", Object.assign({ className: titleClasses }, { children: [jsxRuntimeExports.jsx("span", { children: name }), description && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--user__description` }, { children: description })))] }))), children, extendedDescription && (jsxRuntimeExports.jsx("div", Object.assign({ className: `${prefix}--user__extended-description` }, { children: extendedDescription })))] })));
|
|
3206
|
+
};
|
|
3207
|
+
|
|
4293
3208
|
const scaleLookup = {
|
|
4294
3209
|
thousand: {
|
|
4295
3210
|
pow: 1000,
|
|
@@ -5469,4 +4384,4 @@ function useMediaQuery(query, options) {
|
|
|
5469
4384
|
return matches;
|
|
5470
4385
|
}
|
|
5471
4386
|
|
|
5472
|
-
export { Accordion, AccordionItem, AddonAfter, AddonBefore, AuthLayout, Avatar, BackgroundContent, BannerNavigation, BannerNavigationItem, BannerNavigationWithContent, Callout as BlockNotification, Breadcrumb, BreadcrumbHome, BreadcrumbItem, Button, Callout, Card, CardExternal, Checkbox, ContentSwitcher, ContextMenu, ContextMenuGroup, ContextMenuItem, Credits, DatePicker, DatePickerInput, DateRangePicker, DateRangePickerInput, Empty, Footer, FooterExternal, FooterMetaLink, Form, FormGroup, FormHint, FormItem, FormLabel, Helper, Hero, HeroExternal, InfoBar, InlineErrorMessage, InlineLoading, Input, InputGroup, Item, Label, Link, LinksColumn, List, ListItem, Loading, MainNavigation, MainNavigationContext,
|
|
4387
|
+
export { Accordion, AccordionItem, AddonAfter, AddonBefore, AuthLayout, Avatar, BackgroundContent, BannerNavigation, BannerNavigationItem, BannerNavigationWithContent, Callout as BlockNotification, Breadcrumb, BreadcrumbHome, BreadcrumbItem, Button, Callout, Card, CardExternal, Checkbox, ContentSwitcher, ContextMenu, ContextMenuGroup, ContextMenuItem, Credits, DatePicker, DatePickerInput, DateRangePicker, DateRangePickerInput, Empty, Footer, FooterExternal, FooterMetaLink, Form, FormGroup, FormHint, FormItem, FormLabel, Helper, Hero, HeroExternal, InfoBar, InlineErrorMessage, InlineLoading, Input, InputGroup, Item, Label, Link, LinksColumn, List, ListItem, Loading, MainNavigation, MainNavigationContext, MainNavigationItem, Modal, ModalFooter, ModalWrapper, Module, ModuleBody, ModuleFooter, ModuleHeader, NotificationActionButton, NotificationButton, NotificationTextDetails, NumberInput, Pagination, RadioButton, ReadMore, Search, SecondaryNavigation, SecondaryNavigationTitle, Select, SelectItem, SelectItemGroup, Sidebar, SidebarBackButton, SidebarContentBody, SidebarContentHeader, SidebarHeader, SidebarScroll, SkeletonText, Slider, StepNavigation, StepNavigationItem, Story, SubNavigation, SubNavigationContent, SubNavigationFilter, SubNavigationGroup, SubNavigationHeader, SubNavigationItem, SubNavigationLink, SubNavigationList, SubNavigationTitle, Tab, TabContent, Table, ReactTablePagination as TablePagination, TableSorting$1 as TableSorting, Tabs, Tag, Text, TextArea, TextInput, ToastNotification, Toggle, Tooltip, Unit, User, Value, WFPCoreContext, WFPCoreProvider, Wrapper, buttonKinds, colors, settings as defaultWFPContext, mdxComponents, notificationtypes, pageWidths, tooltipStyle, tooltipStyleDark, uniqueId, useInput, useIsomorphicLayoutEffect, useMainNavigation, useMediaQuery, useTab, useTheme, withWFPCoreSettings };
|