react-router 4.0.0-beta.7 → 4.1.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/MemoryRouter.js +9 -5
- package/Prompt.js +14 -8
- package/README.md +2 -2
- package/Redirect.js +23 -12
- package/Route.js +54 -28
- package/Router.js +19 -9
- package/StaticRouter.js +18 -4
- package/Switch.js +22 -5
- package/es/MemoryRouter.js +2 -1
- package/es/Prompt.js +10 -7
- package/es/Redirect.js +19 -11
- package/es/Route.js +44 -21
- package/es/Router.js +15 -8
- package/es/StaticRouter.js +13 -2
- package/es/Switch.js +18 -4
- package/es/matchPath.js +2 -4
- package/es/withRouter.js +13 -2
- package/matchPath.js +2 -4
- package/package.json +9 -9
- package/umd/react-router.js +466 -105
- package/umd/react-router.min.js +1 -1
- package/withRouter.js +19 -2
package/umd/react-router.js
CHANGED
|
@@ -63,35 +63,35 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
63
63
|
|
|
64
64
|
var _MemoryRouter3 = _interopRequireDefault(_MemoryRouter2);
|
|
65
65
|
|
|
66
|
-
var _Prompt2 = __webpack_require__(
|
|
66
|
+
var _Prompt2 = __webpack_require__(16);
|
|
67
67
|
|
|
68
68
|
var _Prompt3 = _interopRequireDefault(_Prompt2);
|
|
69
69
|
|
|
70
|
-
var _Redirect2 = __webpack_require__(
|
|
70
|
+
var _Redirect2 = __webpack_require__(17);
|
|
71
71
|
|
|
72
72
|
var _Redirect3 = _interopRequireDefault(_Redirect2);
|
|
73
73
|
|
|
74
|
-
var _Route2 = __webpack_require__(
|
|
74
|
+
var _Route2 = __webpack_require__(18);
|
|
75
75
|
|
|
76
76
|
var _Route3 = _interopRequireDefault(_Route2);
|
|
77
77
|
|
|
78
|
-
var _Router2 = __webpack_require__(
|
|
78
|
+
var _Router2 = __webpack_require__(14);
|
|
79
79
|
|
|
80
80
|
var _Router3 = _interopRequireDefault(_Router2);
|
|
81
81
|
|
|
82
|
-
var _StaticRouter2 = __webpack_require__(
|
|
82
|
+
var _StaticRouter2 = __webpack_require__(22);
|
|
83
83
|
|
|
84
84
|
var _StaticRouter3 = _interopRequireDefault(_StaticRouter2);
|
|
85
85
|
|
|
86
|
-
var _Switch2 = __webpack_require__(
|
|
86
|
+
var _Switch2 = __webpack_require__(23);
|
|
87
87
|
|
|
88
88
|
var _Switch3 = _interopRequireDefault(_Switch2);
|
|
89
89
|
|
|
90
|
-
var _matchPath2 = __webpack_require__(
|
|
90
|
+
var _matchPath2 = __webpack_require__(19);
|
|
91
91
|
|
|
92
92
|
var _matchPath3 = _interopRequireDefault(_matchPath2);
|
|
93
93
|
|
|
94
|
-
var _withRouter2 = __webpack_require__(
|
|
94
|
+
var _withRouter2 = __webpack_require__(24);
|
|
95
95
|
|
|
96
96
|
var _withRouter3 = _interopRequireDefault(_withRouter2);
|
|
97
97
|
|
|
@@ -119,11 +119,15 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
119
119
|
|
|
120
120
|
var _react2 = _interopRequireDefault(_react);
|
|
121
121
|
|
|
122
|
-
var
|
|
122
|
+
var _propTypes = __webpack_require__(3);
|
|
123
|
+
|
|
124
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
125
|
+
|
|
126
|
+
var _createMemoryHistory = __webpack_require__(7);
|
|
123
127
|
|
|
124
128
|
var _createMemoryHistory2 = _interopRequireDefault(_createMemoryHistory);
|
|
125
129
|
|
|
126
|
-
var _Router = __webpack_require__(
|
|
130
|
+
var _Router = __webpack_require__(14);
|
|
127
131
|
|
|
128
132
|
var _Router2 = _interopRequireDefault(_Router);
|
|
129
133
|
|
|
@@ -170,6 +174,205 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
170
174
|
|
|
171
175
|
/***/ },
|
|
172
176
|
/* 3 */
|
|
177
|
+
/***/ function(module, exports, __webpack_require__) {
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
181
|
+
* All rights reserved.
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the BSD-style license found in the
|
|
184
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
185
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
186
|
+
*/
|
|
187
|
+
|
|
188
|
+
if (false) {
|
|
189
|
+
var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
|
|
190
|
+
Symbol.for &&
|
|
191
|
+
Symbol.for('react.element')) ||
|
|
192
|
+
0xeac7;
|
|
193
|
+
|
|
194
|
+
var isValidElement = function(object) {
|
|
195
|
+
return typeof object === 'object' &&
|
|
196
|
+
object !== null &&
|
|
197
|
+
object.$$typeof === REACT_ELEMENT_TYPE;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
201
|
+
// http://fb.me/prop-types-in-prod
|
|
202
|
+
var throwOnDirectAccess = true;
|
|
203
|
+
module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);
|
|
204
|
+
} else {
|
|
205
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
206
|
+
// http://fb.me/prop-types-in-prod
|
|
207
|
+
module.exports = __webpack_require__(4)();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
/***/ },
|
|
212
|
+
/* 4 */
|
|
213
|
+
/***/ function(module, exports, __webpack_require__) {
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
217
|
+
* All rights reserved.
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the BSD-style license found in the
|
|
220
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
221
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
222
|
+
*/
|
|
223
|
+
|
|
224
|
+
'use strict';
|
|
225
|
+
|
|
226
|
+
var emptyFunction = __webpack_require__(5);
|
|
227
|
+
var invariant = __webpack_require__(6);
|
|
228
|
+
|
|
229
|
+
module.exports = function() {
|
|
230
|
+
// Important!
|
|
231
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
232
|
+
function shim() {
|
|
233
|
+
invariant(
|
|
234
|
+
false,
|
|
235
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
236
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
237
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
238
|
+
);
|
|
239
|
+
};
|
|
240
|
+
shim.isRequired = shim;
|
|
241
|
+
function getShim() {
|
|
242
|
+
return shim;
|
|
243
|
+
};
|
|
244
|
+
var ReactPropTypes = {
|
|
245
|
+
array: shim,
|
|
246
|
+
bool: shim,
|
|
247
|
+
func: shim,
|
|
248
|
+
number: shim,
|
|
249
|
+
object: shim,
|
|
250
|
+
string: shim,
|
|
251
|
+
symbol: shim,
|
|
252
|
+
|
|
253
|
+
any: shim,
|
|
254
|
+
arrayOf: getShim,
|
|
255
|
+
element: shim,
|
|
256
|
+
instanceOf: getShim,
|
|
257
|
+
node: shim,
|
|
258
|
+
objectOf: getShim,
|
|
259
|
+
oneOf: getShim,
|
|
260
|
+
oneOfType: getShim,
|
|
261
|
+
shape: getShim
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
ReactPropTypes.checkPropTypes = emptyFunction;
|
|
265
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
266
|
+
|
|
267
|
+
return ReactPropTypes;
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
/***/ },
|
|
272
|
+
/* 5 */
|
|
273
|
+
/***/ function(module, exports) {
|
|
274
|
+
|
|
275
|
+
"use strict";
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
279
|
+
* All rights reserved.
|
|
280
|
+
*
|
|
281
|
+
* This source code is licensed under the BSD-style license found in the
|
|
282
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
283
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
284
|
+
*
|
|
285
|
+
*
|
|
286
|
+
*/
|
|
287
|
+
|
|
288
|
+
function makeEmptyFunction(arg) {
|
|
289
|
+
return function () {
|
|
290
|
+
return arg;
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* This function accepts and discards inputs; it has no side effects. This is
|
|
296
|
+
* primarily useful idiomatically for overridable function endpoints which
|
|
297
|
+
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
|
|
298
|
+
*/
|
|
299
|
+
var emptyFunction = function emptyFunction() {};
|
|
300
|
+
|
|
301
|
+
emptyFunction.thatReturns = makeEmptyFunction;
|
|
302
|
+
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
|
|
303
|
+
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
|
304
|
+
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
|
305
|
+
emptyFunction.thatReturnsThis = function () {
|
|
306
|
+
return this;
|
|
307
|
+
};
|
|
308
|
+
emptyFunction.thatReturnsArgument = function (arg) {
|
|
309
|
+
return arg;
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
module.exports = emptyFunction;
|
|
313
|
+
|
|
314
|
+
/***/ },
|
|
315
|
+
/* 6 */
|
|
316
|
+
/***/ function(module, exports, __webpack_require__) {
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
320
|
+
* All rights reserved.
|
|
321
|
+
*
|
|
322
|
+
* This source code is licensed under the BSD-style license found in the
|
|
323
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
324
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
325
|
+
*
|
|
326
|
+
*/
|
|
327
|
+
|
|
328
|
+
'use strict';
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Use invariant() to assert state which your program assumes to be true.
|
|
332
|
+
*
|
|
333
|
+
* Provide sprintf-style format (only %s is supported) and arguments
|
|
334
|
+
* to provide information about what broke and what you were
|
|
335
|
+
* expecting.
|
|
336
|
+
*
|
|
337
|
+
* The invariant message will be stripped in production, but the invariant
|
|
338
|
+
* will remain to ensure logic does not differ in production.
|
|
339
|
+
*/
|
|
340
|
+
|
|
341
|
+
var validateFormat = function validateFormat(format) {};
|
|
342
|
+
|
|
343
|
+
if (false) {
|
|
344
|
+
validateFormat = function validateFormat(format) {
|
|
345
|
+
if (format === undefined) {
|
|
346
|
+
throw new Error('invariant requires an error message argument');
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function invariant(condition, format, a, b, c, d, e, f) {
|
|
352
|
+
validateFormat(format);
|
|
353
|
+
|
|
354
|
+
if (!condition) {
|
|
355
|
+
var error;
|
|
356
|
+
if (format === undefined) {
|
|
357
|
+
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
358
|
+
} else {
|
|
359
|
+
var args = [a, b, c, d, e, f];
|
|
360
|
+
var argIndex = 0;
|
|
361
|
+
error = new Error(format.replace(/%s/g, function () {
|
|
362
|
+
return args[argIndex++];
|
|
363
|
+
}));
|
|
364
|
+
error.name = 'Invariant Violation';
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
368
|
+
throw error;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
module.exports = invariant;
|
|
373
|
+
|
|
374
|
+
/***/ },
|
|
375
|
+
/* 7 */
|
|
173
376
|
/***/ function(module, exports, __webpack_require__) {
|
|
174
377
|
|
|
175
378
|
'use strict';
|
|
@@ -180,15 +383,15 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
180
383
|
|
|
181
384
|
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
182
385
|
|
|
183
|
-
var _warning = __webpack_require__(
|
|
386
|
+
var _warning = __webpack_require__(8);
|
|
184
387
|
|
|
185
388
|
var _warning2 = _interopRequireDefault(_warning);
|
|
186
389
|
|
|
187
|
-
var _PathUtils = __webpack_require__(
|
|
390
|
+
var _PathUtils = __webpack_require__(9);
|
|
188
391
|
|
|
189
|
-
var _LocationUtils = __webpack_require__(
|
|
392
|
+
var _LocationUtils = __webpack_require__(10);
|
|
190
393
|
|
|
191
|
-
var _createTransitionManager = __webpack_require__(
|
|
394
|
+
var _createTransitionManager = __webpack_require__(13);
|
|
192
395
|
|
|
193
396
|
var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);
|
|
194
397
|
|
|
@@ -227,8 +430,8 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
227
430
|
};
|
|
228
431
|
|
|
229
432
|
var index = clamp(initialIndex, 0, initialEntries.length - 1);
|
|
230
|
-
var entries = initialEntries.map(function (entry
|
|
231
|
-
return typeof entry === 'string' ? (0, _LocationUtils.createLocation)(entry, undefined,
|
|
433
|
+
var entries = initialEntries.map(function (entry) {
|
|
434
|
+
return typeof entry === 'string' ? (0, _LocationUtils.createLocation)(entry, undefined, createKey()) : (0, _LocationUtils.createLocation)(entry, undefined, entry.key || createKey());
|
|
232
435
|
});
|
|
233
436
|
|
|
234
437
|
// Public interface
|
|
@@ -236,7 +439,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
236
439
|
var createHref = _PathUtils.createPath;
|
|
237
440
|
|
|
238
441
|
var push = function push(path, state) {
|
|
239
|
-
|
|
442
|
+
(0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _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');
|
|
240
443
|
|
|
241
444
|
var action = 'PUSH';
|
|
242
445
|
var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);
|
|
@@ -264,7 +467,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
264
467
|
};
|
|
265
468
|
|
|
266
469
|
var replace = function replace(path, state) {
|
|
267
|
-
|
|
470
|
+
(0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _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');
|
|
268
471
|
|
|
269
472
|
var action = 'REPLACE';
|
|
270
473
|
var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);
|
|
@@ -344,7 +547,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
344
547
|
exports.default = createMemoryHistory;
|
|
345
548
|
|
|
346
549
|
/***/ },
|
|
347
|
-
/*
|
|
550
|
+
/* 8 */
|
|
348
551
|
/***/ function(module, exports, __webpack_require__) {
|
|
349
552
|
|
|
350
553
|
/**
|
|
@@ -410,7 +613,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
410
613
|
|
|
411
614
|
|
|
412
615
|
/***/ },
|
|
413
|
-
/*
|
|
616
|
+
/* 9 */
|
|
414
617
|
/***/ function(module, exports) {
|
|
415
618
|
|
|
416
619
|
'use strict';
|
|
@@ -428,6 +631,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
428
631
|
return path.indexOf(prefix) === 0 ? path.substr(prefix.length) : path;
|
|
429
632
|
};
|
|
430
633
|
|
|
634
|
+
var stripTrailingSlash = exports.stripTrailingSlash = function stripTrailingSlash(path) {
|
|
635
|
+
return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
|
|
636
|
+
};
|
|
637
|
+
|
|
431
638
|
var parsePath = exports.parsePath = function parsePath(path) {
|
|
432
639
|
var pathname = path || '/';
|
|
433
640
|
var search = '';
|
|
@@ -445,6 +652,8 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
445
652
|
pathname = pathname.substr(0, searchIndex);
|
|
446
653
|
}
|
|
447
654
|
|
|
655
|
+
pathname = decodeURI(pathname);
|
|
656
|
+
|
|
448
657
|
return {
|
|
449
658
|
pathname: pathname,
|
|
450
659
|
search: search === '?' ? '' : search,
|
|
@@ -458,7 +667,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
458
667
|
hash = location.hash;
|
|
459
668
|
|
|
460
669
|
|
|
461
|
-
var path = pathname || '/';
|
|
670
|
+
var path = encodeURI(pathname || '/');
|
|
462
671
|
|
|
463
672
|
if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search;
|
|
464
673
|
|
|
@@ -468,7 +677,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
468
677
|
};
|
|
469
678
|
|
|
470
679
|
/***/ },
|
|
471
|
-
/*
|
|
680
|
+
/* 10 */
|
|
472
681
|
/***/ function(module, exports, __webpack_require__) {
|
|
473
682
|
|
|
474
683
|
'use strict';
|
|
@@ -478,15 +687,15 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
478
687
|
|
|
479
688
|
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
480
689
|
|
|
481
|
-
var _resolvePathname = __webpack_require__(
|
|
690
|
+
var _resolvePathname = __webpack_require__(11);
|
|
482
691
|
|
|
483
692
|
var _resolvePathname2 = _interopRequireDefault(_resolvePathname);
|
|
484
693
|
|
|
485
|
-
var _valueEqual = __webpack_require__(
|
|
694
|
+
var _valueEqual = __webpack_require__(12);
|
|
486
695
|
|
|
487
696
|
var _valueEqual2 = _interopRequireDefault(_valueEqual);
|
|
488
697
|
|
|
489
|
-
var _PathUtils = __webpack_require__(
|
|
698
|
+
var _PathUtils = __webpack_require__(9);
|
|
490
699
|
|
|
491
700
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
492
701
|
|
|
@@ -536,7 +745,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
536
745
|
};
|
|
537
746
|
|
|
538
747
|
/***/ },
|
|
539
|
-
/*
|
|
748
|
+
/* 11 */
|
|
540
749
|
/***/ function(module, exports) {
|
|
541
750
|
|
|
542
751
|
'use strict';
|
|
@@ -611,7 +820,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
611
820
|
module.exports = resolvePathname;
|
|
612
821
|
|
|
613
822
|
/***/ },
|
|
614
|
-
/*
|
|
823
|
+
/* 12 */
|
|
615
824
|
/***/ function(module, exports) {
|
|
616
825
|
|
|
617
826
|
'use strict';
|
|
@@ -660,14 +869,14 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
660
869
|
exports.default = valueEqual;
|
|
661
870
|
|
|
662
871
|
/***/ },
|
|
663
|
-
/*
|
|
872
|
+
/* 13 */
|
|
664
873
|
/***/ function(module, exports, __webpack_require__) {
|
|
665
874
|
|
|
666
875
|
'use strict';
|
|
667
876
|
|
|
668
877
|
exports.__esModule = true;
|
|
669
878
|
|
|
670
|
-
var _warning = __webpack_require__(
|
|
879
|
+
var _warning = __webpack_require__(8);
|
|
671
880
|
|
|
672
881
|
var _warning2 = _interopRequireDefault(_warning);
|
|
673
882
|
|
|
@@ -677,7 +886,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
677
886
|
var prompt = null;
|
|
678
887
|
|
|
679
888
|
var setPrompt = function setPrompt(nextPrompt) {
|
|
680
|
-
|
|
889
|
+
(0, _warning2.default)(prompt == null, 'A history supports only one prompt at a time');
|
|
681
890
|
|
|
682
891
|
prompt = nextPrompt;
|
|
683
892
|
|
|
@@ -697,7 +906,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
697
906
|
if (typeof getUserConfirmation === 'function') {
|
|
698
907
|
getUserConfirmation(result, callback);
|
|
699
908
|
} else {
|
|
700
|
-
|
|
909
|
+
(0, _warning2.default)(false, 'A history needs a getUserConfirmation function in order to use a prompt message');
|
|
701
910
|
|
|
702
911
|
callback(true);
|
|
703
912
|
}
|
|
@@ -750,18 +959,20 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
750
959
|
exports.default = createTransitionManager;
|
|
751
960
|
|
|
752
961
|
/***/ },
|
|
753
|
-
/*
|
|
962
|
+
/* 14 */
|
|
754
963
|
/***/ function(module, exports, __webpack_require__) {
|
|
755
964
|
|
|
756
965
|
'use strict';
|
|
757
966
|
|
|
758
967
|
exports.__esModule = true;
|
|
759
968
|
|
|
760
|
-
var
|
|
969
|
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
970
|
+
|
|
971
|
+
var _warning = __webpack_require__(8);
|
|
761
972
|
|
|
762
973
|
var _warning2 = _interopRequireDefault(_warning);
|
|
763
974
|
|
|
764
|
-
var _invariant = __webpack_require__(
|
|
975
|
+
var _invariant = __webpack_require__(15);
|
|
765
976
|
|
|
766
977
|
var _invariant2 = _interopRequireDefault(_invariant);
|
|
767
978
|
|
|
@@ -769,6 +980,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
769
980
|
|
|
770
981
|
var _react2 = _interopRequireDefault(_react);
|
|
771
982
|
|
|
983
|
+
var _propTypes = __webpack_require__(3);
|
|
984
|
+
|
|
985
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
986
|
+
|
|
772
987
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
773
988
|
|
|
774
989
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -799,11 +1014,13 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
799
1014
|
|
|
800
1015
|
Router.prototype.getChildContext = function getChildContext() {
|
|
801
1016
|
return {
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
1017
|
+
router: _extends({}, this.context.router, {
|
|
1018
|
+
history: this.props.history,
|
|
1019
|
+
route: {
|
|
1020
|
+
location: this.props.history.location,
|
|
1021
|
+
match: this.state.match
|
|
1022
|
+
}
|
|
1023
|
+
})
|
|
807
1024
|
};
|
|
808
1025
|
};
|
|
809
1026
|
|
|
@@ -853,14 +1070,16 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
853
1070
|
return Router;
|
|
854
1071
|
}(_react2.default.Component);
|
|
855
1072
|
|
|
1073
|
+
Router.contextTypes = {
|
|
1074
|
+
router: _propTypes2.default.object
|
|
1075
|
+
};
|
|
856
1076
|
Router.childContextTypes = {
|
|
857
|
-
|
|
858
|
-
route: _react.PropTypes.object.isRequired
|
|
1077
|
+
router: _propTypes2.default.object.isRequired
|
|
859
1078
|
};
|
|
860
1079
|
exports.default = Router;
|
|
861
1080
|
|
|
862
1081
|
/***/ },
|
|
863
|
-
/*
|
|
1082
|
+
/* 15 */
|
|
864
1083
|
/***/ function(module, exports, __webpack_require__) {
|
|
865
1084
|
|
|
866
1085
|
/**
|
|
@@ -917,7 +1136,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
917
1136
|
|
|
918
1137
|
|
|
919
1138
|
/***/ },
|
|
920
|
-
/*
|
|
1139
|
+
/* 16 */
|
|
921
1140
|
/***/ function(module, exports, __webpack_require__) {
|
|
922
1141
|
|
|
923
1142
|
'use strict';
|
|
@@ -928,6 +1147,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
928
1147
|
|
|
929
1148
|
var _react2 = _interopRequireDefault(_react);
|
|
930
1149
|
|
|
1150
|
+
var _propTypes = __webpack_require__(3);
|
|
1151
|
+
|
|
1152
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
1153
|
+
|
|
931
1154
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
932
1155
|
|
|
933
1156
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -952,7 +1175,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
952
1175
|
Prompt.prototype.enable = function enable(message) {
|
|
953
1176
|
if (this.unblock) this.unblock();
|
|
954
1177
|
|
|
955
|
-
this.unblock = this.context.history.block(message);
|
|
1178
|
+
this.unblock = this.context.router.history.block(message);
|
|
956
1179
|
};
|
|
957
1180
|
|
|
958
1181
|
Prompt.prototype.disable = function disable() {
|
|
@@ -985,18 +1208,20 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
985
1208
|
return Prompt;
|
|
986
1209
|
}(_react2.default.Component);
|
|
987
1210
|
|
|
988
|
-
Prompt.contextTypes = {
|
|
989
|
-
history: _react.PropTypes.shape({
|
|
990
|
-
block: _react.PropTypes.func.isRequired
|
|
991
|
-
}).isRequired
|
|
992
|
-
};
|
|
993
1211
|
Prompt.defaultProps = {
|
|
994
1212
|
when: true
|
|
995
1213
|
};
|
|
1214
|
+
Prompt.contextTypes = {
|
|
1215
|
+
router: _propTypes2.default.shape({
|
|
1216
|
+
history: _propTypes2.default.shape({
|
|
1217
|
+
block: _propTypes2.default.func.isRequired
|
|
1218
|
+
}).isRequired
|
|
1219
|
+
}).isRequired
|
|
1220
|
+
};
|
|
996
1221
|
exports.default = Prompt;
|
|
997
1222
|
|
|
998
1223
|
/***/ },
|
|
999
|
-
/*
|
|
1224
|
+
/* 17 */
|
|
1000
1225
|
/***/ function(module, exports, __webpack_require__) {
|
|
1001
1226
|
|
|
1002
1227
|
'use strict';
|
|
@@ -1007,6 +1232,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1007
1232
|
|
|
1008
1233
|
var _react2 = _interopRequireDefault(_react);
|
|
1009
1234
|
|
|
1235
|
+
var _propTypes = __webpack_require__(3);
|
|
1236
|
+
|
|
1237
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
1238
|
+
|
|
1010
1239
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1011
1240
|
|
|
1012
1241
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -1028,16 +1257,20 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1028
1257
|
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
1029
1258
|
}
|
|
1030
1259
|
|
|
1260
|
+
Redirect.prototype.isStatic = function isStatic() {
|
|
1261
|
+
return this.context.router && this.context.router.staticContext;
|
|
1262
|
+
};
|
|
1263
|
+
|
|
1031
1264
|
Redirect.prototype.componentWillMount = function componentWillMount() {
|
|
1032
|
-
if (this.
|
|
1265
|
+
if (this.isStatic()) this.perform();
|
|
1033
1266
|
};
|
|
1034
1267
|
|
|
1035
1268
|
Redirect.prototype.componentDidMount = function componentDidMount() {
|
|
1036
|
-
if (!this.
|
|
1269
|
+
if (!this.isStatic()) this.perform();
|
|
1037
1270
|
};
|
|
1038
1271
|
|
|
1039
1272
|
Redirect.prototype.perform = function perform() {
|
|
1040
|
-
var history = this.context.history;
|
|
1273
|
+
var history = this.context.router.history;
|
|
1041
1274
|
var _props = this.props,
|
|
1042
1275
|
push = _props.push,
|
|
1043
1276
|
to = _props.to;
|
|
@@ -1057,27 +1290,31 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1057
1290
|
return Redirect;
|
|
1058
1291
|
}(_react2.default.Component);
|
|
1059
1292
|
|
|
1060
|
-
Redirect.contextTypes = {
|
|
1061
|
-
history: _react.PropTypes.shape({
|
|
1062
|
-
push: _react.PropTypes.func.isRequired,
|
|
1063
|
-
replace: _react.PropTypes.func.isRequired,
|
|
1064
|
-
staticContext: _react.PropTypes.object
|
|
1065
|
-
}).isRequired
|
|
1066
|
-
};
|
|
1067
1293
|
Redirect.defaultProps = {
|
|
1068
1294
|
push: false
|
|
1069
1295
|
};
|
|
1296
|
+
Redirect.contextTypes = {
|
|
1297
|
+
router: _propTypes2.default.shape({
|
|
1298
|
+
history: _propTypes2.default.shape({
|
|
1299
|
+
push: _propTypes2.default.func.isRequired,
|
|
1300
|
+
replace: _propTypes2.default.func.isRequired
|
|
1301
|
+
}).isRequired,
|
|
1302
|
+
staticContext: _propTypes2.default.object
|
|
1303
|
+
}).isRequired
|
|
1304
|
+
};
|
|
1070
1305
|
exports.default = Redirect;
|
|
1071
1306
|
|
|
1072
1307
|
/***/ },
|
|
1073
|
-
/*
|
|
1308
|
+
/* 18 */
|
|
1074
1309
|
/***/ function(module, exports, __webpack_require__) {
|
|
1075
1310
|
|
|
1076
1311
|
'use strict';
|
|
1077
1312
|
|
|
1078
1313
|
exports.__esModule = true;
|
|
1079
1314
|
|
|
1080
|
-
var
|
|
1315
|
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
1316
|
+
|
|
1317
|
+
var _warning = __webpack_require__(8);
|
|
1081
1318
|
|
|
1082
1319
|
var _warning2 = _interopRequireDefault(_warning);
|
|
1083
1320
|
|
|
@@ -1085,7 +1322,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1085
1322
|
|
|
1086
1323
|
var _react2 = _interopRequireDefault(_react);
|
|
1087
1324
|
|
|
1088
|
-
var
|
|
1325
|
+
var _propTypes = __webpack_require__(3);
|
|
1326
|
+
|
|
1327
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
1328
|
+
|
|
1329
|
+
var _matchPath = __webpack_require__(19);
|
|
1089
1330
|
|
|
1090
1331
|
var _matchPath2 = _interopRequireDefault(_matchPath);
|
|
1091
1332
|
|
|
@@ -1113,16 +1354,18 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1113
1354
|
}
|
|
1114
1355
|
|
|
1115
1356
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
|
|
1116
|
-
match: _this.computeMatch(_this.props, _this.context)
|
|
1357
|
+
match: _this.computeMatch(_this.props, _this.context.router)
|
|
1117
1358
|
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
1118
1359
|
}
|
|
1119
1360
|
|
|
1120
1361
|
Route.prototype.getChildContext = function getChildContext() {
|
|
1121
1362
|
return {
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1363
|
+
router: _extends({}, this.context.router, {
|
|
1364
|
+
route: {
|
|
1365
|
+
location: this.props.location || this.context.router.route.location,
|
|
1366
|
+
match: this.state.match
|
|
1367
|
+
}
|
|
1368
|
+
})
|
|
1126
1369
|
};
|
|
1127
1370
|
};
|
|
1128
1371
|
|
|
@@ -1138,7 +1381,21 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1138
1381
|
|
|
1139
1382
|
var pathname = (location || route.location).pathname;
|
|
1140
1383
|
|
|
1141
|
-
return (0, _matchPath2.default)(pathname, { path: path, strict: strict, exact: exact });
|
|
1384
|
+
return path ? (0, _matchPath2.default)(pathname, { path: path, strict: strict, exact: exact }) : route.match;
|
|
1385
|
+
};
|
|
1386
|
+
|
|
1387
|
+
Route.prototype.componentWillMount = function componentWillMount() {
|
|
1388
|
+
var _props = this.props,
|
|
1389
|
+
component = _props.component,
|
|
1390
|
+
render = _props.render,
|
|
1391
|
+
children = _props.children;
|
|
1392
|
+
|
|
1393
|
+
|
|
1394
|
+
false ? (0, _warning2.default)(!(component && render), 'You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored') : void 0;
|
|
1395
|
+
|
|
1396
|
+
false ? (0, _warning2.default)(!(component && children), 'You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored') : void 0;
|
|
1397
|
+
|
|
1398
|
+
false ? (0, _warning2.default)(!(render && children), 'You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored') : void 0;
|
|
1142
1399
|
};
|
|
1143
1400
|
|
|
1144
1401
|
Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) {
|
|
@@ -1147,22 +1404,23 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1147
1404
|
false ? (0, _warning2.default)(!(!nextProps.location && this.props.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.') : void 0;
|
|
1148
1405
|
|
|
1149
1406
|
this.setState({
|
|
1150
|
-
match: this.computeMatch(nextProps, nextContext)
|
|
1407
|
+
match: this.computeMatch(nextProps, nextContext.router)
|
|
1151
1408
|
});
|
|
1152
1409
|
};
|
|
1153
1410
|
|
|
1154
1411
|
Route.prototype.render = function render() {
|
|
1155
1412
|
var match = this.state.match;
|
|
1156
|
-
var
|
|
1157
|
-
children =
|
|
1158
|
-
component =
|
|
1159
|
-
render =
|
|
1160
|
-
var _context = this.context,
|
|
1161
|
-
history = _context.history,
|
|
1162
|
-
route = _context.route
|
|
1413
|
+
var _props2 = this.props,
|
|
1414
|
+
children = _props2.children,
|
|
1415
|
+
component = _props2.component,
|
|
1416
|
+
render = _props2.render;
|
|
1417
|
+
var _context$router = this.context.router,
|
|
1418
|
+
history = _context$router.history,
|
|
1419
|
+
route = _context$router.route,
|
|
1420
|
+
staticContext = _context$router.staticContext;
|
|
1163
1421
|
|
|
1164
1422
|
var location = this.props.location || route.location;
|
|
1165
|
-
var props = { match: match, location: location, history: history };
|
|
1423
|
+
var props = { match: match, location: location, history: history, staticContext: staticContext };
|
|
1166
1424
|
|
|
1167
1425
|
return component ? // component prop gets first priority, only called if there's a match
|
|
1168
1426
|
match ? _react2.default.createElement(component, props) : null : render ? // render prop is next, only called if there's a match
|
|
@@ -1175,23 +1433,26 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1175
1433
|
}(_react2.default.Component);
|
|
1176
1434
|
|
|
1177
1435
|
Route.contextTypes = {
|
|
1178
|
-
|
|
1179
|
-
|
|
1436
|
+
router: _propTypes2.default.shape({
|
|
1437
|
+
history: _propTypes2.default.object.isRequired,
|
|
1438
|
+
route: _propTypes2.default.object.isRequired,
|
|
1439
|
+
staticContext: _propTypes2.default.object
|
|
1440
|
+
})
|
|
1180
1441
|
};
|
|
1181
1442
|
Route.childContextTypes = {
|
|
1182
|
-
|
|
1443
|
+
router: _propTypes2.default.object.isRequired
|
|
1183
1444
|
};
|
|
1184
1445
|
exports.default = Route;
|
|
1185
1446
|
|
|
1186
1447
|
/***/ },
|
|
1187
|
-
/*
|
|
1448
|
+
/* 19 */
|
|
1188
1449
|
/***/ function(module, exports, __webpack_require__) {
|
|
1189
1450
|
|
|
1190
1451
|
'use strict';
|
|
1191
1452
|
|
|
1192
1453
|
exports.__esModule = true;
|
|
1193
1454
|
|
|
1194
|
-
var _pathToRegexp = __webpack_require__(
|
|
1455
|
+
var _pathToRegexp = __webpack_require__(20);
|
|
1195
1456
|
|
|
1196
1457
|
var _pathToRegexp2 = _interopRequireDefault(_pathToRegexp);
|
|
1197
1458
|
|
|
@@ -1228,15 +1489,13 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1228
1489
|
if (typeof options === 'string') options = { path: options };
|
|
1229
1490
|
|
|
1230
1491
|
var _options = options,
|
|
1492
|
+
_options$path = _options.path,
|
|
1493
|
+
path = _options$path === undefined ? '/' : _options$path,
|
|
1231
1494
|
_options$exact = _options.exact,
|
|
1232
1495
|
exact = _options$exact === undefined ? false : _options$exact,
|
|
1233
1496
|
_options$strict = _options.strict,
|
|
1234
1497
|
strict = _options$strict === undefined ? false : _options$strict;
|
|
1235
1498
|
|
|
1236
|
-
var path = options.path || options.from;
|
|
1237
|
-
|
|
1238
|
-
if (!path) return { url: pathname, isExact: true, params: {} };
|
|
1239
|
-
|
|
1240
1499
|
var _compilePath = compilePath(path, { end: exact, strict: strict }),
|
|
1241
1500
|
re = _compilePath.re,
|
|
1242
1501
|
keys = _compilePath.keys;
|
|
@@ -1266,10 +1525,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1266
1525
|
exports.default = matchPath;
|
|
1267
1526
|
|
|
1268
1527
|
/***/ },
|
|
1269
|
-
/*
|
|
1528
|
+
/* 20 */
|
|
1270
1529
|
/***/ function(module, exports, __webpack_require__) {
|
|
1271
1530
|
|
|
1272
|
-
var isarray = __webpack_require__(
|
|
1531
|
+
var isarray = __webpack_require__(21)
|
|
1273
1532
|
|
|
1274
1533
|
/**
|
|
1275
1534
|
* Expose `pathToRegexp`.
|
|
@@ -1698,7 +1957,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1698
1957
|
|
|
1699
1958
|
|
|
1700
1959
|
/***/ },
|
|
1701
|
-
/*
|
|
1960
|
+
/* 21 */
|
|
1702
1961
|
/***/ function(module, exports) {
|
|
1703
1962
|
|
|
1704
1963
|
module.exports = Array.isArray || function (arr) {
|
|
@@ -1707,7 +1966,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1707
1966
|
|
|
1708
1967
|
|
|
1709
1968
|
/***/ },
|
|
1710
|
-
/*
|
|
1969
|
+
/* 22 */
|
|
1711
1970
|
/***/ function(module, exports, __webpack_require__) {
|
|
1712
1971
|
|
|
1713
1972
|
'use strict';
|
|
@@ -1716,7 +1975,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1716
1975
|
|
|
1717
1976
|
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
1718
1977
|
|
|
1719
|
-
var _invariant = __webpack_require__(
|
|
1978
|
+
var _invariant = __webpack_require__(15);
|
|
1720
1979
|
|
|
1721
1980
|
var _invariant2 = _interopRequireDefault(_invariant);
|
|
1722
1981
|
|
|
@@ -1724,9 +1983,13 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1724
1983
|
|
|
1725
1984
|
var _react2 = _interopRequireDefault(_react);
|
|
1726
1985
|
|
|
1727
|
-
var
|
|
1986
|
+
var _propTypes = __webpack_require__(3);
|
|
1987
|
+
|
|
1988
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
1989
|
+
|
|
1990
|
+
var _PathUtils = __webpack_require__(9);
|
|
1728
1991
|
|
|
1729
|
-
var _Router = __webpack_require__(
|
|
1992
|
+
var _Router = __webpack_require__(14);
|
|
1730
1993
|
|
|
1731
1994
|
var _Router2 = _interopRequireDefault(_Router);
|
|
1732
1995
|
|
|
@@ -1836,6 +2099,14 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1836
2099
|
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
1837
2100
|
}
|
|
1838
2101
|
|
|
2102
|
+
StaticRouter.prototype.getChildContext = function getChildContext() {
|
|
2103
|
+
return {
|
|
2104
|
+
router: {
|
|
2105
|
+
staticContext: this.props.context
|
|
2106
|
+
}
|
|
2107
|
+
};
|
|
2108
|
+
};
|
|
2109
|
+
|
|
1839
2110
|
StaticRouter.prototype.render = function render() {
|
|
1840
2111
|
var _props = this.props,
|
|
1841
2112
|
basename = _props.basename,
|
|
@@ -1844,7 +2115,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1844
2115
|
props = _objectWithoutProperties(_props, ['basename', 'context', 'location']);
|
|
1845
2116
|
|
|
1846
2117
|
var history = {
|
|
1847
|
-
staticContext: context,
|
|
1848
2118
|
createHref: this.createHref,
|
|
1849
2119
|
action: 'POP',
|
|
1850
2120
|
location: stripBasename(basename, createLocation(location)),
|
|
@@ -1867,10 +2137,13 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1867
2137
|
basename: '',
|
|
1868
2138
|
location: '/'
|
|
1869
2139
|
};
|
|
2140
|
+
StaticRouter.childContextTypes = {
|
|
2141
|
+
router: _propTypes2.default.object.isRequired
|
|
2142
|
+
};
|
|
1870
2143
|
exports.default = StaticRouter;
|
|
1871
2144
|
|
|
1872
2145
|
/***/ },
|
|
1873
|
-
/*
|
|
2146
|
+
/* 23 */
|
|
1874
2147
|
/***/ function(module, exports, __webpack_require__) {
|
|
1875
2148
|
|
|
1876
2149
|
'use strict';
|
|
@@ -1881,11 +2154,15 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1881
2154
|
|
|
1882
2155
|
var _react2 = _interopRequireDefault(_react);
|
|
1883
2156
|
|
|
1884
|
-
var
|
|
2157
|
+
var _propTypes = __webpack_require__(3);
|
|
2158
|
+
|
|
2159
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
2160
|
+
|
|
2161
|
+
var _warning = __webpack_require__(8);
|
|
1885
2162
|
|
|
1886
2163
|
var _warning2 = _interopRequireDefault(_warning);
|
|
1887
2164
|
|
|
1888
|
-
var _matchPath = __webpack_require__(
|
|
2165
|
+
var _matchPath = __webpack_require__(19);
|
|
1889
2166
|
|
|
1890
2167
|
var _matchPath2 = _interopRequireDefault(_matchPath);
|
|
1891
2168
|
|
|
@@ -1916,16 +2193,27 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1916
2193
|
};
|
|
1917
2194
|
|
|
1918
2195
|
Switch.prototype.render = function render() {
|
|
2196
|
+
var route = this.context.router.route;
|
|
1919
2197
|
var children = this.props.children;
|
|
1920
2198
|
|
|
1921
|
-
var location = this.props.location ||
|
|
2199
|
+
var location = this.props.location || route.location;
|
|
1922
2200
|
|
|
1923
2201
|
var match = void 0,
|
|
1924
2202
|
child = void 0;
|
|
1925
2203
|
_react2.default.Children.forEach(children, function (element) {
|
|
2204
|
+
if (!_react2.default.isValidElement(element)) return;
|
|
2205
|
+
|
|
2206
|
+
var _element$props = element.props,
|
|
2207
|
+
pathProp = _element$props.path,
|
|
2208
|
+
exact = _element$props.exact,
|
|
2209
|
+
strict = _element$props.strict,
|
|
2210
|
+
from = _element$props.from;
|
|
2211
|
+
|
|
2212
|
+
var path = pathProp || from;
|
|
2213
|
+
|
|
1926
2214
|
if (match == null) {
|
|
1927
2215
|
child = element;
|
|
1928
|
-
match = (0, _matchPath2.default)(location.pathname,
|
|
2216
|
+
match = path ? (0, _matchPath2.default)(location.pathname, { path: path, exact: exact, strict: strict }) : route.match;
|
|
1929
2217
|
}
|
|
1930
2218
|
});
|
|
1931
2219
|
|
|
@@ -1936,12 +2224,14 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1936
2224
|
}(_react2.default.Component);
|
|
1937
2225
|
|
|
1938
2226
|
Switch.contextTypes = {
|
|
1939
|
-
|
|
2227
|
+
router: _propTypes2.default.shape({
|
|
2228
|
+
route: _propTypes2.default.object.isRequired
|
|
2229
|
+
}).isRequired
|
|
1940
2230
|
};
|
|
1941
2231
|
exports.default = Switch;
|
|
1942
2232
|
|
|
1943
2233
|
/***/ },
|
|
1944
|
-
/*
|
|
2234
|
+
/* 24 */
|
|
1945
2235
|
/***/ function(module, exports, __webpack_require__) {
|
|
1946
2236
|
|
|
1947
2237
|
'use strict';
|
|
@@ -1954,29 +2244,100 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
1954
2244
|
|
|
1955
2245
|
var _react2 = _interopRequireDefault(_react);
|
|
1956
2246
|
|
|
1957
|
-
var
|
|
2247
|
+
var _propTypes = __webpack_require__(3);
|
|
2248
|
+
|
|
2249
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
2250
|
+
|
|
2251
|
+
var _hoistNonReactStatics = __webpack_require__(25);
|
|
2252
|
+
|
|
2253
|
+
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
|
|
2254
|
+
|
|
2255
|
+
var _Route = __webpack_require__(18);
|
|
1958
2256
|
|
|
1959
2257
|
var _Route2 = _interopRequireDefault(_Route);
|
|
1960
2258
|
|
|
1961
2259
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1962
2260
|
|
|
2261
|
+
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
|
2262
|
+
|
|
1963
2263
|
/**
|
|
1964
2264
|
* A public higher-order component to access the imperative API
|
|
1965
2265
|
*/
|
|
1966
2266
|
var withRouter = function withRouter(Component) {
|
|
1967
2267
|
var C = function C(props) {
|
|
2268
|
+
var wrappedComponentRef = props.wrappedComponentRef,
|
|
2269
|
+
remainingProps = _objectWithoutProperties(props, ['wrappedComponentRef']);
|
|
2270
|
+
|
|
1968
2271
|
return _react2.default.createElement(_Route2.default, { render: function render(routeComponentProps) {
|
|
1969
|
-
return _react2.default.createElement(Component, _extends({},
|
|
2272
|
+
return _react2.default.createElement(Component, _extends({}, remainingProps, routeComponentProps, { ref: wrappedComponentRef }));
|
|
1970
2273
|
} });
|
|
1971
2274
|
};
|
|
1972
2275
|
|
|
1973
2276
|
C.displayName = 'withRouter(' + (Component.displayName || Component.name) + ')';
|
|
2277
|
+
C.WrappedComponent = Component;
|
|
2278
|
+
|
|
1974
2279
|
|
|
1975
|
-
return C;
|
|
2280
|
+
return (0, _hoistNonReactStatics2.default)(C, Component);
|
|
1976
2281
|
};
|
|
1977
2282
|
|
|
1978
2283
|
exports.default = withRouter;
|
|
1979
2284
|
|
|
2285
|
+
/***/ },
|
|
2286
|
+
/* 25 */
|
|
2287
|
+
/***/ function(module, exports) {
|
|
2288
|
+
|
|
2289
|
+
/**
|
|
2290
|
+
* Copyright 2015, Yahoo! Inc.
|
|
2291
|
+
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
|
2292
|
+
*/
|
|
2293
|
+
'use strict';
|
|
2294
|
+
|
|
2295
|
+
var REACT_STATICS = {
|
|
2296
|
+
childContextTypes: true,
|
|
2297
|
+
contextTypes: true,
|
|
2298
|
+
defaultProps: true,
|
|
2299
|
+
displayName: true,
|
|
2300
|
+
getDefaultProps: true,
|
|
2301
|
+
mixins: true,
|
|
2302
|
+
propTypes: true,
|
|
2303
|
+
type: true
|
|
2304
|
+
};
|
|
2305
|
+
|
|
2306
|
+
var KNOWN_STATICS = {
|
|
2307
|
+
name: true,
|
|
2308
|
+
length: true,
|
|
2309
|
+
prototype: true,
|
|
2310
|
+
caller: true,
|
|
2311
|
+
arguments: true,
|
|
2312
|
+
arity: true
|
|
2313
|
+
};
|
|
2314
|
+
|
|
2315
|
+
var isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function';
|
|
2316
|
+
|
|
2317
|
+
module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) {
|
|
2318
|
+
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
|
|
2319
|
+
var keys = Object.getOwnPropertyNames(sourceComponent);
|
|
2320
|
+
|
|
2321
|
+
/* istanbul ignore else */
|
|
2322
|
+
if (isGetOwnPropertySymbolsAvailable) {
|
|
2323
|
+
keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent));
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2326
|
+
for (var i = 0; i < keys.length; ++i) {
|
|
2327
|
+
if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) {
|
|
2328
|
+
try {
|
|
2329
|
+
targetComponent[keys[i]] = sourceComponent[keys[i]];
|
|
2330
|
+
} catch (error) {
|
|
2331
|
+
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
return targetComponent;
|
|
2338
|
+
};
|
|
2339
|
+
|
|
2340
|
+
|
|
1980
2341
|
/***/ }
|
|
1981
2342
|
/******/ ])
|
|
1982
2343
|
});
|