react-router 5.0.1 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/react-router.js +107 -58
- package/cjs/react-router.js.map +1 -0
- package/cjs/react-router.min.js +2 -1
- package/cjs/react-router.min.js.map +1 -0
- package/es/MemoryRouter.js +0 -2
- package/es/Prompt.js +0 -2
- package/es/Redirect.js +0 -2
- package/es/Route.js +0 -2
- package/es/Router.js +0 -2
- package/es/StaticRouter.js +0 -2
- package/es/Switch.js +0 -2
- package/es/generatePath.js +0 -2
- package/es/matchPath.js +0 -2
- package/es/warnAboutDeprecatedESMImport.js +1 -2
- package/es/withRouter.js +0 -2
- package/esm/react-router.js +90 -46
- package/esm/react-router.js.map +1 -0
- package/modules/HistoryContext.js +4 -0
- package/modules/Lifecycle.js +21 -0
- package/modules/MemoryRouter.js +37 -0
- package/modules/Prompt.js +52 -0
- package/modules/Redirect.js +72 -0
- package/modules/Route.js +140 -0
- package/modules/Router.js +88 -0
- package/modules/RouterContext.js +12 -0
- package/modules/StaticRouter.js +102 -0
- package/modules/Switch.js +67 -0
- package/modules/createNameContext.js +11 -0
- package/modules/generatePath.js +27 -0
- package/modules/hooks.js +56 -0
- package/modules/index.js +39 -0
- package/modules/matchPath.js +67 -0
- package/modules/withRouter.js +51 -0
- package/package.json +7 -35
- package/umd/react-router.js +534 -445
- package/umd/react-router.js.map +1 -0
- package/umd/react-router.min.js +2 -1
- package/umd/react-router.min.js.map +1 -0
- package/warnAboutDeprecatedCJSRequire.js +1 -0
package/umd/react-router.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
|
|
4
|
-
(factory(
|
|
5
|
-
}(this,
|
|
4
|
+
(global = global || self, factory(global.ReactRouter = {}, global.React));
|
|
5
|
+
}(this, function (exports, React) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var React__default = 'default' in React ? React['default'] : React;
|
|
8
8
|
|
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
subClass.__proto__ = superClass;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
16
|
-
|
|
17
15
|
function unwrapExports (x) {
|
|
18
16
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
19
17
|
}
|
|
@@ -22,6 +20,307 @@
|
|
|
22
20
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
23
21
|
}
|
|
24
22
|
|
|
23
|
+
var reactIs_production_min = createCommonjsModule(function (module, exports) {
|
|
24
|
+
Object.defineProperty(exports,"__esModule",{value:!0});
|
|
25
|
+
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"):
|
|
26
|
+
60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.fundamental"):60117,w=b?Symbol.for("react.responder"):60118;function x(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case t:case r:case d:return u}}}function y(a){return x(a)===m}exports.typeOf=x;exports.AsyncMode=l;
|
|
27
|
+
exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;
|
|
28
|
+
exports.isValidElementType=function(a){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===v||a.$$typeof===w)};exports.isAsyncMode=function(a){return y(a)||x(a)===l};exports.isConcurrentMode=y;exports.isContextConsumer=function(a){return x(a)===k};exports.isContextProvider=function(a){return x(a)===h};
|
|
29
|
+
exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return x(a)===n};exports.isFragment=function(a){return x(a)===e};exports.isLazy=function(a){return x(a)===t};exports.isMemo=function(a){return x(a)===r};exports.isPortal=function(a){return x(a)===d};exports.isProfiler=function(a){return x(a)===g};exports.isStrictMode=function(a){return x(a)===f};exports.isSuspense=function(a){return x(a)===p};
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
unwrapExports(reactIs_production_min);
|
|
33
|
+
var reactIs_production_min_1 = reactIs_production_min.typeOf;
|
|
34
|
+
var reactIs_production_min_2 = reactIs_production_min.AsyncMode;
|
|
35
|
+
var reactIs_production_min_3 = reactIs_production_min.ConcurrentMode;
|
|
36
|
+
var reactIs_production_min_4 = reactIs_production_min.ContextConsumer;
|
|
37
|
+
var reactIs_production_min_5 = reactIs_production_min.ContextProvider;
|
|
38
|
+
var reactIs_production_min_6 = reactIs_production_min.Element;
|
|
39
|
+
var reactIs_production_min_7 = reactIs_production_min.ForwardRef;
|
|
40
|
+
var reactIs_production_min_8 = reactIs_production_min.Fragment;
|
|
41
|
+
var reactIs_production_min_9 = reactIs_production_min.Lazy;
|
|
42
|
+
var reactIs_production_min_10 = reactIs_production_min.Memo;
|
|
43
|
+
var reactIs_production_min_11 = reactIs_production_min.Portal;
|
|
44
|
+
var reactIs_production_min_12 = reactIs_production_min.Profiler;
|
|
45
|
+
var reactIs_production_min_13 = reactIs_production_min.StrictMode;
|
|
46
|
+
var reactIs_production_min_14 = reactIs_production_min.Suspense;
|
|
47
|
+
var reactIs_production_min_15 = reactIs_production_min.isValidElementType;
|
|
48
|
+
var reactIs_production_min_16 = reactIs_production_min.isAsyncMode;
|
|
49
|
+
var reactIs_production_min_17 = reactIs_production_min.isConcurrentMode;
|
|
50
|
+
var reactIs_production_min_18 = reactIs_production_min.isContextConsumer;
|
|
51
|
+
var reactIs_production_min_19 = reactIs_production_min.isContextProvider;
|
|
52
|
+
var reactIs_production_min_20 = reactIs_production_min.isElement;
|
|
53
|
+
var reactIs_production_min_21 = reactIs_production_min.isForwardRef;
|
|
54
|
+
var reactIs_production_min_22 = reactIs_production_min.isFragment;
|
|
55
|
+
var reactIs_production_min_23 = reactIs_production_min.isLazy;
|
|
56
|
+
var reactIs_production_min_24 = reactIs_production_min.isMemo;
|
|
57
|
+
var reactIs_production_min_25 = reactIs_production_min.isPortal;
|
|
58
|
+
var reactIs_production_min_26 = reactIs_production_min.isProfiler;
|
|
59
|
+
var reactIs_production_min_27 = reactIs_production_min.isStrictMode;
|
|
60
|
+
var reactIs_production_min_28 = reactIs_production_min.isSuspense;
|
|
61
|
+
|
|
62
|
+
var reactIs_development = createCommonjsModule(function (module, exports) {
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
{
|
|
67
|
+
(function() {
|
|
68
|
+
|
|
69
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
70
|
+
|
|
71
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
72
|
+
// nor polyfill, then a plain number is used for performance.
|
|
73
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
74
|
+
|
|
75
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
76
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
77
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
78
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
79
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
80
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
81
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
82
|
+
// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
83
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
84
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
85
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
86
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
87
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
88
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
89
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
90
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
91
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
92
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
93
|
+
|
|
94
|
+
function isValidElementType(type) {
|
|
95
|
+
return typeof type === 'string' || typeof type === 'function' ||
|
|
96
|
+
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
97
|
+
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);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Forked from fbjs/warning:
|
|
102
|
+
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
|
103
|
+
*
|
|
104
|
+
* Only change is we use console.warn instead of console.error,
|
|
105
|
+
* and do nothing when 'console' is not supported.
|
|
106
|
+
* This really simplifies the code.
|
|
107
|
+
* ---
|
|
108
|
+
* Similar to invariant but only logs a warning if the condition is not met.
|
|
109
|
+
* This can be used to log issues in development environments in critical
|
|
110
|
+
* paths. Removing the logging code for production environments will keep the
|
|
111
|
+
* same logic and follow the same code paths.
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
var lowPriorityWarning = function () {};
|
|
115
|
+
|
|
116
|
+
{
|
|
117
|
+
var printWarning = function (format) {
|
|
118
|
+
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
119
|
+
args[_key - 1] = arguments[_key];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
var argIndex = 0;
|
|
123
|
+
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
124
|
+
return args[argIndex++];
|
|
125
|
+
});
|
|
126
|
+
if (typeof console !== 'undefined') {
|
|
127
|
+
console.warn(message);
|
|
128
|
+
}
|
|
129
|
+
try {
|
|
130
|
+
// --- Welcome to debugging React ---
|
|
131
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
132
|
+
// to find the callsite that caused this warning to fire.
|
|
133
|
+
throw new Error(message);
|
|
134
|
+
} catch (x) {}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
lowPriorityWarning = function (condition, format) {
|
|
138
|
+
if (format === undefined) {
|
|
139
|
+
throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
140
|
+
}
|
|
141
|
+
if (!condition) {
|
|
142
|
+
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
143
|
+
args[_key2 - 2] = arguments[_key2];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
printWarning.apply(undefined, [format].concat(args));
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
var lowPriorityWarning$1 = lowPriorityWarning;
|
|
152
|
+
|
|
153
|
+
function typeOf(object) {
|
|
154
|
+
if (typeof object === 'object' && object !== null) {
|
|
155
|
+
var $$typeof = object.$$typeof;
|
|
156
|
+
switch ($$typeof) {
|
|
157
|
+
case REACT_ELEMENT_TYPE:
|
|
158
|
+
var type = object.type;
|
|
159
|
+
|
|
160
|
+
switch (type) {
|
|
161
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
162
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
163
|
+
case REACT_FRAGMENT_TYPE:
|
|
164
|
+
case REACT_PROFILER_TYPE:
|
|
165
|
+
case REACT_STRICT_MODE_TYPE:
|
|
166
|
+
case REACT_SUSPENSE_TYPE:
|
|
167
|
+
return type;
|
|
168
|
+
default:
|
|
169
|
+
var $$typeofType = type && type.$$typeof;
|
|
170
|
+
|
|
171
|
+
switch ($$typeofType) {
|
|
172
|
+
case REACT_CONTEXT_TYPE:
|
|
173
|
+
case REACT_FORWARD_REF_TYPE:
|
|
174
|
+
case REACT_PROVIDER_TYPE:
|
|
175
|
+
return $$typeofType;
|
|
176
|
+
default:
|
|
177
|
+
return $$typeof;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
case REACT_LAZY_TYPE:
|
|
181
|
+
case REACT_MEMO_TYPE:
|
|
182
|
+
case REACT_PORTAL_TYPE:
|
|
183
|
+
return $$typeof;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return undefined;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// AsyncMode is deprecated along with isAsyncMode
|
|
191
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
192
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
193
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
194
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
195
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
196
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
197
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
198
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
199
|
+
var Memo = REACT_MEMO_TYPE;
|
|
200
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
201
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
202
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
203
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
204
|
+
|
|
205
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
206
|
+
|
|
207
|
+
// AsyncMode should be deprecated
|
|
208
|
+
function isAsyncMode(object) {
|
|
209
|
+
{
|
|
210
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
211
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
212
|
+
lowPriorityWarning$1(false, '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.');
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
216
|
+
}
|
|
217
|
+
function isConcurrentMode(object) {
|
|
218
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
219
|
+
}
|
|
220
|
+
function isContextConsumer(object) {
|
|
221
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
222
|
+
}
|
|
223
|
+
function isContextProvider(object) {
|
|
224
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
225
|
+
}
|
|
226
|
+
function isElement(object) {
|
|
227
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
228
|
+
}
|
|
229
|
+
function isForwardRef(object) {
|
|
230
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
231
|
+
}
|
|
232
|
+
function isFragment(object) {
|
|
233
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
234
|
+
}
|
|
235
|
+
function isLazy(object) {
|
|
236
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
237
|
+
}
|
|
238
|
+
function isMemo(object) {
|
|
239
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
240
|
+
}
|
|
241
|
+
function isPortal(object) {
|
|
242
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
243
|
+
}
|
|
244
|
+
function isProfiler(object) {
|
|
245
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
246
|
+
}
|
|
247
|
+
function isStrictMode(object) {
|
|
248
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
249
|
+
}
|
|
250
|
+
function isSuspense(object) {
|
|
251
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
exports.typeOf = typeOf;
|
|
255
|
+
exports.AsyncMode = AsyncMode;
|
|
256
|
+
exports.ConcurrentMode = ConcurrentMode;
|
|
257
|
+
exports.ContextConsumer = ContextConsumer;
|
|
258
|
+
exports.ContextProvider = ContextProvider;
|
|
259
|
+
exports.Element = Element;
|
|
260
|
+
exports.ForwardRef = ForwardRef;
|
|
261
|
+
exports.Fragment = Fragment;
|
|
262
|
+
exports.Lazy = Lazy;
|
|
263
|
+
exports.Memo = Memo;
|
|
264
|
+
exports.Portal = Portal;
|
|
265
|
+
exports.Profiler = Profiler;
|
|
266
|
+
exports.StrictMode = StrictMode;
|
|
267
|
+
exports.Suspense = Suspense;
|
|
268
|
+
exports.isValidElementType = isValidElementType;
|
|
269
|
+
exports.isAsyncMode = isAsyncMode;
|
|
270
|
+
exports.isConcurrentMode = isConcurrentMode;
|
|
271
|
+
exports.isContextConsumer = isContextConsumer;
|
|
272
|
+
exports.isContextProvider = isContextProvider;
|
|
273
|
+
exports.isElement = isElement;
|
|
274
|
+
exports.isForwardRef = isForwardRef;
|
|
275
|
+
exports.isFragment = isFragment;
|
|
276
|
+
exports.isLazy = isLazy;
|
|
277
|
+
exports.isMemo = isMemo;
|
|
278
|
+
exports.isPortal = isPortal;
|
|
279
|
+
exports.isProfiler = isProfiler;
|
|
280
|
+
exports.isStrictMode = isStrictMode;
|
|
281
|
+
exports.isSuspense = isSuspense;
|
|
282
|
+
})();
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
unwrapExports(reactIs_development);
|
|
287
|
+
var reactIs_development_1 = reactIs_development.typeOf;
|
|
288
|
+
var reactIs_development_2 = reactIs_development.AsyncMode;
|
|
289
|
+
var reactIs_development_3 = reactIs_development.ConcurrentMode;
|
|
290
|
+
var reactIs_development_4 = reactIs_development.ContextConsumer;
|
|
291
|
+
var reactIs_development_5 = reactIs_development.ContextProvider;
|
|
292
|
+
var reactIs_development_6 = reactIs_development.Element;
|
|
293
|
+
var reactIs_development_7 = reactIs_development.ForwardRef;
|
|
294
|
+
var reactIs_development_8 = reactIs_development.Fragment;
|
|
295
|
+
var reactIs_development_9 = reactIs_development.Lazy;
|
|
296
|
+
var reactIs_development_10 = reactIs_development.Memo;
|
|
297
|
+
var reactIs_development_11 = reactIs_development.Portal;
|
|
298
|
+
var reactIs_development_12 = reactIs_development.Profiler;
|
|
299
|
+
var reactIs_development_13 = reactIs_development.StrictMode;
|
|
300
|
+
var reactIs_development_14 = reactIs_development.Suspense;
|
|
301
|
+
var reactIs_development_15 = reactIs_development.isValidElementType;
|
|
302
|
+
var reactIs_development_16 = reactIs_development.isAsyncMode;
|
|
303
|
+
var reactIs_development_17 = reactIs_development.isConcurrentMode;
|
|
304
|
+
var reactIs_development_18 = reactIs_development.isContextConsumer;
|
|
305
|
+
var reactIs_development_19 = reactIs_development.isContextProvider;
|
|
306
|
+
var reactIs_development_20 = reactIs_development.isElement;
|
|
307
|
+
var reactIs_development_21 = reactIs_development.isForwardRef;
|
|
308
|
+
var reactIs_development_22 = reactIs_development.isFragment;
|
|
309
|
+
var reactIs_development_23 = reactIs_development.isLazy;
|
|
310
|
+
var reactIs_development_24 = reactIs_development.isMemo;
|
|
311
|
+
var reactIs_development_25 = reactIs_development.isPortal;
|
|
312
|
+
var reactIs_development_26 = reactIs_development.isProfiler;
|
|
313
|
+
var reactIs_development_27 = reactIs_development.isStrictMode;
|
|
314
|
+
var reactIs_development_28 = reactIs_development.isSuspense;
|
|
315
|
+
|
|
316
|
+
var reactIs = createCommonjsModule(function (module) {
|
|
317
|
+
|
|
318
|
+
{
|
|
319
|
+
module.exports = reactIs_development;
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
var reactIs_1 = reactIs.isValidElementType;
|
|
323
|
+
|
|
25
324
|
/*
|
|
26
325
|
object-assign
|
|
27
326
|
(c) Sindre Sorhus
|
|
@@ -127,6 +426,7 @@
|
|
|
127
426
|
{
|
|
128
427
|
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
129
428
|
var loggedTypeFailures = {};
|
|
429
|
+
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
130
430
|
|
|
131
431
|
printWarning = function(text) {
|
|
132
432
|
var message = 'Warning: ' + text;
|
|
@@ -156,7 +456,7 @@
|
|
|
156
456
|
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
157
457
|
{
|
|
158
458
|
for (var typeSpecName in typeSpecs) {
|
|
159
|
-
if (typeSpecs
|
|
459
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
160
460
|
var error;
|
|
161
461
|
// Prop type validation may throw. In case they do, we don't want to
|
|
162
462
|
// fail the render phase where it didn't fail before. So we log it.
|
|
@@ -185,7 +485,6 @@
|
|
|
185
485
|
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
186
486
|
'shape all require an argument).'
|
|
187
487
|
);
|
|
188
|
-
|
|
189
488
|
}
|
|
190
489
|
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
191
490
|
// Only monitor this failure once because there tends to be a lot of the
|
|
@@ -203,8 +502,20 @@
|
|
|
203
502
|
}
|
|
204
503
|
}
|
|
205
504
|
|
|
505
|
+
/**
|
|
506
|
+
* Resets warning cache when testing.
|
|
507
|
+
*
|
|
508
|
+
* @private
|
|
509
|
+
*/
|
|
510
|
+
checkPropTypes.resetWarningCache = function() {
|
|
511
|
+
{
|
|
512
|
+
loggedTypeFailures = {};
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
|
|
206
516
|
var checkPropTypes_1 = checkPropTypes;
|
|
207
517
|
|
|
518
|
+
var has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
208
519
|
var printWarning$1 = function() {};
|
|
209
520
|
|
|
210
521
|
{
|
|
@@ -315,6 +626,7 @@
|
|
|
315
626
|
any: createAnyTypeChecker(),
|
|
316
627
|
arrayOf: createArrayOfTypeChecker,
|
|
317
628
|
element: createElementTypeChecker(),
|
|
629
|
+
elementType: createElementTypeTypeChecker(),
|
|
318
630
|
instanceOf: createInstanceTypeChecker,
|
|
319
631
|
node: createNodeChecker(),
|
|
320
632
|
objectOf: createObjectOfTypeChecker,
|
|
@@ -375,7 +687,7 @@
|
|
|
375
687
|
);
|
|
376
688
|
err.name = 'Invariant Violation';
|
|
377
689
|
throw err;
|
|
378
|
-
} else if (typeof console !== 'undefined') {
|
|
690
|
+
} else if ( typeof console !== 'undefined') {
|
|
379
691
|
// Old behavior for people using React.PropTypes
|
|
380
692
|
var cacheKey = componentName + ':' + propName;
|
|
381
693
|
if (
|
|
@@ -468,6 +780,18 @@
|
|
|
468
780
|
return createChainableTypeChecker(validate);
|
|
469
781
|
}
|
|
470
782
|
|
|
783
|
+
function createElementTypeTypeChecker() {
|
|
784
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
785
|
+
var propValue = props[propName];
|
|
786
|
+
if (!reactIs.isValidElementType(propValue)) {
|
|
787
|
+
var propType = getPropType(propValue);
|
|
788
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
789
|
+
}
|
|
790
|
+
return null;
|
|
791
|
+
}
|
|
792
|
+
return createChainableTypeChecker(validate);
|
|
793
|
+
}
|
|
794
|
+
|
|
471
795
|
function createInstanceTypeChecker(expectedClass) {
|
|
472
796
|
function validate(props, propName, componentName, location, propFullName) {
|
|
473
797
|
if (!(props[propName] instanceof expectedClass)) {
|
|
@@ -482,7 +806,16 @@
|
|
|
482
806
|
|
|
483
807
|
function createEnumTypeChecker(expectedValues) {
|
|
484
808
|
if (!Array.isArray(expectedValues)) {
|
|
485
|
-
|
|
809
|
+
{
|
|
810
|
+
if (arguments.length > 1) {
|
|
811
|
+
printWarning$1(
|
|
812
|
+
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
813
|
+
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
814
|
+
);
|
|
815
|
+
} else {
|
|
816
|
+
printWarning$1('Invalid argument supplied to oneOf, expected an array.');
|
|
817
|
+
}
|
|
818
|
+
}
|
|
486
819
|
return emptyFunctionThatReturnsNull;
|
|
487
820
|
}
|
|
488
821
|
|
|
@@ -494,8 +827,14 @@
|
|
|
494
827
|
}
|
|
495
828
|
}
|
|
496
829
|
|
|
497
|
-
var valuesString = JSON.stringify(expectedValues)
|
|
498
|
-
|
|
830
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
831
|
+
var type = getPreciseType(value);
|
|
832
|
+
if (type === 'symbol') {
|
|
833
|
+
return String(value);
|
|
834
|
+
}
|
|
835
|
+
return value;
|
|
836
|
+
});
|
|
837
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
499
838
|
}
|
|
500
839
|
return createChainableTypeChecker(validate);
|
|
501
840
|
}
|
|
@@ -511,7 +850,7 @@
|
|
|
511
850
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
512
851
|
}
|
|
513
852
|
for (var key in propValue) {
|
|
514
|
-
if (propValue
|
|
853
|
+
if (has$1(propValue, key)) {
|
|
515
854
|
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
|
516
855
|
if (error instanceof Error) {
|
|
517
856
|
return error;
|
|
@@ -525,7 +864,7 @@
|
|
|
525
864
|
|
|
526
865
|
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
527
866
|
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
528
|
-
|
|
867
|
+
printWarning$1('Invalid argument supplied to oneOfType, expected an instance of array.') ;
|
|
529
868
|
return emptyFunctionThatReturnsNull;
|
|
530
869
|
}
|
|
531
870
|
|
|
@@ -668,6 +1007,11 @@
|
|
|
668
1007
|
return true;
|
|
669
1008
|
}
|
|
670
1009
|
|
|
1010
|
+
// falsy value can't be a Symbol
|
|
1011
|
+
if (!propValue) {
|
|
1012
|
+
return false;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
671
1015
|
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
672
1016
|
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
673
1017
|
return true;
|
|
@@ -742,6 +1086,7 @@
|
|
|
742
1086
|
}
|
|
743
1087
|
|
|
744
1088
|
ReactPropTypes.checkPropTypes = checkPropTypes_1;
|
|
1089
|
+
ReactPropTypes.resetWarningCache = checkPropTypes_1.resetWarningCache;
|
|
745
1090
|
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
746
1091
|
|
|
747
1092
|
return ReactPropTypes;
|
|
@@ -756,21 +1101,12 @@
|
|
|
756
1101
|
*/
|
|
757
1102
|
|
|
758
1103
|
{
|
|
759
|
-
var
|
|
760
|
-
Symbol.for &&
|
|
761
|
-
Symbol.for('react.element')) ||
|
|
762
|
-
0xeac7;
|
|
763
|
-
|
|
764
|
-
var isValidElement = function(object) {
|
|
765
|
-
return typeof object === 'object' &&
|
|
766
|
-
object !== null &&
|
|
767
|
-
object.$$typeof === REACT_ELEMENT_TYPE;
|
|
768
|
-
};
|
|
1104
|
+
var ReactIs = reactIs;
|
|
769
1105
|
|
|
770
1106
|
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
771
1107
|
// http://fb.me/prop-types-in-prod
|
|
772
1108
|
var throwOnDirectAccess = true;
|
|
773
|
-
module.exports = factoryWithTypeCheckers(
|
|
1109
|
+
module.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
|
|
774
1110
|
}
|
|
775
1111
|
});
|
|
776
1112
|
|
|
@@ -904,8 +1240,16 @@
|
|
|
904
1240
|
return;
|
|
905
1241
|
}
|
|
906
1242
|
|
|
907
|
-
|
|
908
|
-
|
|
1243
|
+
var text = "Warning: " + message;
|
|
1244
|
+
|
|
1245
|
+
if (typeof console !== 'undefined') {
|
|
1246
|
+
console.warn(text);
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
try {
|
|
1250
|
+
throw Error(text);
|
|
1251
|
+
} catch (x) {}
|
|
1252
|
+
}
|
|
909
1253
|
}
|
|
910
1254
|
|
|
911
1255
|
var prefix = 'Invariant failed';
|
|
@@ -1016,7 +1360,7 @@
|
|
|
1016
1360
|
var prompt = null;
|
|
1017
1361
|
|
|
1018
1362
|
function setPrompt(nextPrompt) {
|
|
1019
|
-
|
|
1363
|
+
warning(prompt == null, 'A history supports only one prompt at a time') ;
|
|
1020
1364
|
prompt = nextPrompt;
|
|
1021
1365
|
return function () {
|
|
1022
1366
|
if (prompt === nextPrompt) prompt = null;
|
|
@@ -1034,7 +1378,7 @@
|
|
|
1034
1378
|
if (typeof getUserConfirmation === 'function') {
|
|
1035
1379
|
getUserConfirmation(result, callback);
|
|
1036
1380
|
} else {
|
|
1037
|
-
|
|
1381
|
+
warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message') ;
|
|
1038
1382
|
callback(true);
|
|
1039
1383
|
}
|
|
1040
1384
|
} else {
|
|
@@ -1126,7 +1470,7 @@
|
|
|
1126
1470
|
var createHref = createPath;
|
|
1127
1471
|
|
|
1128
1472
|
function push(path, state) {
|
|
1129
|
-
|
|
1473
|
+
warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') ;
|
|
1130
1474
|
var action = 'PUSH';
|
|
1131
1475
|
var location = createLocation(path, state, createKey(), history.location);
|
|
1132
1476
|
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
@@ -1151,7 +1495,7 @@
|
|
|
1151
1495
|
}
|
|
1152
1496
|
|
|
1153
1497
|
function replace(path, state) {
|
|
1154
|
-
|
|
1498
|
+
warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') ;
|
|
1155
1499
|
var action = 'REPLACE';
|
|
1156
1500
|
var location = createLocation(path, state, createKey(), history.location);
|
|
1157
1501
|
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
|
@@ -1227,62 +1571,20 @@
|
|
|
1227
1571
|
return history;
|
|
1228
1572
|
}
|
|
1229
1573
|
|
|
1230
|
-
var key = '__global_unique_id__';
|
|
1231
|
-
|
|
1232
|
-
var gud = function() {
|
|
1233
|
-
return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;
|
|
1234
|
-
};
|
|
1235
|
-
|
|
1236
|
-
function warning$1(condition, message) {
|
|
1237
|
-
{
|
|
1238
|
-
if (condition) {
|
|
1239
|
-
return;
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
var text = "Warning: " + message;
|
|
1243
|
-
|
|
1244
|
-
if (typeof console !== 'undefined') {
|
|
1245
|
-
console.warn(text);
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
try {
|
|
1249
|
-
throw Error(text);
|
|
1250
|
-
} catch (x) {}
|
|
1251
|
-
}
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
function _defineProperty(obj, key, value) {
|
|
1255
|
-
if (key in obj) {
|
|
1256
|
-
Object.defineProperty(obj, key, {
|
|
1257
|
-
value: value,
|
|
1258
|
-
enumerable: true,
|
|
1259
|
-
configurable: true,
|
|
1260
|
-
writable: true
|
|
1261
|
-
});
|
|
1262
|
-
} else {
|
|
1263
|
-
obj[key] = value;
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
return obj;
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
1574
|
function _inheritsLoose$1(subClass, superClass) {
|
|
1270
1575
|
subClass.prototype = Object.create(superClass.prototype);
|
|
1271
1576
|
subClass.prototype.constructor = subClass;
|
|
1272
1577
|
subClass.__proto__ = superClass;
|
|
1273
1578
|
}
|
|
1274
1579
|
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1278
|
-
}
|
|
1580
|
+
var MAX_SIGNED_31_BIT_INT = 1073741823;
|
|
1581
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {};
|
|
1279
1582
|
|
|
1280
|
-
|
|
1583
|
+
function getUniqueId() {
|
|
1584
|
+
var key = '__global_unique_id__';
|
|
1585
|
+
return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;
|
|
1281
1586
|
}
|
|
1282
1587
|
|
|
1283
|
-
var MAX_SIGNED_31_BIT_INT = 1073741823; // Inlined Object.is polyfill.
|
|
1284
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
1285
|
-
|
|
1286
1588
|
function objectIs(x, y) {
|
|
1287
1589
|
if (x === y) {
|
|
1288
1590
|
return x !== 0 || 1 / x === 1 / y;
|
|
@@ -1319,26 +1621,18 @@
|
|
|
1319
1621
|
}
|
|
1320
1622
|
|
|
1321
1623
|
function createReactContext(defaultValue, calculateChangedBits) {
|
|
1322
|
-
var
|
|
1624
|
+
var _Provider$childContex, _Consumer$contextType;
|
|
1323
1625
|
|
|
1324
|
-
var contextProp = '__create-react-context-' +
|
|
1626
|
+
var contextProp = '__create-react-context-' + getUniqueId() + '__';
|
|
1325
1627
|
|
|
1326
|
-
var Provider =
|
|
1327
|
-
/*#__PURE__*/
|
|
1328
|
-
function (_Component) {
|
|
1628
|
+
var Provider = /*#__PURE__*/function (_Component) {
|
|
1329
1629
|
_inheritsLoose$1(Provider, _Component);
|
|
1330
1630
|
|
|
1331
1631
|
function Provider() {
|
|
1332
1632
|
var _this;
|
|
1333
1633
|
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
|
-
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
|
|
1339
|
-
|
|
1340
|
-
_defineProperty(_assertThisInitialized(_this), "emitter", createEventEmitter(_this.props.value));
|
|
1341
|
-
|
|
1634
|
+
_this = _Component.apply(this, arguments) || this;
|
|
1635
|
+
_this.emitter = createEventEmitter(_this.props.value);
|
|
1342
1636
|
return _this;
|
|
1343
1637
|
}
|
|
1344
1638
|
|
|
@@ -1357,12 +1651,12 @@
|
|
|
1357
1651
|
var changedBits;
|
|
1358
1652
|
|
|
1359
1653
|
if (objectIs(oldValue, newValue)) {
|
|
1360
|
-
changedBits = 0;
|
|
1654
|
+
changedBits = 0;
|
|
1361
1655
|
} else {
|
|
1362
1656
|
changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
|
|
1363
1657
|
|
|
1364
1658
|
{
|
|
1365
|
-
warning
|
|
1659
|
+
warning((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: ' + changedBits);
|
|
1366
1660
|
}
|
|
1367
1661
|
|
|
1368
1662
|
changedBits |= 0;
|
|
@@ -1381,29 +1675,20 @@
|
|
|
1381
1675
|
return Provider;
|
|
1382
1676
|
}(React.Component);
|
|
1383
1677
|
|
|
1384
|
-
|
|
1678
|
+
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = propTypes.object.isRequired, _Provider$childContex);
|
|
1385
1679
|
|
|
1386
|
-
var Consumer =
|
|
1387
|
-
/*#__PURE__*/
|
|
1388
|
-
function (_Component2) {
|
|
1680
|
+
var Consumer = /*#__PURE__*/function (_Component2) {
|
|
1389
1681
|
_inheritsLoose$1(Consumer, _Component2);
|
|
1390
1682
|
|
|
1391
1683
|
function Consumer() {
|
|
1392
1684
|
var _this2;
|
|
1393
1685
|
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
|
-
_this2 = _Component2.call.apply(_Component2, [this].concat(args)) || this;
|
|
1399
|
-
|
|
1400
|
-
_defineProperty(_assertThisInitialized(_this2), "observedBits", void 0);
|
|
1401
|
-
|
|
1402
|
-
_defineProperty(_assertThisInitialized(_this2), "state", {
|
|
1686
|
+
_this2 = _Component2.apply(this, arguments) || this;
|
|
1687
|
+
_this2.state = {
|
|
1403
1688
|
value: _this2.getValue()
|
|
1404
|
-
}
|
|
1689
|
+
};
|
|
1405
1690
|
|
|
1406
|
-
|
|
1691
|
+
_this2.onUpdate = function (newValue, changedBits) {
|
|
1407
1692
|
var observedBits = _this2.observedBits | 0;
|
|
1408
1693
|
|
|
1409
1694
|
if ((observedBits & changedBits) !== 0) {
|
|
@@ -1411,7 +1696,7 @@
|
|
|
1411
1696
|
value: _this2.getValue()
|
|
1412
1697
|
});
|
|
1413
1698
|
}
|
|
1414
|
-
}
|
|
1699
|
+
};
|
|
1415
1700
|
|
|
1416
1701
|
return _this2;
|
|
1417
1702
|
}
|
|
@@ -1420,8 +1705,7 @@
|
|
|
1420
1705
|
|
|
1421
1706
|
_proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
1422
1707
|
var observedBits = nextProps.observedBits;
|
|
1423
|
-
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT
|
|
1424
|
-
: observedBits;
|
|
1708
|
+
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
|
|
1425
1709
|
};
|
|
1426
1710
|
|
|
1427
1711
|
_proto2.componentDidMount = function componentDidMount() {
|
|
@@ -1430,8 +1714,7 @@
|
|
|
1430
1714
|
}
|
|
1431
1715
|
|
|
1432
1716
|
var observedBits = this.props.observedBits;
|
|
1433
|
-
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT
|
|
1434
|
-
: observedBits;
|
|
1717
|
+
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
|
|
1435
1718
|
};
|
|
1436
1719
|
|
|
1437
1720
|
_proto2.componentWillUnmount = function componentWillUnmount() {
|
|
@@ -1455,8 +1738,7 @@
|
|
|
1455
1738
|
return Consumer;
|
|
1456
1739
|
}(React.Component);
|
|
1457
1740
|
|
|
1458
|
-
|
|
1459
|
-
|
|
1741
|
+
Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = propTypes.object, _Consumer$contextType);
|
|
1460
1742
|
return {
|
|
1461
1743
|
Provider: Provider,
|
|
1462
1744
|
Consumer: Consumer
|
|
@@ -1473,9 +1755,21 @@
|
|
|
1473
1755
|
return context;
|
|
1474
1756
|
};
|
|
1475
1757
|
|
|
1758
|
+
var historyContext =
|
|
1759
|
+
/*#__PURE__*/
|
|
1760
|
+
createNamedContext("Router-History");
|
|
1761
|
+
|
|
1762
|
+
// TODO: Replace with React.createContext once we can assume React 16+
|
|
1763
|
+
|
|
1764
|
+
var createNamedContext$1 = function createNamedContext(name) {
|
|
1765
|
+
var context = index();
|
|
1766
|
+
context.displayName = name;
|
|
1767
|
+
return context;
|
|
1768
|
+
};
|
|
1769
|
+
|
|
1476
1770
|
var context =
|
|
1477
1771
|
/*#__PURE__*/
|
|
1478
|
-
createNamedContext("Router");
|
|
1772
|
+
createNamedContext$1("Router");
|
|
1479
1773
|
|
|
1480
1774
|
/**
|
|
1481
1775
|
* The public API for putting history on context.
|
|
@@ -1543,14 +1837,16 @@
|
|
|
1543
1837
|
|
|
1544
1838
|
_proto.render = function render() {
|
|
1545
1839
|
return React__default.createElement(context.Provider, {
|
|
1546
|
-
children: this.props.children || null,
|
|
1547
1840
|
value: {
|
|
1548
1841
|
history: this.props.history,
|
|
1549
1842
|
location: this.state.location,
|
|
1550
1843
|
match: Router.computeRootMatch(this.state.location.pathname),
|
|
1551
1844
|
staticContext: this.props.staticContext
|
|
1552
1845
|
}
|
|
1553
|
-
}
|
|
1846
|
+
}, React__default.createElement(historyContext.Provider, {
|
|
1847
|
+
children: this.props.children || null,
|
|
1848
|
+
value: this.props.history
|
|
1849
|
+
}));
|
|
1554
1850
|
};
|
|
1555
1851
|
|
|
1556
1852
|
return Router;
|
|
@@ -1564,7 +1860,7 @@
|
|
|
1564
1860
|
};
|
|
1565
1861
|
|
|
1566
1862
|
Router.prototype.componentDidUpdate = function (prevProps) {
|
|
1567
|
-
|
|
1863
|
+
warning(prevProps.history === this.props.history, "You cannot change <Router history>") ;
|
|
1568
1864
|
};
|
|
1569
1865
|
}
|
|
1570
1866
|
|
|
@@ -1611,7 +1907,7 @@
|
|
|
1611
1907
|
};
|
|
1612
1908
|
|
|
1613
1909
|
MemoryRouter.prototype.componentDidMount = function () {
|
|
1614
|
-
|
|
1910
|
+
warning(!this.props.history, "<MemoryRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`.") ;
|
|
1615
1911
|
};
|
|
1616
1912
|
}
|
|
1617
1913
|
|
|
@@ -1653,10 +1949,10 @@
|
|
|
1653
1949
|
var message = _ref.message,
|
|
1654
1950
|
_ref$when = _ref.when,
|
|
1655
1951
|
when = _ref$when === void 0 ? true : _ref$when;
|
|
1656
|
-
return React__default.createElement(context.Consumer, null, function (context
|
|
1657
|
-
!context
|
|
1658
|
-
if (!when || context
|
|
1659
|
-
var method = context
|
|
1952
|
+
return React__default.createElement(context.Consumer, null, function (context) {
|
|
1953
|
+
!context ? invariant(false, "You should not use <Prompt> outside a <Router>") : void 0;
|
|
1954
|
+
if (!when || context.staticContext) return null;
|
|
1955
|
+
var method = context.history.block;
|
|
1660
1956
|
return React__default.createElement(Lifecycle, {
|
|
1661
1957
|
onMount: function onMount(self) {
|
|
1662
1958
|
self.release = method(message);
|
|
@@ -2159,10 +2455,10 @@
|
|
|
2159
2455
|
to = _ref.to,
|
|
2160
2456
|
_ref$push = _ref.push,
|
|
2161
2457
|
push = _ref$push === void 0 ? false : _ref$push;
|
|
2162
|
-
return React__default.createElement(context.Consumer, null, function (context
|
|
2163
|
-
!context
|
|
2164
|
-
var history = context
|
|
2165
|
-
staticContext = context
|
|
2458
|
+
return React__default.createElement(context.Consumer, null, function (context) {
|
|
2459
|
+
!context ? invariant(false, "You should not use <Redirect> outside a <Router>") : void 0;
|
|
2460
|
+
var history = context.history,
|
|
2461
|
+
staticContext = context.staticContext;
|
|
2166
2462
|
var method = push ? history.push : history.replace;
|
|
2167
2463
|
var location = createLocation(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : _extends({}, to, {
|
|
2168
2464
|
pathname: generatePath(to.pathname, computedMatch.params)
|
|
@@ -2200,267 +2496,6 @@
|
|
|
2200
2496
|
};
|
|
2201
2497
|
}
|
|
2202
2498
|
|
|
2203
|
-
var reactIs_production_min = createCommonjsModule(function (module, exports) {
|
|
2204
|
-
Object.defineProperty(exports,"__esModule",{value:!0});
|
|
2205
|
-
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.concurrent_mode"):60111,m=b?Symbol.for("react.forward_ref"):60112,n=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"):60115,r=b?Symbol.for("react.lazy"):
|
|
2206
|
-
60116;function t(a){if("object"===typeof a&&null!==a){var p=a.$$typeof;switch(p){case c:switch(a=a.type,a){case l:case e:case g:case f:return a;default:switch(a=a&&a.$$typeof,a){case k:case m:case h:return a;default:return p}}case d:return p}}}function u(a){return t(a)===l}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=l;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=m;exports.Fragment=e;exports.Profiler=g;exports.Portal=d;
|
|
2207
|
-
exports.StrictMode=f;exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===l||a===g||a===f||a===n||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===m)};exports.isAsyncMode=function(a){return u(a)};exports.isConcurrentMode=u;exports.isContextConsumer=function(a){return t(a)===k};exports.isContextProvider=function(a){return t(a)===h};
|
|
2208
|
-
exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===m};exports.isFragment=function(a){return t(a)===e};exports.isProfiler=function(a){return t(a)===g};exports.isPortal=function(a){return t(a)===d};exports.isStrictMode=function(a){return t(a)===f};
|
|
2209
|
-
});
|
|
2210
|
-
|
|
2211
|
-
unwrapExports(reactIs_production_min);
|
|
2212
|
-
var reactIs_production_min_1 = reactIs_production_min.typeOf;
|
|
2213
|
-
var reactIs_production_min_2 = reactIs_production_min.AsyncMode;
|
|
2214
|
-
var reactIs_production_min_3 = reactIs_production_min.ConcurrentMode;
|
|
2215
|
-
var reactIs_production_min_4 = reactIs_production_min.ContextConsumer;
|
|
2216
|
-
var reactIs_production_min_5 = reactIs_production_min.ContextProvider;
|
|
2217
|
-
var reactIs_production_min_6 = reactIs_production_min.Element;
|
|
2218
|
-
var reactIs_production_min_7 = reactIs_production_min.ForwardRef;
|
|
2219
|
-
var reactIs_production_min_8 = reactIs_production_min.Fragment;
|
|
2220
|
-
var reactIs_production_min_9 = reactIs_production_min.Profiler;
|
|
2221
|
-
var reactIs_production_min_10 = reactIs_production_min.Portal;
|
|
2222
|
-
var reactIs_production_min_11 = reactIs_production_min.StrictMode;
|
|
2223
|
-
var reactIs_production_min_12 = reactIs_production_min.isValidElementType;
|
|
2224
|
-
var reactIs_production_min_13 = reactIs_production_min.isAsyncMode;
|
|
2225
|
-
var reactIs_production_min_14 = reactIs_production_min.isConcurrentMode;
|
|
2226
|
-
var reactIs_production_min_15 = reactIs_production_min.isContextConsumer;
|
|
2227
|
-
var reactIs_production_min_16 = reactIs_production_min.isContextProvider;
|
|
2228
|
-
var reactIs_production_min_17 = reactIs_production_min.isElement;
|
|
2229
|
-
var reactIs_production_min_18 = reactIs_production_min.isForwardRef;
|
|
2230
|
-
var reactIs_production_min_19 = reactIs_production_min.isFragment;
|
|
2231
|
-
var reactIs_production_min_20 = reactIs_production_min.isProfiler;
|
|
2232
|
-
var reactIs_production_min_21 = reactIs_production_min.isPortal;
|
|
2233
|
-
var reactIs_production_min_22 = reactIs_production_min.isStrictMode;
|
|
2234
|
-
|
|
2235
|
-
var reactIs_development = createCommonjsModule(function (module, exports) {
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
{
|
|
2240
|
-
(function() {
|
|
2241
|
-
|
|
2242
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2243
|
-
|
|
2244
|
-
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
2245
|
-
// nor polyfill, then a plain number is used for performance.
|
|
2246
|
-
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
2247
|
-
|
|
2248
|
-
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
2249
|
-
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
2250
|
-
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
2251
|
-
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
2252
|
-
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
2253
|
-
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
2254
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
2255
|
-
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
2256
|
-
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
2257
|
-
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
2258
|
-
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
2259
|
-
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
2260
|
-
|
|
2261
|
-
function isValidElementType(type) {
|
|
2262
|
-
return typeof type === 'string' || typeof type === 'function' ||
|
|
2263
|
-
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
2264
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_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);
|
|
2265
|
-
}
|
|
2266
|
-
|
|
2267
|
-
/**
|
|
2268
|
-
* Forked from fbjs/warning:
|
|
2269
|
-
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
|
2270
|
-
*
|
|
2271
|
-
* Only change is we use console.warn instead of console.error,
|
|
2272
|
-
* and do nothing when 'console' is not supported.
|
|
2273
|
-
* This really simplifies the code.
|
|
2274
|
-
* ---
|
|
2275
|
-
* Similar to invariant but only logs a warning if the condition is not met.
|
|
2276
|
-
* This can be used to log issues in development environments in critical
|
|
2277
|
-
* paths. Removing the logging code for production environments will keep the
|
|
2278
|
-
* same logic and follow the same code paths.
|
|
2279
|
-
*/
|
|
2280
|
-
|
|
2281
|
-
var lowPriorityWarning = function () {};
|
|
2282
|
-
|
|
2283
|
-
{
|
|
2284
|
-
var printWarning = function (format) {
|
|
2285
|
-
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
2286
|
-
args[_key - 1] = arguments[_key];
|
|
2287
|
-
}
|
|
2288
|
-
|
|
2289
|
-
var argIndex = 0;
|
|
2290
|
-
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
2291
|
-
return args[argIndex++];
|
|
2292
|
-
});
|
|
2293
|
-
if (typeof console !== 'undefined') {
|
|
2294
|
-
console.warn(message);
|
|
2295
|
-
}
|
|
2296
|
-
try {
|
|
2297
|
-
// --- Welcome to debugging React ---
|
|
2298
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
2299
|
-
// to find the callsite that caused this warning to fire.
|
|
2300
|
-
throw new Error(message);
|
|
2301
|
-
} catch (x) {}
|
|
2302
|
-
};
|
|
2303
|
-
|
|
2304
|
-
lowPriorityWarning = function (condition, format) {
|
|
2305
|
-
if (format === undefined) {
|
|
2306
|
-
throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
2307
|
-
}
|
|
2308
|
-
if (!condition) {
|
|
2309
|
-
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
2310
|
-
args[_key2 - 2] = arguments[_key2];
|
|
2311
|
-
}
|
|
2312
|
-
|
|
2313
|
-
printWarning.apply(undefined, [format].concat(args));
|
|
2314
|
-
}
|
|
2315
|
-
};
|
|
2316
|
-
}
|
|
2317
|
-
|
|
2318
|
-
var lowPriorityWarning$1 = lowPriorityWarning;
|
|
2319
|
-
|
|
2320
|
-
function typeOf(object) {
|
|
2321
|
-
if (typeof object === 'object' && object !== null) {
|
|
2322
|
-
var $$typeof = object.$$typeof;
|
|
2323
|
-
|
|
2324
|
-
switch ($$typeof) {
|
|
2325
|
-
case REACT_ELEMENT_TYPE:
|
|
2326
|
-
var type = object.type;
|
|
2327
|
-
|
|
2328
|
-
switch (type) {
|
|
2329
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
2330
|
-
case REACT_FRAGMENT_TYPE:
|
|
2331
|
-
case REACT_PROFILER_TYPE:
|
|
2332
|
-
case REACT_STRICT_MODE_TYPE:
|
|
2333
|
-
return type;
|
|
2334
|
-
default:
|
|
2335
|
-
var $$typeofType = type && type.$$typeof;
|
|
2336
|
-
|
|
2337
|
-
switch ($$typeofType) {
|
|
2338
|
-
case REACT_CONTEXT_TYPE:
|
|
2339
|
-
case REACT_FORWARD_REF_TYPE:
|
|
2340
|
-
case REACT_PROVIDER_TYPE:
|
|
2341
|
-
return $$typeofType;
|
|
2342
|
-
default:
|
|
2343
|
-
return $$typeof;
|
|
2344
|
-
}
|
|
2345
|
-
}
|
|
2346
|
-
case REACT_PORTAL_TYPE:
|
|
2347
|
-
return $$typeof;
|
|
2348
|
-
}
|
|
2349
|
-
}
|
|
2350
|
-
|
|
2351
|
-
return undefined;
|
|
2352
|
-
}
|
|
2353
|
-
|
|
2354
|
-
// AsyncMode alias is deprecated along with isAsyncMode
|
|
2355
|
-
var AsyncMode = REACT_CONCURRENT_MODE_TYPE;
|
|
2356
|
-
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
2357
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
2358
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
2359
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
2360
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
2361
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
2362
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
2363
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
2364
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
2365
|
-
|
|
2366
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
2367
|
-
|
|
2368
|
-
// AsyncMode should be deprecated
|
|
2369
|
-
function isAsyncMode(object) {
|
|
2370
|
-
{
|
|
2371
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
2372
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
2373
|
-
lowPriorityWarning$1(false, '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.');
|
|
2374
|
-
}
|
|
2375
|
-
}
|
|
2376
|
-
return isConcurrentMode(object);
|
|
2377
|
-
}
|
|
2378
|
-
function isConcurrentMode(object) {
|
|
2379
|
-
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
2380
|
-
}
|
|
2381
|
-
function isContextConsumer(object) {
|
|
2382
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
2383
|
-
}
|
|
2384
|
-
function isContextProvider(object) {
|
|
2385
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
2386
|
-
}
|
|
2387
|
-
function isElement(object) {
|
|
2388
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
2389
|
-
}
|
|
2390
|
-
function isForwardRef(object) {
|
|
2391
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
2392
|
-
}
|
|
2393
|
-
function isFragment(object) {
|
|
2394
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
2395
|
-
}
|
|
2396
|
-
function isProfiler(object) {
|
|
2397
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
2398
|
-
}
|
|
2399
|
-
function isPortal(object) {
|
|
2400
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
2401
|
-
}
|
|
2402
|
-
function isStrictMode(object) {
|
|
2403
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
2404
|
-
}
|
|
2405
|
-
|
|
2406
|
-
exports.typeOf = typeOf;
|
|
2407
|
-
exports.AsyncMode = AsyncMode;
|
|
2408
|
-
exports.ConcurrentMode = ConcurrentMode;
|
|
2409
|
-
exports.ContextConsumer = ContextConsumer;
|
|
2410
|
-
exports.ContextProvider = ContextProvider;
|
|
2411
|
-
exports.Element = Element;
|
|
2412
|
-
exports.ForwardRef = ForwardRef;
|
|
2413
|
-
exports.Fragment = Fragment;
|
|
2414
|
-
exports.Profiler = Profiler;
|
|
2415
|
-
exports.Portal = Portal;
|
|
2416
|
-
exports.StrictMode = StrictMode;
|
|
2417
|
-
exports.isValidElementType = isValidElementType;
|
|
2418
|
-
exports.isAsyncMode = isAsyncMode;
|
|
2419
|
-
exports.isConcurrentMode = isConcurrentMode;
|
|
2420
|
-
exports.isContextConsumer = isContextConsumer;
|
|
2421
|
-
exports.isContextProvider = isContextProvider;
|
|
2422
|
-
exports.isElement = isElement;
|
|
2423
|
-
exports.isForwardRef = isForwardRef;
|
|
2424
|
-
exports.isFragment = isFragment;
|
|
2425
|
-
exports.isProfiler = isProfiler;
|
|
2426
|
-
exports.isPortal = isPortal;
|
|
2427
|
-
exports.isStrictMode = isStrictMode;
|
|
2428
|
-
})();
|
|
2429
|
-
}
|
|
2430
|
-
});
|
|
2431
|
-
|
|
2432
|
-
unwrapExports(reactIs_development);
|
|
2433
|
-
var reactIs_development_1 = reactIs_development.typeOf;
|
|
2434
|
-
var reactIs_development_2 = reactIs_development.AsyncMode;
|
|
2435
|
-
var reactIs_development_3 = reactIs_development.ConcurrentMode;
|
|
2436
|
-
var reactIs_development_4 = reactIs_development.ContextConsumer;
|
|
2437
|
-
var reactIs_development_5 = reactIs_development.ContextProvider;
|
|
2438
|
-
var reactIs_development_6 = reactIs_development.Element;
|
|
2439
|
-
var reactIs_development_7 = reactIs_development.ForwardRef;
|
|
2440
|
-
var reactIs_development_8 = reactIs_development.Fragment;
|
|
2441
|
-
var reactIs_development_9 = reactIs_development.Profiler;
|
|
2442
|
-
var reactIs_development_10 = reactIs_development.Portal;
|
|
2443
|
-
var reactIs_development_11 = reactIs_development.StrictMode;
|
|
2444
|
-
var reactIs_development_12 = reactIs_development.isValidElementType;
|
|
2445
|
-
var reactIs_development_13 = reactIs_development.isAsyncMode;
|
|
2446
|
-
var reactIs_development_14 = reactIs_development.isConcurrentMode;
|
|
2447
|
-
var reactIs_development_15 = reactIs_development.isContextConsumer;
|
|
2448
|
-
var reactIs_development_16 = reactIs_development.isContextProvider;
|
|
2449
|
-
var reactIs_development_17 = reactIs_development.isElement;
|
|
2450
|
-
var reactIs_development_18 = reactIs_development.isForwardRef;
|
|
2451
|
-
var reactIs_development_19 = reactIs_development.isFragment;
|
|
2452
|
-
var reactIs_development_20 = reactIs_development.isProfiler;
|
|
2453
|
-
var reactIs_development_21 = reactIs_development.isPortal;
|
|
2454
|
-
var reactIs_development_22 = reactIs_development.isStrictMode;
|
|
2455
|
-
|
|
2456
|
-
var reactIs = createCommonjsModule(function (module) {
|
|
2457
|
-
|
|
2458
|
-
{
|
|
2459
|
-
module.exports = reactIs_development;
|
|
2460
|
-
}
|
|
2461
|
-
});
|
|
2462
|
-
var reactIs_1 = reactIs.isValidElementType;
|
|
2463
|
-
|
|
2464
2499
|
var cache$1 = {};
|
|
2465
2500
|
var cacheLimit$1 = 10000;
|
|
2466
2501
|
var cacheCount$1 = 0;
|
|
@@ -2493,9 +2528,12 @@
|
|
|
2493
2528
|
options = {};
|
|
2494
2529
|
}
|
|
2495
2530
|
|
|
2496
|
-
if (typeof options === "string"
|
|
2497
|
-
|
|
2498
|
-
|
|
2531
|
+
if (typeof options === "string" || Array.isArray(options)) {
|
|
2532
|
+
options = {
|
|
2533
|
+
path: options
|
|
2534
|
+
};
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2499
2537
|
var _options = options,
|
|
2500
2538
|
path = _options.path,
|
|
2501
2539
|
_options$exact = _options.exact,
|
|
@@ -2506,7 +2544,7 @@
|
|
|
2506
2544
|
sensitive = _options$sensitive === void 0 ? false : _options$sensitive;
|
|
2507
2545
|
var paths = [].concat(path);
|
|
2508
2546
|
return paths.reduce(function (matched, path) {
|
|
2509
|
-
if (!path) return null;
|
|
2547
|
+
if (!path && path !== "") return null;
|
|
2510
2548
|
if (matched) return matched;
|
|
2511
2549
|
|
|
2512
2550
|
var _compilePath = compilePath$1(path, {
|
|
@@ -2541,6 +2579,12 @@
|
|
|
2541
2579
|
function isEmptyChildren(children) {
|
|
2542
2580
|
return React__default.Children.count(children) === 0;
|
|
2543
2581
|
}
|
|
2582
|
+
|
|
2583
|
+
function evalChildrenDev(children, props, path) {
|
|
2584
|
+
var value = children(props);
|
|
2585
|
+
warning(value !== undefined, "You returned `undefined` from the `children` function of " + ("<Route" + (path ? " path=\"" + path + "\"" : "") + ">, but you ") + "should have returned a React element or `null`") ;
|
|
2586
|
+
return value || null;
|
|
2587
|
+
}
|
|
2544
2588
|
/**
|
|
2545
2589
|
* The public API for matching a single path and rendering.
|
|
2546
2590
|
*/
|
|
@@ -2560,13 +2604,13 @@
|
|
|
2560
2604
|
_proto.render = function render() {
|
|
2561
2605
|
var _this = this;
|
|
2562
2606
|
|
|
2563
|
-
return React__default.createElement(context.Consumer, null, function (context
|
|
2564
|
-
!context
|
|
2565
|
-
var location = _this.props.location || context
|
|
2607
|
+
return React__default.createElement(context.Consumer, null, function (context$1) {
|
|
2608
|
+
!context$1 ? invariant(false, "You should not use <Route> outside a <Router>") : void 0;
|
|
2609
|
+
var location = _this.props.location || context$1.location;
|
|
2566
2610
|
var match = _this.props.computedMatch ? _this.props.computedMatch // <Switch> already computed the match for us
|
|
2567
|
-
: _this.props.path ? matchPath(location.pathname, _this.props) : context
|
|
2611
|
+
: _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match;
|
|
2568
2612
|
|
|
2569
|
-
var props = _extends({}, context
|
|
2613
|
+
var props = _extends({}, context$1, {
|
|
2570
2614
|
location: location,
|
|
2571
2615
|
match: match
|
|
2572
2616
|
});
|
|
@@ -2581,22 +2625,9 @@
|
|
|
2581
2625
|
children = null;
|
|
2582
2626
|
}
|
|
2583
2627
|
|
|
2584
|
-
if (typeof children === "function") {
|
|
2585
|
-
children = children(props);
|
|
2586
|
-
|
|
2587
|
-
if (children === undefined) {
|
|
2588
|
-
{
|
|
2589
|
-
var path = _this.props.path;
|
|
2590
|
-
warning(false, "You returned `undefined` from the `children` function of " + ("<Route" + (path ? " path=\"" + path + "\"" : "") + ">, but you ") + "should have returned a React element or `null`");
|
|
2591
|
-
}
|
|
2592
|
-
|
|
2593
|
-
children = null;
|
|
2594
|
-
}
|
|
2595
|
-
}
|
|
2596
|
-
|
|
2597
2628
|
return React__default.createElement(context.Provider, {
|
|
2598
2629
|
value: props
|
|
2599
|
-
},
|
|
2630
|
+
}, props.match ? children ? typeof children === "function" ? evalChildrenDev(children, props, _this.props.path) : children : component ? React__default.createElement(component, props) : render ? render(props) : null : typeof children === "function" ? evalChildrenDev(children, props, _this.props.path) : null);
|
|
2600
2631
|
});
|
|
2601
2632
|
};
|
|
2602
2633
|
|
|
@@ -2620,14 +2651,14 @@
|
|
|
2620
2651
|
};
|
|
2621
2652
|
|
|
2622
2653
|
Route.prototype.componentDidMount = function () {
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2654
|
+
warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.component), "You should not use <Route component> and <Route children> in the same route; <Route component> will be ignored") ;
|
|
2655
|
+
warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.render), "You should not use <Route render> and <Route children> in the same route; <Route render> will be ignored") ;
|
|
2656
|
+
warning(!(this.props.component && this.props.render), "You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored") ;
|
|
2626
2657
|
};
|
|
2627
2658
|
|
|
2628
2659
|
Route.prototype.componentDidUpdate = function (prevProps) {
|
|
2629
|
-
|
|
2630
|
-
|
|
2660
|
+
warning(!(this.props.location && !prevProps.location), '<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.') ;
|
|
2661
|
+
warning(!(!this.props.location && prevProps.location), '<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.') ;
|
|
2631
2662
|
};
|
|
2632
2663
|
}
|
|
2633
2664
|
|
|
@@ -2646,20 +2677,20 @@
|
|
|
2646
2677
|
return target;
|
|
2647
2678
|
}
|
|
2648
2679
|
|
|
2649
|
-
function addLeadingSlash
|
|
2680
|
+
function addLeadingSlash(path) {
|
|
2650
2681
|
return path.charAt(0) === "/" ? path : "/" + path;
|
|
2651
2682
|
}
|
|
2652
2683
|
|
|
2653
2684
|
function addBasename(basename, location) {
|
|
2654
2685
|
if (!basename) return location;
|
|
2655
2686
|
return _extends({}, location, {
|
|
2656
|
-
pathname: addLeadingSlash
|
|
2687
|
+
pathname: addLeadingSlash(basename) + location.pathname
|
|
2657
2688
|
});
|
|
2658
2689
|
}
|
|
2659
2690
|
|
|
2660
|
-
function stripBasename
|
|
2691
|
+
function stripBasename(basename, location) {
|
|
2661
2692
|
if (!basename) return location;
|
|
2662
|
-
var base = addLeadingSlash
|
|
2693
|
+
var base = addLeadingSlash(basename);
|
|
2663
2694
|
if (location.pathname.indexOf(base) !== 0) return location;
|
|
2664
2695
|
return _extends({}, location, {
|
|
2665
2696
|
pathname: location.pathname.substr(base.length)
|
|
@@ -2672,7 +2703,7 @@
|
|
|
2672
2703
|
|
|
2673
2704
|
function staticHandler(methodName) {
|
|
2674
2705
|
return function () {
|
|
2675
|
-
|
|
2706
|
+
invariant(false, "You cannot %s with <StaticRouter>") ;
|
|
2676
2707
|
};
|
|
2677
2708
|
}
|
|
2678
2709
|
|
|
@@ -2743,15 +2774,15 @@
|
|
|
2743
2774
|
|
|
2744
2775
|
var history = {
|
|
2745
2776
|
createHref: function createHref(path) {
|
|
2746
|
-
return addLeadingSlash
|
|
2777
|
+
return addLeadingSlash(basename + createURL(path));
|
|
2747
2778
|
},
|
|
2748
2779
|
action: "POP",
|
|
2749
|
-
location: stripBasename
|
|
2780
|
+
location: stripBasename(basename, createLocation(location)),
|
|
2750
2781
|
push: this.handlePush,
|
|
2751
2782
|
replace: this.handleReplace,
|
|
2752
|
-
go: staticHandler(
|
|
2753
|
-
goBack: staticHandler(
|
|
2754
|
-
goForward: staticHandler(
|
|
2783
|
+
go: staticHandler(),
|
|
2784
|
+
goBack: staticHandler(),
|
|
2785
|
+
goForward: staticHandler(),
|
|
2755
2786
|
listen: this.handleListen,
|
|
2756
2787
|
block: this.handleBlock
|
|
2757
2788
|
};
|
|
@@ -2772,7 +2803,7 @@
|
|
|
2772
2803
|
};
|
|
2773
2804
|
|
|
2774
2805
|
StaticRouter.prototype.componentDidMount = function () {
|
|
2775
|
-
|
|
2806
|
+
warning(!this.props.history, "<StaticRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`.") ;
|
|
2776
2807
|
};
|
|
2777
2808
|
}
|
|
2778
2809
|
|
|
@@ -2794,9 +2825,9 @@
|
|
|
2794
2825
|
_proto.render = function render() {
|
|
2795
2826
|
var _this = this;
|
|
2796
2827
|
|
|
2797
|
-
return React__default.createElement(context.Consumer, null, function (context
|
|
2798
|
-
!context
|
|
2799
|
-
var location = _this.props.location || context
|
|
2828
|
+
return React__default.createElement(context.Consumer, null, function (context) {
|
|
2829
|
+
!context ? invariant(false, "You should not use <Switch> outside a <Router>") : void 0;
|
|
2830
|
+
var location = _this.props.location || context.location;
|
|
2800
2831
|
var element, match; // We use React.Children.forEach instead of React.Children.toArray().find()
|
|
2801
2832
|
// here because toArray adds keys to all child elements and we do not want
|
|
2802
2833
|
// to trigger an unmount/remount for two <Route>s that render the same
|
|
@@ -2808,7 +2839,7 @@
|
|
|
2808
2839
|
var path = child.props.path || child.props.from;
|
|
2809
2840
|
match = path ? matchPath(location.pathname, _extends({}, child.props, {
|
|
2810
2841
|
path: path
|
|
2811
|
-
})) : context
|
|
2842
|
+
})) : context.match;
|
|
2812
2843
|
}
|
|
2813
2844
|
});
|
|
2814
2845
|
return match ? React__default.cloneElement(element, {
|
|
@@ -2828,8 +2859,8 @@
|
|
|
2828
2859
|
};
|
|
2829
2860
|
|
|
2830
2861
|
Switch.prototype.componentDidUpdate = function (prevProps) {
|
|
2831
|
-
|
|
2832
|
-
|
|
2862
|
+
warning(!(this.props.location && !prevProps.location), '<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.') ;
|
|
2863
|
+
warning(!(!this.props.location && prevProps.location), '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.') ;
|
|
2833
2864
|
};
|
|
2834
2865
|
}
|
|
2835
2866
|
|
|
@@ -2838,7 +2869,6 @@
|
|
|
2838
2869
|
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
|
2839
2870
|
*/
|
|
2840
2871
|
|
|
2841
|
-
|
|
2842
2872
|
var REACT_STATICS = {
|
|
2843
2873
|
childContextTypes: true,
|
|
2844
2874
|
contextType: true,
|
|
@@ -2846,6 +2876,7 @@
|
|
|
2846
2876
|
defaultProps: true,
|
|
2847
2877
|
displayName: true,
|
|
2848
2878
|
getDefaultProps: true,
|
|
2879
|
+
getDerivedStateFromError: true,
|
|
2849
2880
|
getDerivedStateFromProps: true,
|
|
2850
2881
|
mixins: true,
|
|
2851
2882
|
propTypes: true,
|
|
@@ -2864,12 +2895,31 @@
|
|
|
2864
2895
|
|
|
2865
2896
|
var FORWARD_REF_STATICS = {
|
|
2866
2897
|
'$$typeof': true,
|
|
2867
|
-
render: true
|
|
2898
|
+
render: true,
|
|
2899
|
+
defaultProps: true,
|
|
2900
|
+
displayName: true,
|
|
2901
|
+
propTypes: true
|
|
2902
|
+
};
|
|
2903
|
+
|
|
2904
|
+
var MEMO_STATICS = {
|
|
2905
|
+
'$$typeof': true,
|
|
2906
|
+
compare: true,
|
|
2907
|
+
defaultProps: true,
|
|
2908
|
+
displayName: true,
|
|
2909
|
+
propTypes: true,
|
|
2910
|
+
type: true
|
|
2868
2911
|
};
|
|
2869
2912
|
|
|
2870
2913
|
var TYPE_STATICS = {};
|
|
2871
2914
|
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
2872
2915
|
|
|
2916
|
+
function getStatics(component) {
|
|
2917
|
+
if (reactIs.isMemo(component)) {
|
|
2918
|
+
return MEMO_STATICS;
|
|
2919
|
+
}
|
|
2920
|
+
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2873
2923
|
var defineProperty = Object.defineProperty;
|
|
2874
2924
|
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
2875
2925
|
var getOwnPropertySymbols$1 = Object.getOwnPropertySymbols;
|
|
@@ -2894,8 +2944,8 @@
|
|
|
2894
2944
|
keys = keys.concat(getOwnPropertySymbols$1(sourceComponent));
|
|
2895
2945
|
}
|
|
2896
2946
|
|
|
2897
|
-
var targetStatics =
|
|
2898
|
-
var sourceStatics =
|
|
2947
|
+
var targetStatics = getStatics(targetComponent);
|
|
2948
|
+
var sourceStatics = getStatics(sourceComponent);
|
|
2899
2949
|
|
|
2900
2950
|
for (var i = 0; i < keys.length; ++i) {
|
|
2901
2951
|
var key = keys[i];
|
|
@@ -2927,9 +2977,9 @@
|
|
|
2927
2977
|
var wrappedComponentRef = props.wrappedComponentRef,
|
|
2928
2978
|
remainingProps = _objectWithoutPropertiesLoose(props, ["wrappedComponentRef"]);
|
|
2929
2979
|
|
|
2930
|
-
return React__default.createElement(context.Consumer, null, function (context
|
|
2931
|
-
!context
|
|
2932
|
-
return React__default.createElement(Component, _extends({}, remainingProps, context
|
|
2980
|
+
return React__default.createElement(context.Consumer, null, function (context) {
|
|
2981
|
+
!context ? invariant(false, "You should not use <" + displayName + " /> outside a <Router>") : void 0;
|
|
2982
|
+
return React__default.createElement(Component, _extends({}, remainingProps, context, {
|
|
2933
2983
|
ref: wrappedComponentRef
|
|
2934
2984
|
}));
|
|
2935
2985
|
});
|
|
@@ -2947,25 +2997,58 @@
|
|
|
2947
2997
|
return hoistNonReactStatics_cjs(C, Component);
|
|
2948
2998
|
}
|
|
2949
2999
|
|
|
3000
|
+
var useContext = React__default.useContext;
|
|
3001
|
+
function useHistory() {
|
|
3002
|
+
{
|
|
3003
|
+
!(typeof useContext === "function") ? invariant(false, "You must use React >= 16.8 in order to use useHistory()") : void 0;
|
|
3004
|
+
}
|
|
3005
|
+
|
|
3006
|
+
return useContext(historyContext);
|
|
3007
|
+
}
|
|
3008
|
+
function useLocation() {
|
|
3009
|
+
{
|
|
3010
|
+
!(typeof useContext === "function") ? invariant(false, "You must use React >= 16.8 in order to use useLocation()") : void 0;
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
return useContext(context).location;
|
|
3014
|
+
}
|
|
3015
|
+
function useParams() {
|
|
3016
|
+
{
|
|
3017
|
+
!(typeof useContext === "function") ? invariant(false, "You must use React >= 16.8 in order to use useParams()") : void 0;
|
|
3018
|
+
}
|
|
3019
|
+
|
|
3020
|
+
var match = useContext(context).match;
|
|
3021
|
+
return match ? match.params : {};
|
|
3022
|
+
}
|
|
3023
|
+
function useRouteMatch(path) {
|
|
3024
|
+
{
|
|
3025
|
+
!(typeof useContext === "function") ? invariant(false, "You must use React >= 16.8 in order to use useRouteMatch()") : void 0;
|
|
3026
|
+
}
|
|
3027
|
+
|
|
3028
|
+
var location = useLocation();
|
|
3029
|
+
var match = useContext(context).match;
|
|
3030
|
+
return path ? matchPath(location.pathname, path) : match;
|
|
3031
|
+
}
|
|
3032
|
+
|
|
2950
3033
|
{
|
|
2951
3034
|
if (typeof window !== "undefined") {
|
|
2952
3035
|
var global$1 = window;
|
|
2953
|
-
var key
|
|
3036
|
+
var key = "__react_router_build__";
|
|
2954
3037
|
var buildNames = {
|
|
2955
3038
|
cjs: "CommonJS",
|
|
2956
3039
|
esm: "ES modules",
|
|
2957
3040
|
umd: "UMD"
|
|
2958
3041
|
};
|
|
2959
3042
|
|
|
2960
|
-
if (global$1[key
|
|
2961
|
-
var initialBuildName = buildNames[global$1[key
|
|
3043
|
+
if (global$1[key] && global$1[key] !== "umd") {
|
|
3044
|
+
var initialBuildName = buildNames[global$1[key]];
|
|
2962
3045
|
var secondaryBuildName = buildNames["umd"]; // TODO: Add link to article that explains in detail how to avoid
|
|
2963
3046
|
// loading 2 different builds.
|
|
2964
3047
|
|
|
2965
3048
|
throw new Error("You are loading the " + secondaryBuildName + " build of React Router " + ("on a page that is already running the " + initialBuildName + " ") + "build, so things won't work right.");
|
|
2966
3049
|
}
|
|
2967
3050
|
|
|
2968
|
-
global$1[key
|
|
3051
|
+
global$1[key] = "umd";
|
|
2969
3052
|
}
|
|
2970
3053
|
}
|
|
2971
3054
|
|
|
@@ -2976,11 +3059,17 @@
|
|
|
2976
3059
|
exports.Router = Router;
|
|
2977
3060
|
exports.StaticRouter = StaticRouter;
|
|
2978
3061
|
exports.Switch = Switch;
|
|
3062
|
+
exports.__HistoryContext = historyContext;
|
|
3063
|
+
exports.__RouterContext = context;
|
|
2979
3064
|
exports.generatePath = generatePath;
|
|
2980
3065
|
exports.matchPath = matchPath;
|
|
3066
|
+
exports.useHistory = useHistory;
|
|
3067
|
+
exports.useLocation = useLocation;
|
|
3068
|
+
exports.useParams = useParams;
|
|
3069
|
+
exports.useRouteMatch = useRouteMatch;
|
|
2981
3070
|
exports.withRouter = withRouter;
|
|
2982
|
-
exports.__RouterContext = context;
|
|
2983
3071
|
|
|
2984
3072
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2985
3073
|
|
|
2986
|
-
}))
|
|
3074
|
+
}));
|
|
3075
|
+
//# sourceMappingURL=react-router.js.map
|