Initial commit
This commit is contained in:
67
node_modules/react-router/MemoryRouter.js
generated
vendored
Normal file
67
node_modules/react-router/MemoryRouter.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var _warning = require("warning");
|
||||
|
||||
var _warning2 = _interopRequireDefault(_warning);
|
||||
|
||||
var _react = require("react");
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _propTypes = require("prop-types");
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _history = require("history");
|
||||
|
||||
var _Router = require("./Router");
|
||||
|
||||
var _Router2 = _interopRequireDefault(_Router);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
/**
|
||||
* The public API for a <Router> that stores location in memory.
|
||||
*/
|
||||
var MemoryRouter = function (_React$Component) {
|
||||
_inherits(MemoryRouter, _React$Component);
|
||||
|
||||
function MemoryRouter() {
|
||||
var _temp, _this, _ret;
|
||||
|
||||
_classCallCheck(this, MemoryRouter);
|
||||
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = (0, _history.createMemoryHistory)(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
|
||||
}
|
||||
|
||||
MemoryRouter.prototype.componentWillMount = function componentWillMount() {
|
||||
(0, _warning2.default)(!this.props.history, "<MemoryRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`.");
|
||||
};
|
||||
|
||||
MemoryRouter.prototype.render = function render() {
|
||||
return _react2.default.createElement(_Router2.default, { history: this.history, children: this.props.children });
|
||||
};
|
||||
|
||||
return MemoryRouter;
|
||||
}(_react2.default.Component);
|
||||
|
||||
MemoryRouter.propTypes = {
|
||||
initialEntries: _propTypes2.default.array,
|
||||
initialIndex: _propTypes2.default.number,
|
||||
getUserConfirmation: _propTypes2.default.func,
|
||||
keyLength: _propTypes2.default.number,
|
||||
children: _propTypes2.default.node
|
||||
};
|
||||
exports.default = MemoryRouter;
|
||||
90
node_modules/react-router/Prompt.js
generated
vendored
Normal file
90
node_modules/react-router/Prompt.js
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var _react = require("react");
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _propTypes = require("prop-types");
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _invariant = require("invariant");
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
/**
|
||||
* The public API for prompting the user before navigating away
|
||||
* from a screen with a component.
|
||||
*/
|
||||
var Prompt = function (_React$Component) {
|
||||
_inherits(Prompt, _React$Component);
|
||||
|
||||
function Prompt() {
|
||||
_classCallCheck(this, Prompt);
|
||||
|
||||
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
||||
}
|
||||
|
||||
Prompt.prototype.enable = function enable(message) {
|
||||
if (this.unblock) this.unblock();
|
||||
|
||||
this.unblock = this.context.router.history.block(message);
|
||||
};
|
||||
|
||||
Prompt.prototype.disable = function disable() {
|
||||
if (this.unblock) {
|
||||
this.unblock();
|
||||
this.unblock = null;
|
||||
}
|
||||
};
|
||||
|
||||
Prompt.prototype.componentWillMount = function componentWillMount() {
|
||||
(0, _invariant2.default)(this.context.router, "You should not use <Prompt> outside a <Router>");
|
||||
|
||||
if (this.props.when) this.enable(this.props.message);
|
||||
};
|
||||
|
||||
Prompt.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.when) {
|
||||
if (!this.props.when || this.props.message !== nextProps.message) this.enable(nextProps.message);
|
||||
} else {
|
||||
this.disable();
|
||||
}
|
||||
};
|
||||
|
||||
Prompt.prototype.componentWillUnmount = function componentWillUnmount() {
|
||||
this.disable();
|
||||
};
|
||||
|
||||
Prompt.prototype.render = function render() {
|
||||
return null;
|
||||
};
|
||||
|
||||
return Prompt;
|
||||
}(_react2.default.Component);
|
||||
|
||||
Prompt.propTypes = {
|
||||
when: _propTypes2.default.bool,
|
||||
message: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string]).isRequired
|
||||
};
|
||||
Prompt.defaultProps = {
|
||||
when: true
|
||||
};
|
||||
Prompt.contextTypes = {
|
||||
router: _propTypes2.default.shape({
|
||||
history: _propTypes2.default.shape({
|
||||
block: _propTypes2.default.func.isRequired
|
||||
}).isRequired
|
||||
}).isRequired
|
||||
};
|
||||
exports.default = Prompt;
|
||||
131
node_modules/react-router/Redirect.js
generated
vendored
Normal file
131
node_modules/react-router/Redirect.js
generated
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
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; };
|
||||
|
||||
var _react = require("react");
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _propTypes = require("prop-types");
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _warning = require("warning");
|
||||
|
||||
var _warning2 = _interopRequireDefault(_warning);
|
||||
|
||||
var _invariant = require("invariant");
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
var _history = require("history");
|
||||
|
||||
var _generatePath = require("./generatePath");
|
||||
|
||||
var _generatePath2 = _interopRequireDefault(_generatePath);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
/**
|
||||
* The public API for updating the location programmatically
|
||||
* with a component.
|
||||
*/
|
||||
var Redirect = function (_React$Component) {
|
||||
_inherits(Redirect, _React$Component);
|
||||
|
||||
function Redirect() {
|
||||
_classCallCheck(this, Redirect);
|
||||
|
||||
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
||||
}
|
||||
|
||||
Redirect.prototype.isStatic = function isStatic() {
|
||||
return this.context.router && this.context.router.staticContext;
|
||||
};
|
||||
|
||||
Redirect.prototype.componentWillMount = function componentWillMount() {
|
||||
(0, _invariant2.default)(this.context.router, "You should not use <Redirect> outside a <Router>");
|
||||
|
||||
if (this.isStatic()) this.perform();
|
||||
};
|
||||
|
||||
Redirect.prototype.componentDidMount = function componentDidMount() {
|
||||
if (!this.isStatic()) this.perform();
|
||||
};
|
||||
|
||||
Redirect.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
||||
var prevTo = (0, _history.createLocation)(prevProps.to);
|
||||
var nextTo = (0, _history.createLocation)(this.props.to);
|
||||
|
||||
if ((0, _history.locationsAreEqual)(prevTo, nextTo)) {
|
||||
(0, _warning2.default)(false, "You tried to redirect to the same route you're currently on: " + ("\"" + nextTo.pathname + nextTo.search + "\""));
|
||||
return;
|
||||
}
|
||||
|
||||
this.perform();
|
||||
};
|
||||
|
||||
Redirect.prototype.computeTo = function computeTo(_ref) {
|
||||
var computedMatch = _ref.computedMatch,
|
||||
to = _ref.to;
|
||||
|
||||
if (computedMatch) {
|
||||
if (typeof to === "string") {
|
||||
return (0, _generatePath2.default)(to, computedMatch.params);
|
||||
} else {
|
||||
return _extends({}, to, {
|
||||
pathname: (0, _generatePath2.default)(to.pathname, computedMatch.params)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return to;
|
||||
};
|
||||
|
||||
Redirect.prototype.perform = function perform() {
|
||||
var history = this.context.router.history;
|
||||
var push = this.props.push;
|
||||
|
||||
var to = this.computeTo(this.props);
|
||||
|
||||
if (push) {
|
||||
history.push(to);
|
||||
} else {
|
||||
history.replace(to);
|
||||
}
|
||||
};
|
||||
|
||||
Redirect.prototype.render = function render() {
|
||||
return null;
|
||||
};
|
||||
|
||||
return Redirect;
|
||||
}(_react2.default.Component);
|
||||
|
||||
Redirect.propTypes = {
|
||||
computedMatch: _propTypes2.default.object, // private, from <Switch>
|
||||
push: _propTypes2.default.bool,
|
||||
from: _propTypes2.default.string,
|
||||
to: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]).isRequired
|
||||
};
|
||||
Redirect.defaultProps = {
|
||||
push: false
|
||||
};
|
||||
Redirect.contextTypes = {
|
||||
router: _propTypes2.default.shape({
|
||||
history: _propTypes2.default.shape({
|
||||
push: _propTypes2.default.func.isRequired,
|
||||
replace: _propTypes2.default.func.isRequired
|
||||
}).isRequired,
|
||||
staticContext: _propTypes2.default.object
|
||||
}).isRequired
|
||||
};
|
||||
exports.default = Redirect;
|
||||
157
node_modules/react-router/Route.js
generated
vendored
Normal file
157
node_modules/react-router/Route.js
generated
vendored
Normal file
@@ -0,0 +1,157 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
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; };
|
||||
|
||||
var _warning = require("warning");
|
||||
|
||||
var _warning2 = _interopRequireDefault(_warning);
|
||||
|
||||
var _invariant = require("invariant");
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
var _react = require("react");
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _propTypes = require("prop-types");
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _matchPath = require("./matchPath");
|
||||
|
||||
var _matchPath2 = _interopRequireDefault(_matchPath);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var isEmptyChildren = function isEmptyChildren(children) {
|
||||
return _react2.default.Children.count(children) === 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* The public API for matching a single path and rendering.
|
||||
*/
|
||||
|
||||
var Route = function (_React$Component) {
|
||||
_inherits(Route, _React$Component);
|
||||
|
||||
function Route() {
|
||||
var _temp, _this, _ret;
|
||||
|
||||
_classCallCheck(this, Route);
|
||||
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
|
||||
match: _this.computeMatch(_this.props, _this.context.router)
|
||||
}, _temp), _possibleConstructorReturn(_this, _ret);
|
||||
}
|
||||
|
||||
Route.prototype.getChildContext = function getChildContext() {
|
||||
return {
|
||||
router: _extends({}, this.context.router, {
|
||||
route: {
|
||||
location: this.props.location || this.context.router.route.location,
|
||||
match: this.state.match
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
|
||||
Route.prototype.computeMatch = function computeMatch(_ref, router) {
|
||||
var computedMatch = _ref.computedMatch,
|
||||
location = _ref.location,
|
||||
path = _ref.path,
|
||||
strict = _ref.strict,
|
||||
exact = _ref.exact,
|
||||
sensitive = _ref.sensitive;
|
||||
|
||||
if (computedMatch) return computedMatch; // <Switch> already computed the match for us
|
||||
|
||||
(0, _invariant2.default)(router, "You should not use <Route> or withRouter() outside a <Router>");
|
||||
|
||||
var route = router.route;
|
||||
|
||||
var pathname = (location || route.location).pathname;
|
||||
|
||||
return (0, _matchPath2.default)(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }, route.match);
|
||||
};
|
||||
|
||||
Route.prototype.componentWillMount = function componentWillMount() {
|
||||
(0, _warning2.default)(!(this.props.component && this.props.render), "You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored");
|
||||
|
||||
(0, _warning2.default)(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored");
|
||||
|
||||
(0, _warning2.default)(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored");
|
||||
};
|
||||
|
||||
Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) {
|
||||
(0, _warning2.default)(!(nextProps.location && !this.props.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.');
|
||||
|
||||
(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.');
|
||||
|
||||
this.setState({
|
||||
match: this.computeMatch(nextProps, nextContext.router)
|
||||
});
|
||||
};
|
||||
|
||||
Route.prototype.render = function render() {
|
||||
var match = this.state.match;
|
||||
var _props = this.props,
|
||||
children = _props.children,
|
||||
component = _props.component,
|
||||
render = _props.render;
|
||||
var _context$router = this.context.router,
|
||||
history = _context$router.history,
|
||||
route = _context$router.route,
|
||||
staticContext = _context$router.staticContext;
|
||||
|
||||
var location = this.props.location || route.location;
|
||||
var props = { match: match, location: location, history: history, staticContext: staticContext };
|
||||
|
||||
if (component) return match ? _react2.default.createElement(component, props) : null;
|
||||
|
||||
if (render) return match ? render(props) : null;
|
||||
|
||||
if (typeof children === "function") return children(props);
|
||||
|
||||
if (children && !isEmptyChildren(children)) return _react2.default.Children.only(children);
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
return Route;
|
||||
}(_react2.default.Component);
|
||||
|
||||
Route.propTypes = {
|
||||
computedMatch: _propTypes2.default.object, // private, from <Switch>
|
||||
path: _propTypes2.default.string,
|
||||
exact: _propTypes2.default.bool,
|
||||
strict: _propTypes2.default.bool,
|
||||
sensitive: _propTypes2.default.bool,
|
||||
component: _propTypes2.default.func,
|
||||
render: _propTypes2.default.func,
|
||||
children: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.node]),
|
||||
location: _propTypes2.default.object
|
||||
};
|
||||
Route.contextTypes = {
|
||||
router: _propTypes2.default.shape({
|
||||
history: _propTypes2.default.object.isRequired,
|
||||
route: _propTypes2.default.object.isRequired,
|
||||
staticContext: _propTypes2.default.object
|
||||
})
|
||||
};
|
||||
Route.childContextTypes = {
|
||||
router: _propTypes2.default.object.isRequired
|
||||
};
|
||||
exports.default = Route;
|
||||
119
node_modules/react-router/Router.js
generated
vendored
Normal file
119
node_modules/react-router/Router.js
generated
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
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; };
|
||||
|
||||
var _warning = require("warning");
|
||||
|
||||
var _warning2 = _interopRequireDefault(_warning);
|
||||
|
||||
var _invariant = require("invariant");
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
var _react = require("react");
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _propTypes = require("prop-types");
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
/**
|
||||
* The public API for putting history on context.
|
||||
*/
|
||||
var Router = function (_React$Component) {
|
||||
_inherits(Router, _React$Component);
|
||||
|
||||
function Router() {
|
||||
var _temp, _this, _ret;
|
||||
|
||||
_classCallCheck(this, Router);
|
||||
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
|
||||
match: _this.computeMatch(_this.props.history.location.pathname)
|
||||
}, _temp), _possibleConstructorReturn(_this, _ret);
|
||||
}
|
||||
|
||||
Router.prototype.getChildContext = function getChildContext() {
|
||||
return {
|
||||
router: _extends({}, this.context.router, {
|
||||
history: this.props.history,
|
||||
route: {
|
||||
location: this.props.history.location,
|
||||
match: this.state.match
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
|
||||
Router.prototype.computeMatch = function computeMatch(pathname) {
|
||||
return {
|
||||
path: "/",
|
||||
url: "/",
|
||||
params: {},
|
||||
isExact: pathname === "/"
|
||||
};
|
||||
};
|
||||
|
||||
Router.prototype.componentWillMount = function componentWillMount() {
|
||||
var _this2 = this;
|
||||
|
||||
var _props = this.props,
|
||||
children = _props.children,
|
||||
history = _props.history;
|
||||
|
||||
|
||||
(0, _invariant2.default)(children == null || _react2.default.Children.count(children) === 1, "A <Router> may have only one child element");
|
||||
|
||||
// Do this here so we can setState when a <Redirect> changes the
|
||||
// location in componentWillMount. This happens e.g. when doing
|
||||
// server rendering using a <StaticRouter>.
|
||||
this.unlisten = history.listen(function () {
|
||||
_this2.setState({
|
||||
match: _this2.computeMatch(history.location.pathname)
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
||||
(0, _warning2.default)(this.props.history === nextProps.history, "You cannot change <Router history>");
|
||||
};
|
||||
|
||||
Router.prototype.componentWillUnmount = function componentWillUnmount() {
|
||||
this.unlisten();
|
||||
};
|
||||
|
||||
Router.prototype.render = function render() {
|
||||
var children = this.props.children;
|
||||
|
||||
return children ? _react2.default.Children.only(children) : null;
|
||||
};
|
||||
|
||||
return Router;
|
||||
}(_react2.default.Component);
|
||||
|
||||
Router.propTypes = {
|
||||
history: _propTypes2.default.object.isRequired,
|
||||
children: _propTypes2.default.node
|
||||
};
|
||||
Router.contextTypes = {
|
||||
router: _propTypes2.default.object
|
||||
};
|
||||
Router.childContextTypes = {
|
||||
router: _propTypes2.default.object.isRequired
|
||||
};
|
||||
exports.default = Router;
|
||||
169
node_modules/react-router/StaticRouter.js
generated
vendored
Normal file
169
node_modules/react-router/StaticRouter.js
generated
vendored
Normal file
@@ -0,0 +1,169 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
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; };
|
||||
|
||||
var _warning = require("warning");
|
||||
|
||||
var _warning2 = _interopRequireDefault(_warning);
|
||||
|
||||
var _invariant = require("invariant");
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
var _react = require("react");
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _propTypes = require("prop-types");
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _history = require("history");
|
||||
|
||||
var _Router = require("./Router");
|
||||
|
||||
var _Router2 = _interopRequireDefault(_Router);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
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; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var addLeadingSlash = function addLeadingSlash(path) {
|
||||
return path.charAt(0) === "/" ? path : "/" + path;
|
||||
};
|
||||
|
||||
var addBasename = function addBasename(basename, location) {
|
||||
if (!basename) return location;
|
||||
|
||||
return _extends({}, location, {
|
||||
pathname: addLeadingSlash(basename) + location.pathname
|
||||
});
|
||||
};
|
||||
|
||||
var stripBasename = function stripBasename(basename, location) {
|
||||
if (!basename) return location;
|
||||
|
||||
var base = addLeadingSlash(basename);
|
||||
|
||||
if (location.pathname.indexOf(base) !== 0) return location;
|
||||
|
||||
return _extends({}, location, {
|
||||
pathname: location.pathname.substr(base.length)
|
||||
});
|
||||
};
|
||||
|
||||
var createURL = function createURL(location) {
|
||||
return typeof location === "string" ? location : (0, _history.createPath)(location);
|
||||
};
|
||||
|
||||
var staticHandler = function staticHandler(methodName) {
|
||||
return function () {
|
||||
(0, _invariant2.default)(false, "You cannot %s with <StaticRouter>", methodName);
|
||||
};
|
||||
};
|
||||
|
||||
var noop = function noop() {};
|
||||
|
||||
/**
|
||||
* The public top-level API for a "static" <Router>, so-called because it
|
||||
* can't actually change the current location. Instead, it just records
|
||||
* location changes in a context object. Useful mainly in testing and
|
||||
* server-rendering scenarios.
|
||||
*/
|
||||
|
||||
var StaticRouter = function (_React$Component) {
|
||||
_inherits(StaticRouter, _React$Component);
|
||||
|
||||
function StaticRouter() {
|
||||
var _temp, _this, _ret;
|
||||
|
||||
_classCallCheck(this, StaticRouter);
|
||||
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.createHref = function (path) {
|
||||
return addLeadingSlash(_this.props.basename + createURL(path));
|
||||
}, _this.handlePush = function (location) {
|
||||
var _this$props = _this.props,
|
||||
basename = _this$props.basename,
|
||||
context = _this$props.context;
|
||||
|
||||
context.action = "PUSH";
|
||||
context.location = addBasename(basename, (0, _history.createLocation)(location));
|
||||
context.url = createURL(context.location);
|
||||
}, _this.handleReplace = function (location) {
|
||||
var _this$props2 = _this.props,
|
||||
basename = _this$props2.basename,
|
||||
context = _this$props2.context;
|
||||
|
||||
context.action = "REPLACE";
|
||||
context.location = addBasename(basename, (0, _history.createLocation)(location));
|
||||
context.url = createURL(context.location);
|
||||
}, _this.handleListen = function () {
|
||||
return noop;
|
||||
}, _this.handleBlock = function () {
|
||||
return noop;
|
||||
}, _temp), _possibleConstructorReturn(_this, _ret);
|
||||
}
|
||||
|
||||
StaticRouter.prototype.getChildContext = function getChildContext() {
|
||||
return {
|
||||
router: {
|
||||
staticContext: this.props.context
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
StaticRouter.prototype.componentWillMount = function componentWillMount() {
|
||||
(0, _warning2.default)(!this.props.history, "<StaticRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`.");
|
||||
};
|
||||
|
||||
StaticRouter.prototype.render = function render() {
|
||||
var _props = this.props,
|
||||
basename = _props.basename,
|
||||
context = _props.context,
|
||||
location = _props.location,
|
||||
props = _objectWithoutProperties(_props, ["basename", "context", "location"]);
|
||||
|
||||
var history = {
|
||||
createHref: this.createHref,
|
||||
action: "POP",
|
||||
location: stripBasename(basename, (0, _history.createLocation)(location)),
|
||||
push: this.handlePush,
|
||||
replace: this.handleReplace,
|
||||
go: staticHandler("go"),
|
||||
goBack: staticHandler("goBack"),
|
||||
goForward: staticHandler("goForward"),
|
||||
listen: this.handleListen,
|
||||
block: this.handleBlock
|
||||
};
|
||||
|
||||
return _react2.default.createElement(_Router2.default, _extends({}, props, { history: history }));
|
||||
};
|
||||
|
||||
return StaticRouter;
|
||||
}(_react2.default.Component);
|
||||
|
||||
StaticRouter.propTypes = {
|
||||
basename: _propTypes2.default.string,
|
||||
context: _propTypes2.default.object.isRequired,
|
||||
location: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object])
|
||||
};
|
||||
StaticRouter.defaultProps = {
|
||||
basename: "",
|
||||
location: "/"
|
||||
};
|
||||
StaticRouter.childContextTypes = {
|
||||
router: _propTypes2.default.object.isRequired
|
||||
};
|
||||
exports.default = StaticRouter;
|
||||
94
node_modules/react-router/Switch.js
generated
vendored
Normal file
94
node_modules/react-router/Switch.js
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var _react = require("react");
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _propTypes = require("prop-types");
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _warning = require("warning");
|
||||
|
||||
var _warning2 = _interopRequireDefault(_warning);
|
||||
|
||||
var _invariant = require("invariant");
|
||||
|
||||
var _invariant2 = _interopRequireDefault(_invariant);
|
||||
|
||||
var _matchPath = require("./matchPath");
|
||||
|
||||
var _matchPath2 = _interopRequireDefault(_matchPath);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
/**
|
||||
* The public API for rendering the first <Route> that matches.
|
||||
*/
|
||||
var Switch = function (_React$Component) {
|
||||
_inherits(Switch, _React$Component);
|
||||
|
||||
function Switch() {
|
||||
_classCallCheck(this, Switch);
|
||||
|
||||
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
||||
}
|
||||
|
||||
Switch.prototype.componentWillMount = function componentWillMount() {
|
||||
(0, _invariant2.default)(this.context.router, "You should not use <Switch> outside a <Router>");
|
||||
};
|
||||
|
||||
Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
||||
(0, _warning2.default)(!(nextProps.location && !this.props.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.');
|
||||
|
||||
(0, _warning2.default)(!(!nextProps.location && this.props.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.');
|
||||
};
|
||||
|
||||
Switch.prototype.render = function render() {
|
||||
var route = this.context.router.route;
|
||||
var children = this.props.children;
|
||||
|
||||
var location = this.props.location || route.location;
|
||||
|
||||
var match = void 0,
|
||||
child = void 0;
|
||||
_react2.default.Children.forEach(children, function (element) {
|
||||
if (match == null && _react2.default.isValidElement(element)) {
|
||||
var _element$props = element.props,
|
||||
pathProp = _element$props.path,
|
||||
exact = _element$props.exact,
|
||||
strict = _element$props.strict,
|
||||
sensitive = _element$props.sensitive,
|
||||
from = _element$props.from;
|
||||
|
||||
var path = pathProp || from;
|
||||
|
||||
child = element;
|
||||
match = (0, _matchPath2.default)(location.pathname, { path: path, exact: exact, strict: strict, sensitive: sensitive }, route.match);
|
||||
}
|
||||
});
|
||||
|
||||
return match ? _react2.default.cloneElement(child, { location: location, computedMatch: match }) : null;
|
||||
};
|
||||
|
||||
return Switch;
|
||||
}(_react2.default.Component);
|
||||
|
||||
Switch.contextTypes = {
|
||||
router: _propTypes2.default.shape({
|
||||
route: _propTypes2.default.object.isRequired
|
||||
}).isRequired
|
||||
};
|
||||
Switch.propTypes = {
|
||||
children: _propTypes2.default.node,
|
||||
location: _propTypes2.default.object
|
||||
};
|
||||
exports.default = Switch;
|
||||
52
node_modules/react-router/es/MemoryRouter.js
generated
vendored
Normal file
52
node_modules/react-router/es/MemoryRouter.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
import warning from "warning";
|
||||
import React from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import { createMemoryHistory as createHistory } from "history";
|
||||
import Router from "./Router";
|
||||
|
||||
/**
|
||||
* The public API for a <Router> that stores location in memory.
|
||||
*/
|
||||
|
||||
var MemoryRouter = function (_React$Component) {
|
||||
_inherits(MemoryRouter, _React$Component);
|
||||
|
||||
function MemoryRouter() {
|
||||
var _temp, _this, _ret;
|
||||
|
||||
_classCallCheck(this, MemoryRouter);
|
||||
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createHistory(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
|
||||
}
|
||||
|
||||
MemoryRouter.prototype.componentWillMount = function componentWillMount() {
|
||||
warning(!this.props.history, "<MemoryRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`.");
|
||||
};
|
||||
|
||||
MemoryRouter.prototype.render = function render() {
|
||||
return React.createElement(Router, { history: this.history, children: this.props.children });
|
||||
};
|
||||
|
||||
return MemoryRouter;
|
||||
}(React.Component);
|
||||
|
||||
MemoryRouter.propTypes = {
|
||||
initialEntries: PropTypes.array,
|
||||
initialIndex: PropTypes.number,
|
||||
getUserConfirmation: PropTypes.func,
|
||||
keyLength: PropTypes.number,
|
||||
children: PropTypes.node
|
||||
};
|
||||
|
||||
|
||||
export default MemoryRouter;
|
||||
79
node_modules/react-router/es/Prompt.js
generated
vendored
Normal file
79
node_modules/react-router/es/Prompt.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
import React from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import invariant from "invariant";
|
||||
|
||||
/**
|
||||
* The public API for prompting the user before navigating away
|
||||
* from a screen with a component.
|
||||
*/
|
||||
|
||||
var Prompt = function (_React$Component) {
|
||||
_inherits(Prompt, _React$Component);
|
||||
|
||||
function Prompt() {
|
||||
_classCallCheck(this, Prompt);
|
||||
|
||||
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
||||
}
|
||||
|
||||
Prompt.prototype.enable = function enable(message) {
|
||||
if (this.unblock) this.unblock();
|
||||
|
||||
this.unblock = this.context.router.history.block(message);
|
||||
};
|
||||
|
||||
Prompt.prototype.disable = function disable() {
|
||||
if (this.unblock) {
|
||||
this.unblock();
|
||||
this.unblock = null;
|
||||
}
|
||||
};
|
||||
|
||||
Prompt.prototype.componentWillMount = function componentWillMount() {
|
||||
invariant(this.context.router, "You should not use <Prompt> outside a <Router>");
|
||||
|
||||
if (this.props.when) this.enable(this.props.message);
|
||||
};
|
||||
|
||||
Prompt.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.when) {
|
||||
if (!this.props.when || this.props.message !== nextProps.message) this.enable(nextProps.message);
|
||||
} else {
|
||||
this.disable();
|
||||
}
|
||||
};
|
||||
|
||||
Prompt.prototype.componentWillUnmount = function componentWillUnmount() {
|
||||
this.disable();
|
||||
};
|
||||
|
||||
Prompt.prototype.render = function render() {
|
||||
return null;
|
||||
};
|
||||
|
||||
return Prompt;
|
||||
}(React.Component);
|
||||
|
||||
Prompt.propTypes = {
|
||||
when: PropTypes.bool,
|
||||
message: PropTypes.oneOfType([PropTypes.func, PropTypes.string]).isRequired
|
||||
};
|
||||
Prompt.defaultProps = {
|
||||
when: true
|
||||
};
|
||||
Prompt.contextTypes = {
|
||||
router: PropTypes.shape({
|
||||
history: PropTypes.shape({
|
||||
block: PropTypes.func.isRequired
|
||||
}).isRequired
|
||||
}).isRequired
|
||||
};
|
||||
|
||||
|
||||
export default Prompt;
|
||||
113
node_modules/react-router/es/Redirect.js
generated
vendored
Normal file
113
node_modules/react-router/es/Redirect.js
generated
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
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; };
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
import React from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import warning from "warning";
|
||||
import invariant from "invariant";
|
||||
import { createLocation, locationsAreEqual } from "history";
|
||||
import generatePath from "./generatePath";
|
||||
|
||||
/**
|
||||
* The public API for updating the location programmatically
|
||||
* with a component.
|
||||
*/
|
||||
|
||||
var Redirect = function (_React$Component) {
|
||||
_inherits(Redirect, _React$Component);
|
||||
|
||||
function Redirect() {
|
||||
_classCallCheck(this, Redirect);
|
||||
|
||||
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
||||
}
|
||||
|
||||
Redirect.prototype.isStatic = function isStatic() {
|
||||
return this.context.router && this.context.router.staticContext;
|
||||
};
|
||||
|
||||
Redirect.prototype.componentWillMount = function componentWillMount() {
|
||||
invariant(this.context.router, "You should not use <Redirect> outside a <Router>");
|
||||
|
||||
if (this.isStatic()) this.perform();
|
||||
};
|
||||
|
||||
Redirect.prototype.componentDidMount = function componentDidMount() {
|
||||
if (!this.isStatic()) this.perform();
|
||||
};
|
||||
|
||||
Redirect.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
||||
var prevTo = createLocation(prevProps.to);
|
||||
var nextTo = createLocation(this.props.to);
|
||||
|
||||
if (locationsAreEqual(prevTo, nextTo)) {
|
||||
warning(false, "You tried to redirect to the same route you're currently on: " + ("\"" + nextTo.pathname + nextTo.search + "\""));
|
||||
return;
|
||||
}
|
||||
|
||||
this.perform();
|
||||
};
|
||||
|
||||
Redirect.prototype.computeTo = function computeTo(_ref) {
|
||||
var computedMatch = _ref.computedMatch,
|
||||
to = _ref.to;
|
||||
|
||||
if (computedMatch) {
|
||||
if (typeof to === "string") {
|
||||
return generatePath(to, computedMatch.params);
|
||||
} else {
|
||||
return _extends({}, to, {
|
||||
pathname: generatePath(to.pathname, computedMatch.params)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return to;
|
||||
};
|
||||
|
||||
Redirect.prototype.perform = function perform() {
|
||||
var history = this.context.router.history;
|
||||
var push = this.props.push;
|
||||
|
||||
var to = this.computeTo(this.props);
|
||||
|
||||
if (push) {
|
||||
history.push(to);
|
||||
} else {
|
||||
history.replace(to);
|
||||
}
|
||||
};
|
||||
|
||||
Redirect.prototype.render = function render() {
|
||||
return null;
|
||||
};
|
||||
|
||||
return Redirect;
|
||||
}(React.Component);
|
||||
|
||||
Redirect.propTypes = {
|
||||
computedMatch: PropTypes.object, // private, from <Switch>
|
||||
push: PropTypes.bool,
|
||||
from: PropTypes.string,
|
||||
to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired
|
||||
};
|
||||
Redirect.defaultProps = {
|
||||
push: false
|
||||
};
|
||||
Redirect.contextTypes = {
|
||||
router: PropTypes.shape({
|
||||
history: PropTypes.shape({
|
||||
push: PropTypes.func.isRequired,
|
||||
replace: PropTypes.func.isRequired
|
||||
}).isRequired,
|
||||
staticContext: PropTypes.object
|
||||
}).isRequired
|
||||
};
|
||||
|
||||
|
||||
export default Redirect;
|
||||
139
node_modules/react-router/es/Route.js
generated
vendored
Normal file
139
node_modules/react-router/es/Route.js
generated
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
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; };
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
import warning from "warning";
|
||||
import invariant from "invariant";
|
||||
import React from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import matchPath from "./matchPath";
|
||||
|
||||
var isEmptyChildren = function isEmptyChildren(children) {
|
||||
return React.Children.count(children) === 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* The public API for matching a single path and rendering.
|
||||
*/
|
||||
|
||||
var Route = function (_React$Component) {
|
||||
_inherits(Route, _React$Component);
|
||||
|
||||
function Route() {
|
||||
var _temp, _this, _ret;
|
||||
|
||||
_classCallCheck(this, Route);
|
||||
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
|
||||
match: _this.computeMatch(_this.props, _this.context.router)
|
||||
}, _temp), _possibleConstructorReturn(_this, _ret);
|
||||
}
|
||||
|
||||
Route.prototype.getChildContext = function getChildContext() {
|
||||
return {
|
||||
router: _extends({}, this.context.router, {
|
||||
route: {
|
||||
location: this.props.location || this.context.router.route.location,
|
||||
match: this.state.match
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
|
||||
Route.prototype.computeMatch = function computeMatch(_ref, router) {
|
||||
var computedMatch = _ref.computedMatch,
|
||||
location = _ref.location,
|
||||
path = _ref.path,
|
||||
strict = _ref.strict,
|
||||
exact = _ref.exact,
|
||||
sensitive = _ref.sensitive;
|
||||
|
||||
if (computedMatch) return computedMatch; // <Switch> already computed the match for us
|
||||
|
||||
invariant(router, "You should not use <Route> or withRouter() outside a <Router>");
|
||||
|
||||
var route = router.route;
|
||||
|
||||
var pathname = (location || route.location).pathname;
|
||||
|
||||
return matchPath(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }, route.match);
|
||||
};
|
||||
|
||||
Route.prototype.componentWillMount = function componentWillMount() {
|
||||
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");
|
||||
|
||||
warning(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored");
|
||||
|
||||
warning(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored");
|
||||
};
|
||||
|
||||
Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) {
|
||||
warning(!(nextProps.location && !this.props.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.');
|
||||
|
||||
warning(!(!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.');
|
||||
|
||||
this.setState({
|
||||
match: this.computeMatch(nextProps, nextContext.router)
|
||||
});
|
||||
};
|
||||
|
||||
Route.prototype.render = function render() {
|
||||
var match = this.state.match;
|
||||
var _props = this.props,
|
||||
children = _props.children,
|
||||
component = _props.component,
|
||||
render = _props.render;
|
||||
var _context$router = this.context.router,
|
||||
history = _context$router.history,
|
||||
route = _context$router.route,
|
||||
staticContext = _context$router.staticContext;
|
||||
|
||||
var location = this.props.location || route.location;
|
||||
var props = { match: match, location: location, history: history, staticContext: staticContext };
|
||||
|
||||
if (component) return match ? React.createElement(component, props) : null;
|
||||
|
||||
if (render) return match ? render(props) : null;
|
||||
|
||||
if (typeof children === "function") return children(props);
|
||||
|
||||
if (children && !isEmptyChildren(children)) return React.Children.only(children);
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
return Route;
|
||||
}(React.Component);
|
||||
|
||||
Route.propTypes = {
|
||||
computedMatch: PropTypes.object, // private, from <Switch>
|
||||
path: PropTypes.string,
|
||||
exact: PropTypes.bool,
|
||||
strict: PropTypes.bool,
|
||||
sensitive: PropTypes.bool,
|
||||
component: PropTypes.func,
|
||||
render: PropTypes.func,
|
||||
children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
||||
location: PropTypes.object
|
||||
};
|
||||
Route.contextTypes = {
|
||||
router: PropTypes.shape({
|
||||
history: PropTypes.object.isRequired,
|
||||
route: PropTypes.object.isRequired,
|
||||
staticContext: PropTypes.object
|
||||
})
|
||||
};
|
||||
Route.childContextTypes = {
|
||||
router: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
|
||||
export default Route;
|
||||
105
node_modules/react-router/es/Router.js
generated
vendored
Normal file
105
node_modules/react-router/es/Router.js
generated
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
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; };
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
import warning from "warning";
|
||||
import invariant from "invariant";
|
||||
import React from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
/**
|
||||
* The public API for putting history on context.
|
||||
*/
|
||||
|
||||
var Router = function (_React$Component) {
|
||||
_inherits(Router, _React$Component);
|
||||
|
||||
function Router() {
|
||||
var _temp, _this, _ret;
|
||||
|
||||
_classCallCheck(this, Router);
|
||||
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
|
||||
match: _this.computeMatch(_this.props.history.location.pathname)
|
||||
}, _temp), _possibleConstructorReturn(_this, _ret);
|
||||
}
|
||||
|
||||
Router.prototype.getChildContext = function getChildContext() {
|
||||
return {
|
||||
router: _extends({}, this.context.router, {
|
||||
history: this.props.history,
|
||||
route: {
|
||||
location: this.props.history.location,
|
||||
match: this.state.match
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
|
||||
Router.prototype.computeMatch = function computeMatch(pathname) {
|
||||
return {
|
||||
path: "/",
|
||||
url: "/",
|
||||
params: {},
|
||||
isExact: pathname === "/"
|
||||
};
|
||||
};
|
||||
|
||||
Router.prototype.componentWillMount = function componentWillMount() {
|
||||
var _this2 = this;
|
||||
|
||||
var _props = this.props,
|
||||
children = _props.children,
|
||||
history = _props.history;
|
||||
|
||||
|
||||
invariant(children == null || React.Children.count(children) === 1, "A <Router> may have only one child element");
|
||||
|
||||
// Do this here so we can setState when a <Redirect> changes the
|
||||
// location in componentWillMount. This happens e.g. when doing
|
||||
// server rendering using a <StaticRouter>.
|
||||
this.unlisten = history.listen(function () {
|
||||
_this2.setState({
|
||||
match: _this2.computeMatch(history.location.pathname)
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
||||
warning(this.props.history === nextProps.history, "You cannot change <Router history>");
|
||||
};
|
||||
|
||||
Router.prototype.componentWillUnmount = function componentWillUnmount() {
|
||||
this.unlisten();
|
||||
};
|
||||
|
||||
Router.prototype.render = function render() {
|
||||
var children = this.props.children;
|
||||
|
||||
return children ? React.Children.only(children) : null;
|
||||
};
|
||||
|
||||
return Router;
|
||||
}(React.Component);
|
||||
|
||||
Router.propTypes = {
|
||||
history: PropTypes.object.isRequired,
|
||||
children: PropTypes.node
|
||||
};
|
||||
Router.contextTypes = {
|
||||
router: PropTypes.object
|
||||
};
|
||||
Router.childContextTypes = {
|
||||
router: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
|
||||
export default Router;
|
||||
5
node_modules/react-router/es/RouterContext.js
generated
vendored
Normal file
5
node_modules/react-router/es/RouterContext.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import createReactContext from "create-react-context";
|
||||
|
||||
var RouterContext = createReactContext({});
|
||||
|
||||
export default RouterContext;
|
||||
150
node_modules/react-router/es/StaticRouter.js
generated
vendored
Normal file
150
node_modules/react-router/es/StaticRouter.js
generated
vendored
Normal file
@@ -0,0 +1,150 @@
|
||||
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; };
|
||||
|
||||
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; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
import warning from "warning";
|
||||
import invariant from "invariant";
|
||||
import React from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import { createLocation, createPath } from "history";
|
||||
import Router from "./Router";
|
||||
|
||||
var addLeadingSlash = function addLeadingSlash(path) {
|
||||
return path.charAt(0) === "/" ? path : "/" + path;
|
||||
};
|
||||
|
||||
var addBasename = function addBasename(basename, location) {
|
||||
if (!basename) return location;
|
||||
|
||||
return _extends({}, location, {
|
||||
pathname: addLeadingSlash(basename) + location.pathname
|
||||
});
|
||||
};
|
||||
|
||||
var stripBasename = function stripBasename(basename, location) {
|
||||
if (!basename) return location;
|
||||
|
||||
var base = addLeadingSlash(basename);
|
||||
|
||||
if (location.pathname.indexOf(base) !== 0) return location;
|
||||
|
||||
return _extends({}, location, {
|
||||
pathname: location.pathname.substr(base.length)
|
||||
});
|
||||
};
|
||||
|
||||
var createURL = function createURL(location) {
|
||||
return typeof location === "string" ? location : createPath(location);
|
||||
};
|
||||
|
||||
var staticHandler = function staticHandler(methodName) {
|
||||
return function () {
|
||||
invariant(false, "You cannot %s with <StaticRouter>", methodName);
|
||||
};
|
||||
};
|
||||
|
||||
var noop = function noop() {};
|
||||
|
||||
/**
|
||||
* The public top-level API for a "static" <Router>, so-called because it
|
||||
* can't actually change the current location. Instead, it just records
|
||||
* location changes in a context object. Useful mainly in testing and
|
||||
* server-rendering scenarios.
|
||||
*/
|
||||
|
||||
var StaticRouter = function (_React$Component) {
|
||||
_inherits(StaticRouter, _React$Component);
|
||||
|
||||
function StaticRouter() {
|
||||
var _temp, _this, _ret;
|
||||
|
||||
_classCallCheck(this, StaticRouter);
|
||||
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.createHref = function (path) {
|
||||
return addLeadingSlash(_this.props.basename + createURL(path));
|
||||
}, _this.handlePush = function (location) {
|
||||
var _this$props = _this.props,
|
||||
basename = _this$props.basename,
|
||||
context = _this$props.context;
|
||||
|
||||
context.action = "PUSH";
|
||||
context.location = addBasename(basename, createLocation(location));
|
||||
context.url = createURL(context.location);
|
||||
}, _this.handleReplace = function (location) {
|
||||
var _this$props2 = _this.props,
|
||||
basename = _this$props2.basename,
|
||||
context = _this$props2.context;
|
||||
|
||||
context.action = "REPLACE";
|
||||
context.location = addBasename(basename, createLocation(location));
|
||||
context.url = createURL(context.location);
|
||||
}, _this.handleListen = function () {
|
||||
return noop;
|
||||
}, _this.handleBlock = function () {
|
||||
return noop;
|
||||
}, _temp), _possibleConstructorReturn(_this, _ret);
|
||||
}
|
||||
|
||||
StaticRouter.prototype.getChildContext = function getChildContext() {
|
||||
return {
|
||||
router: {
|
||||
staticContext: this.props.context
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
StaticRouter.prototype.componentWillMount = function componentWillMount() {
|
||||
warning(!this.props.history, "<StaticRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`.");
|
||||
};
|
||||
|
||||
StaticRouter.prototype.render = function render() {
|
||||
var _props = this.props,
|
||||
basename = _props.basename,
|
||||
context = _props.context,
|
||||
location = _props.location,
|
||||
props = _objectWithoutProperties(_props, ["basename", "context", "location"]);
|
||||
|
||||
var history = {
|
||||
createHref: this.createHref,
|
||||
action: "POP",
|
||||
location: stripBasename(basename, createLocation(location)),
|
||||
push: this.handlePush,
|
||||
replace: this.handleReplace,
|
||||
go: staticHandler("go"),
|
||||
goBack: staticHandler("goBack"),
|
||||
goForward: staticHandler("goForward"),
|
||||
listen: this.handleListen,
|
||||
block: this.handleBlock
|
||||
};
|
||||
|
||||
return React.createElement(Router, _extends({}, props, { history: history }));
|
||||
};
|
||||
|
||||
return StaticRouter;
|
||||
}(React.Component);
|
||||
|
||||
StaticRouter.propTypes = {
|
||||
basename: PropTypes.string,
|
||||
context: PropTypes.object.isRequired,
|
||||
location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])
|
||||
};
|
||||
StaticRouter.defaultProps = {
|
||||
basename: "",
|
||||
location: "/"
|
||||
};
|
||||
StaticRouter.childContextTypes = {
|
||||
router: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
|
||||
export default StaticRouter;
|
||||
77
node_modules/react-router/es/Switch.js
generated
vendored
Normal file
77
node_modules/react-router/es/Switch.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
import React from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import warning from "warning";
|
||||
import invariant from "invariant";
|
||||
import matchPath from "./matchPath";
|
||||
|
||||
/**
|
||||
* The public API for rendering the first <Route> that matches.
|
||||
*/
|
||||
|
||||
var Switch = function (_React$Component) {
|
||||
_inherits(Switch, _React$Component);
|
||||
|
||||
function Switch() {
|
||||
_classCallCheck(this, Switch);
|
||||
|
||||
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
||||
}
|
||||
|
||||
Switch.prototype.componentWillMount = function componentWillMount() {
|
||||
invariant(this.context.router, "You should not use <Switch> outside a <Router>");
|
||||
};
|
||||
|
||||
Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
||||
warning(!(nextProps.location && !this.props.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.');
|
||||
|
||||
warning(!(!nextProps.location && this.props.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.');
|
||||
};
|
||||
|
||||
Switch.prototype.render = function render() {
|
||||
var route = this.context.router.route;
|
||||
var children = this.props.children;
|
||||
|
||||
var location = this.props.location || route.location;
|
||||
|
||||
var match = void 0,
|
||||
child = void 0;
|
||||
React.Children.forEach(children, function (element) {
|
||||
if (match == null && React.isValidElement(element)) {
|
||||
var _element$props = element.props,
|
||||
pathProp = _element$props.path,
|
||||
exact = _element$props.exact,
|
||||
strict = _element$props.strict,
|
||||
sensitive = _element$props.sensitive,
|
||||
from = _element$props.from;
|
||||
|
||||
var path = pathProp || from;
|
||||
|
||||
child = element;
|
||||
match = matchPath(location.pathname, { path: path, exact: exact, strict: strict, sensitive: sensitive }, route.match);
|
||||
}
|
||||
});
|
||||
|
||||
return match ? React.cloneElement(child, { location: location, computedMatch: match }) : null;
|
||||
};
|
||||
|
||||
return Switch;
|
||||
}(React.Component);
|
||||
|
||||
Switch.contextTypes = {
|
||||
router: PropTypes.shape({
|
||||
route: PropTypes.object.isRequired
|
||||
}).isRequired
|
||||
};
|
||||
Switch.propTypes = {
|
||||
children: PropTypes.node,
|
||||
location: PropTypes.object
|
||||
};
|
||||
|
||||
|
||||
export default Switch;
|
||||
37
node_modules/react-router/es/generatePath.js
generated
vendored
Normal file
37
node_modules/react-router/es/generatePath.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import pathToRegexp from "path-to-regexp";
|
||||
|
||||
var patternCache = {};
|
||||
var cacheLimit = 10000;
|
||||
var cacheCount = 0;
|
||||
|
||||
var compileGenerator = function compileGenerator(pattern) {
|
||||
var cacheKey = pattern;
|
||||
var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});
|
||||
|
||||
if (cache[pattern]) return cache[pattern];
|
||||
|
||||
var compiledGenerator = pathToRegexp.compile(pattern);
|
||||
|
||||
if (cacheCount < cacheLimit) {
|
||||
cache[pattern] = compiledGenerator;
|
||||
cacheCount++;
|
||||
}
|
||||
|
||||
return compiledGenerator;
|
||||
};
|
||||
|
||||
/**
|
||||
* Public API for generating a URL pathname from a pattern and parameters.
|
||||
*/
|
||||
var generatePath = function generatePath() {
|
||||
var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "/";
|
||||
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
|
||||
if (pattern === "/") {
|
||||
return pattern;
|
||||
}
|
||||
var generator = compileGenerator(pattern);
|
||||
return generator(params, { pretty: true });
|
||||
};
|
||||
|
||||
export default generatePath;
|
||||
20
node_modules/react-router/es/index.js
generated
vendored
Normal file
20
node_modules/react-router/es/index.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import _MemoryRouter from "./MemoryRouter";
|
||||
export { _MemoryRouter as MemoryRouter };
|
||||
import _Prompt from "./Prompt";
|
||||
export { _Prompt as Prompt };
|
||||
import _Redirect from "./Redirect";
|
||||
export { _Redirect as Redirect };
|
||||
import _Route from "./Route";
|
||||
export { _Route as Route };
|
||||
import _Router from "./Router";
|
||||
export { _Router as Router };
|
||||
import _StaticRouter from "./StaticRouter";
|
||||
export { _StaticRouter as StaticRouter };
|
||||
import _Switch from "./Switch";
|
||||
export { _Switch as Switch };
|
||||
import _generatePath from "./generatePath";
|
||||
export { _generatePath as generatePath };
|
||||
import _matchPath from "./matchPath";
|
||||
export { _matchPath as matchPath };
|
||||
import _withRouter from "./withRouter";
|
||||
export { _withRouter as withRouter };
|
||||
72
node_modules/react-router/es/matchPath.js
generated
vendored
Normal file
72
node_modules/react-router/es/matchPath.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
import pathToRegexp from "path-to-regexp";
|
||||
|
||||
var patternCache = {};
|
||||
var cacheLimit = 10000;
|
||||
var cacheCount = 0;
|
||||
|
||||
var compilePath = function compilePath(pattern, options) {
|
||||
var cacheKey = "" + options.end + options.strict + options.sensitive;
|
||||
var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});
|
||||
|
||||
if (cache[pattern]) return cache[pattern];
|
||||
|
||||
var keys = [];
|
||||
var re = pathToRegexp(pattern, keys, options);
|
||||
var compiledPattern = { re: re, keys: keys };
|
||||
|
||||
if (cacheCount < cacheLimit) {
|
||||
cache[pattern] = compiledPattern;
|
||||
cacheCount++;
|
||||
}
|
||||
|
||||
return compiledPattern;
|
||||
};
|
||||
|
||||
/**
|
||||
* Public API for matching a URL pathname to a path pattern.
|
||||
*/
|
||||
var matchPath = function matchPath(pathname) {
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var parent = arguments[2];
|
||||
|
||||
if (typeof options === "string") options = { path: options };
|
||||
|
||||
var _options = options,
|
||||
path = _options.path,
|
||||
_options$exact = _options.exact,
|
||||
exact = _options$exact === undefined ? false : _options$exact,
|
||||
_options$strict = _options.strict,
|
||||
strict = _options$strict === undefined ? false : _options$strict,
|
||||
_options$sensitive = _options.sensitive,
|
||||
sensitive = _options$sensitive === undefined ? false : _options$sensitive;
|
||||
|
||||
|
||||
if (path == null) return parent;
|
||||
|
||||
var _compilePath = compilePath(path, { end: exact, strict: strict, sensitive: sensitive }),
|
||||
re = _compilePath.re,
|
||||
keys = _compilePath.keys;
|
||||
|
||||
var match = re.exec(pathname);
|
||||
|
||||
if (!match) return null;
|
||||
|
||||
var url = match[0],
|
||||
values = match.slice(1);
|
||||
|
||||
var isExact = pathname === url;
|
||||
|
||||
if (exact && !isExact) return null;
|
||||
|
||||
return {
|
||||
path: path, // the path pattern used to match
|
||||
url: path === "/" && url === "" ? "/" : url, // the matched portion of the URL
|
||||
isExact: isExact, // whether or not we matched exactly
|
||||
params: keys.reduce(function (memo, key, index) {
|
||||
memo[key.name] = values[index];
|
||||
return memo;
|
||||
}, {})
|
||||
};
|
||||
};
|
||||
|
||||
export default matchPath;
|
||||
36
node_modules/react-router/es/withRouter.js
generated
vendored
Normal file
36
node_modules/react-router/es/withRouter.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
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; };
|
||||
|
||||
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; }
|
||||
|
||||
import React from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import hoistStatics from "hoist-non-react-statics";
|
||||
import Route from "./Route";
|
||||
|
||||
/**
|
||||
* A public higher-order component to access the imperative API
|
||||
*/
|
||||
var withRouter = function withRouter(Component) {
|
||||
var C = function C(props) {
|
||||
var wrappedComponentRef = props.wrappedComponentRef,
|
||||
remainingProps = _objectWithoutProperties(props, ["wrappedComponentRef"]);
|
||||
|
||||
return React.createElement(Route, {
|
||||
children: function children(routeComponentProps) {
|
||||
return React.createElement(Component, _extends({}, remainingProps, routeComponentProps, {
|
||||
ref: wrappedComponentRef
|
||||
}));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
C.displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
|
||||
C.WrappedComponent = Component;
|
||||
C.propTypes = {
|
||||
wrappedComponentRef: PropTypes.func
|
||||
};
|
||||
|
||||
return hoistStatics(C, Component);
|
||||
};
|
||||
|
||||
export default withRouter;
|
||||
45
node_modules/react-router/generatePath.js
generated
vendored
Normal file
45
node_modules/react-router/generatePath.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var _pathToRegexp = require("path-to-regexp");
|
||||
|
||||
var _pathToRegexp2 = _interopRequireDefault(_pathToRegexp);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var patternCache = {};
|
||||
var cacheLimit = 10000;
|
||||
var cacheCount = 0;
|
||||
|
||||
var compileGenerator = function compileGenerator(pattern) {
|
||||
var cacheKey = pattern;
|
||||
var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});
|
||||
|
||||
if (cache[pattern]) return cache[pattern];
|
||||
|
||||
var compiledGenerator = _pathToRegexp2.default.compile(pattern);
|
||||
|
||||
if (cacheCount < cacheLimit) {
|
||||
cache[pattern] = compiledGenerator;
|
||||
cacheCount++;
|
||||
}
|
||||
|
||||
return compiledGenerator;
|
||||
};
|
||||
|
||||
/**
|
||||
* Public API for generating a URL pathname from a pattern and parameters.
|
||||
*/
|
||||
var generatePath = function generatePath() {
|
||||
var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "/";
|
||||
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
|
||||
if (pattern === "/") {
|
||||
return pattern;
|
||||
}
|
||||
var generator = compileGenerator(pattern);
|
||||
return generator(params, { pretty: true });
|
||||
};
|
||||
|
||||
exports.default = generatePath;
|
||||
57
node_modules/react-router/index.js
generated
vendored
Normal file
57
node_modules/react-router/index.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.withRouter = exports.matchPath = exports.generatePath = exports.Switch = exports.StaticRouter = exports.Router = exports.Route = exports.Redirect = exports.Prompt = exports.MemoryRouter = undefined;
|
||||
|
||||
var _MemoryRouter2 = require("./MemoryRouter");
|
||||
|
||||
var _MemoryRouter3 = _interopRequireDefault(_MemoryRouter2);
|
||||
|
||||
var _Prompt2 = require("./Prompt");
|
||||
|
||||
var _Prompt3 = _interopRequireDefault(_Prompt2);
|
||||
|
||||
var _Redirect2 = require("./Redirect");
|
||||
|
||||
var _Redirect3 = _interopRequireDefault(_Redirect2);
|
||||
|
||||
var _Route2 = require("./Route");
|
||||
|
||||
var _Route3 = _interopRequireDefault(_Route2);
|
||||
|
||||
var _Router2 = require("./Router");
|
||||
|
||||
var _Router3 = _interopRequireDefault(_Router2);
|
||||
|
||||
var _StaticRouter2 = require("./StaticRouter");
|
||||
|
||||
var _StaticRouter3 = _interopRequireDefault(_StaticRouter2);
|
||||
|
||||
var _Switch2 = require("./Switch");
|
||||
|
||||
var _Switch3 = _interopRequireDefault(_Switch2);
|
||||
|
||||
var _generatePath2 = require("./generatePath");
|
||||
|
||||
var _generatePath3 = _interopRequireDefault(_generatePath2);
|
||||
|
||||
var _matchPath2 = require("./matchPath");
|
||||
|
||||
var _matchPath3 = _interopRequireDefault(_matchPath2);
|
||||
|
||||
var _withRouter2 = require("./withRouter");
|
||||
|
||||
var _withRouter3 = _interopRequireDefault(_withRouter2);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
exports.MemoryRouter = _MemoryRouter3.default;
|
||||
exports.Prompt = _Prompt3.default;
|
||||
exports.Redirect = _Redirect3.default;
|
||||
exports.Route = _Route3.default;
|
||||
exports.Router = _Router3.default;
|
||||
exports.StaticRouter = _StaticRouter3.default;
|
||||
exports.Switch = _Switch3.default;
|
||||
exports.generatePath = _generatePath3.default;
|
||||
exports.matchPath = _matchPath3.default;
|
||||
exports.withRouter = _withRouter3.default;
|
||||
80
node_modules/react-router/matchPath.js
generated
vendored
Normal file
80
node_modules/react-router/matchPath.js
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
var _pathToRegexp = require("path-to-regexp");
|
||||
|
||||
var _pathToRegexp2 = _interopRequireDefault(_pathToRegexp);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var patternCache = {};
|
||||
var cacheLimit = 10000;
|
||||
var cacheCount = 0;
|
||||
|
||||
var compilePath = function compilePath(pattern, options) {
|
||||
var cacheKey = "" + options.end + options.strict + options.sensitive;
|
||||
var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});
|
||||
|
||||
if (cache[pattern]) return cache[pattern];
|
||||
|
||||
var keys = [];
|
||||
var re = (0, _pathToRegexp2.default)(pattern, keys, options);
|
||||
var compiledPattern = { re: re, keys: keys };
|
||||
|
||||
if (cacheCount < cacheLimit) {
|
||||
cache[pattern] = compiledPattern;
|
||||
cacheCount++;
|
||||
}
|
||||
|
||||
return compiledPattern;
|
||||
};
|
||||
|
||||
/**
|
||||
* Public API for matching a URL pathname to a path pattern.
|
||||
*/
|
||||
var matchPath = function matchPath(pathname) {
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var parent = arguments[2];
|
||||
|
||||
if (typeof options === "string") options = { path: options };
|
||||
|
||||
var _options = options,
|
||||
path = _options.path,
|
||||
_options$exact = _options.exact,
|
||||
exact = _options$exact === undefined ? false : _options$exact,
|
||||
_options$strict = _options.strict,
|
||||
strict = _options$strict === undefined ? false : _options$strict,
|
||||
_options$sensitive = _options.sensitive,
|
||||
sensitive = _options$sensitive === undefined ? false : _options$sensitive;
|
||||
|
||||
|
||||
if (path == null) return parent;
|
||||
|
||||
var _compilePath = compilePath(path, { end: exact, strict: strict, sensitive: sensitive }),
|
||||
re = _compilePath.re,
|
||||
keys = _compilePath.keys;
|
||||
|
||||
var match = re.exec(pathname);
|
||||
|
||||
if (!match) return null;
|
||||
|
||||
var url = match[0],
|
||||
values = match.slice(1);
|
||||
|
||||
var isExact = pathname === url;
|
||||
|
||||
if (exact && !isExact) return null;
|
||||
|
||||
return {
|
||||
path: path, // the path pattern used to match
|
||||
url: path === "/" && url === "" ? "/" : url, // the matched portion of the URL
|
||||
isExact: isExact, // whether or not we matched exactly
|
||||
params: keys.reduce(function (memo, key, index) {
|
||||
memo[key.name] = values[index];
|
||||
return memo;
|
||||
}, {})
|
||||
};
|
||||
};
|
||||
|
||||
exports.default = matchPath;
|
||||
39
node_modules/react-router/node_modules/warning/package.json
generated
vendored
Normal file
39
node_modules/react-router/node_modules/warning/package.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "warning",
|
||||
"version": "4.0.2",
|
||||
"description": "A mirror of Facebook's Warning",
|
||||
"main": "warning.js",
|
||||
"dependencies": {
|
||||
"loose-envify": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^6.2.0",
|
||||
"@commitlint/config-conventional": "^6.1.3",
|
||||
"browserify": "^16.2.2",
|
||||
"commitizen": "^2.10.1",
|
||||
"cz-conventional-changelog": "^2.1.0",
|
||||
"husky": "^0.14.3",
|
||||
"jest": "^23.1.0",
|
||||
"uglify-js": "^3.3.25"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/BerkeleyTrue/warning.git"
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "cz-conventional-changelog"
|
||||
}
|
||||
},
|
||||
"browserify": {
|
||||
"transform": [
|
||||
"loose-envify"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"warning.js"
|
||||
],
|
||||
"author": "Berkeley Martinez <berkeley@berkeleytrue.com> (http://www.berkeleytrue.com)",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/BerkeleyTrue/warning"
|
||||
}
|
||||
62
node_modules/react-router/node_modules/warning/warning.js
generated
vendored
Normal file
62
node_modules/react-router/node_modules/warning/warning.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Similar to invariant but only logs a warning if the condition is not met.
|
||||
* This can be used to log issues in development environments in critical
|
||||
* paths. Removing the logging code for production environments will keep the
|
||||
* same logic and follow the same code paths.
|
||||
*/
|
||||
|
||||
var __DEV__ = process.env.NODE_ENV !== 'production';
|
||||
|
||||
var warning = function() {};
|
||||
|
||||
if (__DEV__) {
|
||||
var printWarning = function printWarning(format, args) {
|
||||
var len = arguments.length;
|
||||
args = new Array(len > 2 ? len - 2 : 0);
|
||||
for (var key = 2; key < len; key++) {
|
||||
args[key - 2] = arguments[key];
|
||||
}
|
||||
var argIndex = 0;
|
||||
var message = 'Warning: ' +
|
||||
format.replace(/%s/g, function() {
|
||||
return args[argIndex++];
|
||||
});
|
||||
if (typeof console !== 'undefined') {
|
||||
console.error(message);
|
||||
}
|
||||
try {
|
||||
// --- Welcome to debugging React ---
|
||||
// This error was thrown as a convenience so that you can use this stack
|
||||
// to find the callsite that caused this warning to fire.
|
||||
throw new Error(message);
|
||||
} catch (x) {}
|
||||
}
|
||||
|
||||
warning = function(condition, format, args) {
|
||||
var len = arguments.length;
|
||||
args = new Array(len > 2 ? len - 2 : 0);
|
||||
for (var key = 2; key < len; key++) {
|
||||
args[key - 2] = arguments[key];
|
||||
}
|
||||
if (format === undefined) {
|
||||
throw new Error(
|
||||
'`warning(condition, format, ...args)` requires a warning ' +
|
||||
'message argument'
|
||||
);
|
||||
}
|
||||
if (!condition) {
|
||||
printWarning.apply(null, [format].concat(args));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = warning;
|
||||
78
node_modules/react-router/package.json
generated
vendored
Normal file
78
node_modules/react-router/package.json
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"name": "react-router",
|
||||
"version": "4.3.1",
|
||||
"description": "Declarative routing for React",
|
||||
"repository": "ReactTraining/react-router",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
"Michael Jackson",
|
||||
"Ryan Florence"
|
||||
],
|
||||
"files": [
|
||||
"MemoryRouter.js",
|
||||
"Prompt.js",
|
||||
"Redirect.js",
|
||||
"Route.js",
|
||||
"Router.js",
|
||||
"StaticRouter.js",
|
||||
"Switch.js",
|
||||
"es",
|
||||
"index.js",
|
||||
"generatePath.js",
|
||||
"matchPath.js",
|
||||
"withRouter.js",
|
||||
"umd"
|
||||
],
|
||||
"main": "index.js",
|
||||
"module": "es/index.js",
|
||||
"sideEffects": false,
|
||||
"peerDependencies": {
|
||||
"react": ">=15"
|
||||
},
|
||||
"dependencies": {
|
||||
"history": "^4.7.2",
|
||||
"hoist-non-react-statics": "^2.5.0",
|
||||
"invariant": "^2.2.4",
|
||||
"loose-envify": "^1.3.1",
|
||||
"path-to-regexp": "^1.7.0",
|
||||
"prop-types": "^15.6.1",
|
||||
"warning": "^4.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.26.0",
|
||||
"babel-eslint": "^8.2.3",
|
||||
"babel-jest": "^23.0.1",
|
||||
"babel-plugin-dev-expression": "^0.2.1",
|
||||
"babel-plugin-external-helpers": "^6.22.0",
|
||||
"babel-plugin-transform-react-remove-prop-types": "^0.4.13",
|
||||
"babel-preset-es2015": "^6.14.0",
|
||||
"babel-preset-react": "^6.5.0",
|
||||
"babel-preset-stage-1": "^6.5.0",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-plugin-import": "^2.12.0",
|
||||
"eslint-plugin-react": "^7.9.1",
|
||||
"gzip-size": "^4.1.0",
|
||||
"jest": "^23.1.0",
|
||||
"pretty-bytes": "^5.0.0",
|
||||
"raf": "^3.4.0",
|
||||
"react": "^16.4.0",
|
||||
"react-addons-test-utils": "^15.6.2",
|
||||
"react-dom": "^16.4.0",
|
||||
"rollup": "^0.60.0",
|
||||
"rollup-plugin-babel": "^3.0.4",
|
||||
"rollup-plugin-commonjs": "^9.1.3",
|
||||
"rollup-plugin-node-resolve": "^3.3.0",
|
||||
"rollup-plugin-replace": "^2.0.0",
|
||||
"rollup-plugin-uglify": "^3.0.0"
|
||||
},
|
||||
"browserify": {
|
||||
"transform": [
|
||||
"loose-envify"
|
||||
]
|
||||
},
|
||||
"jest": {
|
||||
"setupFiles": [
|
||||
"raf/polyfill"
|
||||
]
|
||||
}
|
||||
}
|
||||
2743
node_modules/react-router/umd/react-router.js
generated
vendored
Normal file
2743
node_modules/react-router/umd/react-router.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/react-router/umd/react-router.min.js
generated
vendored
Normal file
1
node_modules/react-router/umd/react-router.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
53
node_modules/react-router/withRouter.js
generated
vendored
Normal file
53
node_modules/react-router/withRouter.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
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; };
|
||||
|
||||
var _react = require("react");
|
||||
|
||||
var _react2 = _interopRequireDefault(_react);
|
||||
|
||||
var _propTypes = require("prop-types");
|
||||
|
||||
var _propTypes2 = _interopRequireDefault(_propTypes);
|
||||
|
||||
var _hoistNonReactStatics = require("hoist-non-react-statics");
|
||||
|
||||
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
|
||||
|
||||
var _Route = require("./Route");
|
||||
|
||||
var _Route2 = _interopRequireDefault(_Route);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
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; }
|
||||
|
||||
/**
|
||||
* A public higher-order component to access the imperative API
|
||||
*/
|
||||
var withRouter = function withRouter(Component) {
|
||||
var C = function C(props) {
|
||||
var wrappedComponentRef = props.wrappedComponentRef,
|
||||
remainingProps = _objectWithoutProperties(props, ["wrappedComponentRef"]);
|
||||
|
||||
return _react2.default.createElement(_Route2.default, {
|
||||
children: function children(routeComponentProps) {
|
||||
return _react2.default.createElement(Component, _extends({}, remainingProps, routeComponentProps, {
|
||||
ref: wrappedComponentRef
|
||||
}));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
C.displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
|
||||
C.WrappedComponent = Component;
|
||||
C.propTypes = {
|
||||
wrappedComponentRef: _propTypes2.default.func
|
||||
};
|
||||
|
||||
return (0, _hoistNonReactStatics2.default)(C, Component);
|
||||
};
|
||||
|
||||
exports.default = withRouter;
|
||||
Reference in New Issue
Block a user