This commit is contained in:
2024-03-22 03:47:51 +05:30
parent 8bcf3d211e
commit 89819f6fe2
28440 changed files with 3211033 additions and 2 deletions

View File

@@ -0,0 +1,81 @@
'use strict';
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var reactRouter = require('react-router');
var React = _interopDefault(require('react'));
function matchRoutes(routes, pathname,
/*not public API*/
branch) {
if (branch === void 0) {
branch = [];
}
routes.some(function (route) {
var match = route.path ? reactRouter.matchPath(pathname, route) : branch.length ? branch[branch.length - 1].match // use parent match
: reactRouter.Router.computeRootMatch(pathname); // use default "root" match
if (match) {
branch.push({
route: route,
match: match
});
if (route.routes) {
matchRoutes(route.routes, pathname, branch);
}
}
return match;
});
return branch;
}
function _extends() {
_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;
};
return _extends.apply(this, arguments);
}
function renderRoutes(routes, extraProps, switchProps) {
if (extraProps === void 0) {
extraProps = {};
}
if (switchProps === void 0) {
switchProps = {};
}
return routes ? React.createElement(reactRouter.Switch, switchProps, routes.map(function (route, i) {
return React.createElement(reactRouter.Route, {
key: route.key || i,
path: route.path,
exact: route.exact,
strict: route.strict,
render: function render(props) {
return route.render ? route.render(_extends({}, props, {}, extraProps, {
route: route
})) : React.createElement(route.component, _extends({}, props, extraProps, {
route: route
}));
}
});
})) : null;
}
exports.matchRoutes = matchRoutes;
exports.renderRoutes = renderRoutes;
//# sourceMappingURL=react-router-config.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"react-router-config.js","sources":["../modules/matchRoutes.js","../modules/renderRoutes.js"],"sourcesContent":["import { matchPath, Router } from \"react-router\";\n\nfunction matchRoutes(routes, pathname, /*not public API*/ branch = []) {\n routes.some(route => {\n const match = route.path\n ? matchPath(pathname, route)\n : branch.length\n ? branch[branch.length - 1].match // use parent match\n : Router.computeRootMatch(pathname); // use default \"root\" match\n\n if (match) {\n branch.push({ route, match });\n\n if (route.routes) {\n matchRoutes(route.routes, pathname, branch);\n }\n }\n\n return match;\n });\n\n return branch;\n}\n\nexport default matchRoutes;\n","import React from \"react\";\nimport { Switch, Route } from \"react-router\";\n\nfunction renderRoutes(routes, extraProps = {}, switchProps = {}) {\n return routes ? (\n <Switch {...switchProps}>\n {routes.map((route, i) => (\n <Route\n key={route.key || i}\n path={route.path}\n exact={route.exact}\n strict={route.strict}\n render={props =>\n route.render ? (\n route.render({ ...props, ...extraProps, route: route })\n ) : (\n <route.component {...props} {...extraProps} route={route} />\n )\n }\n />\n ))}\n </Switch>\n ) : null;\n}\n\nexport default renderRoutes;\n"],"names":["matchRoutes","routes","pathname","branch","some","route","match","path","matchPath","length","Router","computeRootMatch","push","renderRoutes","extraProps","switchProps","Switch","map","i","Route","key","exact","strict","props","render"],"mappings":";;;;;;;AAEA,SAASA,WAAT,CAAqBC,MAArB,EAA6BC,QAA7B;;AAA0DC,MAA1D,EAAuE;MAAbA,MAAa;IAAbA,MAAa,GAAJ,EAAI;;;EACrEF,MAAM,CAACG,IAAP,CAAY,UAAAC,KAAK,EAAI;QACbC,KAAK,GAAGD,KAAK,CAACE,IAAN,GACVC,qBAAS,CAACN,QAAD,EAAWG,KAAX,CADC,GAEVF,MAAM,CAACM,MAAP,GACEN,MAAM,CAACA,MAAM,CAACM,MAAP,GAAgB,CAAjB,CAAN,CAA0BH,KAD5B;MAEEI,kBAAM,CAACC,gBAAP,CAAwBT,QAAxB,CAJN,CADmB;;QAOfI,KAAJ,EAAW;MACTH,MAAM,CAACS,IAAP,CAAY;QAAEP,KAAK,EAALA,KAAF;QAASC,KAAK,EAALA;OAArB;;UAEID,KAAK,CAACJ,MAAV,EAAkB;QAChBD,WAAW,CAACK,KAAK,CAACJ,MAAP,EAAeC,QAAf,EAAyBC,MAAzB,CAAX;;;;WAIGG,KAAP;GAfF;SAkBOH,MAAP;;;;;;;;;;;;;;;;;;;;;AClBF,SAASU,YAAT,CAAsBZ,MAAtB,EAA8Ba,UAA9B,EAA+CC,WAA/C,EAAiE;MAAnCD,UAAmC;IAAnCA,UAAmC,GAAtB,EAAsB;;;MAAlBC,WAAkB;IAAlBA,WAAkB,GAAJ,EAAI;;;SACxDd,MAAM,GACX,oBAACe,kBAAD,EAAYD,WAAZ,EACGd,MAAM,CAACgB,GAAP,CAAW,UAACZ,KAAD,EAAQa,CAAR;WACV,oBAACC,iBAAD;MACE,GAAG,EAAEd,KAAK,CAACe,GAAN,IAAaF,CADpB;MAEE,IAAI,EAAEb,KAAK,CAACE,IAFd;MAGE,KAAK,EAAEF,KAAK,CAACgB,KAHf;MAIE,MAAM,EAAEhB,KAAK,CAACiB,MAJhB;MAKE,MAAM,EAAE,gBAAAC,KAAK;eACXlB,KAAK,CAACmB,MAAN,GACEnB,KAAK,CAACmB,MAAN,cAAkBD,KAAlB,MAA4BT,UAA5B;UAAwCT,KAAK,EAAEA;WADjD,GAGE,oBAAC,KAAD,CAAO,SAAP,eAAqBkB,KAArB,EAAgCT,UAAhC;UAA4C,KAAK,EAAET;WAJ1C;;MANL;GAAX,CADH,CADW,GAkBT,IAlBJ;;;;;;"}

View File

@@ -0,0 +1,2 @@
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var reactRouter=require("react-router"),React=_interopDefault(require("react"));function matchRoutes(e,r,o){return void 0===o&&(o=[]),e.some(function(e){var t=e.path?reactRouter.matchPath(r,e):o.length?o[o.length-1].match:reactRouter.Router.computeRootMatch(r);return t&&(o.push({route:e,match:t}),e.routes&&matchRoutes(e.routes,r,o)),t}),o}function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function renderRoutes(e,r,t){return void 0===r&&(r={}),void 0===t&&(t={}),e?React.createElement(reactRouter.Switch,t,e.map(function(t,e){return React.createElement(reactRouter.Route,{key:t.key||e,path:t.path,exact:t.exact,strict:t.strict,render:function(e){return t.render?t.render(_extends({},e,{},r,{route:t})):React.createElement(t.component,_extends({},e,r,{route:t}))}})})):null}exports.matchRoutes=matchRoutes,exports.renderRoutes=renderRoutes;
//# sourceMappingURL=react-router-config.min.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"react-router-config.min.js","sources":["../modules/matchRoutes.js","../modules/renderRoutes.js"],"sourcesContent":["import { matchPath, Router } from \"react-router\";\n\nfunction matchRoutes(routes, pathname, /*not public API*/ branch = []) {\n routes.some(route => {\n const match = route.path\n ? matchPath(pathname, route)\n : branch.length\n ? branch[branch.length - 1].match // use parent match\n : Router.computeRootMatch(pathname); // use default \"root\" match\n\n if (match) {\n branch.push({ route, match });\n\n if (route.routes) {\n matchRoutes(route.routes, pathname, branch);\n }\n }\n\n return match;\n });\n\n return branch;\n}\n\nexport default matchRoutes;\n","import React from \"react\";\nimport { Switch, Route } from \"react-router\";\n\nfunction renderRoutes(routes, extraProps = {}, switchProps = {}) {\n return routes ? (\n <Switch {...switchProps}>\n {routes.map((route, i) => (\n <Route\n key={route.key || i}\n path={route.path}\n exact={route.exact}\n strict={route.strict}\n render={props =>\n route.render ? (\n route.render({ ...props, ...extraProps, route: route })\n ) : (\n <route.component {...props} {...extraProps} route={route} />\n )\n }\n />\n ))}\n </Switch>\n ) : null;\n}\n\nexport default renderRoutes;\n"],"names":["matchRoutes","routes","pathname","branch","some","route","match","path","matchPath","length","Router","computeRootMatch","push","renderRoutes","extraProps","switchProps","React","Switch","map","i","Route","key","exact","strict","render","props","component"],"mappings":"wOAEA,SAASA,YAAYC,EAAQC,EAA6BC,mBAAAA,IAAAA,EAAS,IACjEF,EAAOG,KAAK,SAAAC,OACJC,EAAQD,EAAME,KAChBC,sBAAUN,EAAUG,GACpBF,EAAOM,OACLN,EAAOA,EAAOM,OAAS,GAAGH,MAC1BI,mBAAOC,iBAAiBT,UAE1BI,IACFH,EAAOS,KAAK,CAAEP,MAAAA,EAAOC,MAAAA,IAEjBD,EAAMJ,QACRD,YAAYK,EAAMJ,OAAQC,EAAUC,IAIjCG,IAGFH,+NClBT,SAASU,aAAaZ,EAAQa,EAAiBC,mBAAjBD,IAAAA,EAAa,aAAIC,IAAAA,EAAc,IACpDd,EACLe,oBAACC,mBAAWF,EACTd,EAAOiB,IAAI,SAACb,EAAOc,UAClBH,oBAACI,mBACCC,IAAKhB,EAAMgB,KAAOF,EAClBZ,KAAMF,EAAME,KACZe,MAAOjB,EAAMiB,MACbC,OAAQlB,EAAMkB,OACdC,OAAQ,SAAAC,UACNpB,EAAMmB,OACJnB,EAAMmB,mBAAYC,KAAUX,GAAYT,MAAOA,KAE/CW,oBAACX,EAAMqB,sBAAcD,EAAWX,GAAYT,MAAOA,WAM3D"}