UNPKG

36.5 kBSource Map (JSON)View Raw
1{"version":3,"file":"route_registry.js","sourceRoot":"","sources":["../../../../modules/@angular/router-deprecated/src/route_registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,sBAA6B,qBAAqB,CAAC,CAAA;AACnD,2BAAiD,0BAA0B,CAAC,CAAA;AAE5E,qBAA8H,oBAAoB,CAAC,CAAA;AACnJ,2BAA4B,0BAA0B,CAAC,CAAA;AACvD,qBAA8C,eAAe,CAAC,CAAA;AAC9D,kCAA4D,kCAAkC,CAAC,CAAA;AAC/F,sBAAmD,eAAe,CAAC,CAAA;AACnE,yBAAsB,kBAAkB,CAAC,CAAA;AACzC,4BAA+G,eAAe,CAAC,CAAA;AAC/H,wCAA0D,wCAAwC,CAAC,CAAA;AACnG,2BAAmD,cAAc,CAAC,CAAA;AAElE,6BAAwB,iBAAiB,CAAC,CAAA;AAE1C,IAAI,cAAc,GAAG,sBAAc,CAAC,OAAO,CAAc,IAAI,CAAC,CAAC;AAE/D,+DAA+D;AAC/D,8CAA8C;AAC9C,4CAA4C;AAC5C,wBAAwB;AACxB,sCAAsC;AACtC,0CAA0C;AAC1C,+CAA+C;AAC/C,+DAA+D;AAC/D,+CAA+C;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACU,gCAAwB;AACjC,kBAAkB,CAAC,IAAI,kBAAW,CAAC,wBAAwB,CAAC,CAAC;AAGjE;;;;GAIG;AAEH;IAGE,uBAAsD,cAAoB;QAApB,mBAAc,GAAd,cAAc,CAAM;QAFlE,WAAM,GAAG,IAAI,gBAAG,EAAgB,CAAC;IAEoC,CAAC;IAE9E;;OAEG;IACH,8BAAM,GAAN,UAAO,eAAoB,EAAE,MAAuB;QAClD,MAAM,GAAG,8CAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAE5C,+CAA+C;QAC/C,EAAE,CAAC,CAAC,MAAM,YAAY,yBAAK,CAAC,CAAC,CAAC;YAC5B,+CAAqB,CAAC,MAAM,C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AAG,WAAW,CAAC,CAAC,CAAC,CAAC;YAEhC,EAAE,CAAC,CAAC,UAAU,YAAY,+BAAW,CAAC,CAAC,CAAC;gBACtC,MAAM,IAAI,0BAAa,CACnB,wCAAqC,IAAI,gDAA0C,CAAC,CAAC;YAC3F,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import {PromiseWrapper} from '../src/facade/async';\nimport {ListWrapper, Map, StringMapWrapper} from '../src/facade/collection';\n\nimport {isPresent, isArray, isBlank, isType, isString, isStringMap, Type, StringWrapper, Math, getTypeNameForDebugging,} from '../src/facade/lang';\nimport {BaseException} from '../src/facade/exceptions';\nimport {Injectable, Inject, OpaqueToken} from '@angular/core';\nimport {RouteConfig, Route, AuxRoute, RouteDefinition} from './route_config/route_config_impl';\nimport {PathMatch, RedirectMatch, RouteMatch} from './rules/rules';\nimport {RuleSet} from './rules/rule_set';\nimport {Instruction, ResolvedInstruction, RedirectInstruction, UnresolvedInstruction, DefaultInstruction} from './instruction';\nimport {normalizeRouteConfig, assertComponentExists} from './route_config/route_config_normalizer';\nimport {parser, Url, convertUrlParamsToArray} from './url_parser';\nimport {GeneratedUrl} from './rules/route_paths/route_path';\nimport {reflector} from '../core_private';\n\nvar _resolveToNull = PromiseWrapper.resolve<Instruction>(null);\n\n// A LinkItemArray is an array, which describes a set of routes\n// The items in the array are found in groups:\n// - the first item is the name of the route\n// - the next items are:\n// - an object containing parameters\n// - or an array describing an aux route\n// export type LinkRouteItem = string | Object;\n// export type LinkItem = LinkRouteItem | Array<LinkRouteItem>;\n// export type LinkItemArray = Array<LinkItem>;\n\n/**\n * Token used to bind the component with the top-level {@link RouteConfig}s for the\n * application.\n *\n * ### Example ([live demo](http://plnkr.co/edit/iRUP8B5OUbxCWQ3AcIDm))\n *\n * ```\n * import {Component} from '@angular/core';\n * import {\n * ROUTER_DIRECTIVES,\n * ROUTER_PROVIDERS,\n * RouteConfig\n * } from '@angular/router-deprecated';\n *\n * @Component({directives: [ROUTER_DIRECTIVES]})\n * @RouteConfig([\n * {...},\n * ])\n * class AppCmp {\n * // ...\n * }\n *\n * bootstrap(AppCmp, [ROUTER_PROVIDERS]);\n * ```\n */\nexport const ROUTER_PRIMARY_COMPONENT: OpaqueToken =\n /*@ts2dart_const*/ new OpaqueToken('RouterPrimaryComponent');\n\n\n/**\n * The RouteRegistry holds route configurations for each component in an Angular app.\n * It is responsible for creating Instructions from URLs, and generating URLs based on route and\n * parameters.\n */\n@Injectable()\nexport class RouteRegistry {\n private _rules = new Map<any, RuleSet>();\n\n constructor(@Inject(ROUTER_PRIMARY_COMPONENT) private _rootComponent: Type) {}\n\n /**\n * Given a component and a configuration object, add the route to this registry\n */\n config(parentComponent: any, config: RouteDefinition): void {\n config = normalizeRouteConfig(config, this);\n\n // this is here because Dart type guard reasons\n if (config instanceof Route) {\n assertComponentExists(config.component, config.path);\n } else if (config instanceof AuxRoute) {\n assertComponentExists(config.component, config.path);\n }\n\n var rules = this._rules.get(parentComponent);\n\n if (isBlank(rules)) {\n rules = new RuleSet();\n this._rules.set(parentComponent, rules);\n }\n\n var terminal = rules.config(config);\n\n if (config instanceof Route) {\n if (terminal) {\n assertTerminalComponent(config.component, config.path);\n } else {\n this.configFromComponent(config.component);\n }\n }\n }\n\n /**\n * Reads the annotations of a component and configures the registry based on them\n */\n configFromComponent(component: any): void {\n if (!isType(component)) {\n return;\n }\n\n // Don't read the annotations from a type more than once –\n // this prevents an infinite loop if a component routes recursively.\n if (this._rules.has(component)) {\n return;\n }\n var annotations = reflector.annotations(component);\n if (isPresent(annotations)) {\n for (var i = 0; i < annotations.length; i++) {\n var annotation = annotations[i];\n\n if (annotation instanceof RouteConfig) {\n let routeCfgs: RouteDefinition[] = annotation.configs;\n routeCfgs.forEach(config => this.config(component, config));\n }\n }\n }\n }\n\n\n /**\n * Given a URL and a parent component, return the most specific instruction for navigating\n * the application into the state specified by the url\n */\n recognize(url: string, ancestorInstructions: Instruction[]): Promise<Instruction> {\n var parsedUrl = parser.parse(url);\n return this._recognize(parsedUrl, []);\n }\n\n\n /**\n * Recognizes all parent-child routes, but creates unresolved auxiliary routes\n */\n private _recognize(parsedUrl: Url, ancestorInstructions: Instruction[], _aux = false):\n Promise<Instruction> {\n var parentInstruction = ListWrapper.last(ancestorInstructions);\n var parentComponent = isPresent(parentInstruction) ? parentInstruction.component.componentType :\n this._rootComponent;\n\n var rules = this._rules.get(parentComponent);\n if (isBlank(rules)) {\n return _resolveToNull;\n }\n\n // Matches some beginning part of the given URL\n var possibleMatches: Promise<RouteMatch>[] =\n _aux ? rules.recognizeAuxiliary(parsedUrl) : rules.recognize(parsedUrl);\n\n var matchPromises: Promise<Instruction>[] = possibleMatches.map(\n (candidate: Promise<RouteMatch>) => candidate.then((candidate: RouteMatch) => {\n\n if (candidate instanceof PathMatch) {\n var auxParentInstructions: Instruction[] =\n ancestorInstructions.length > 0 ? [ListWrapper.last(ancestorInstructions)] : [];\n var auxInstructions =\n this._auxRoutesToUnresolved(candidate.remainingAux, auxParentInstructions);\n\n var instruction = new ResolvedInstruction(candidate.instruction, null, auxInstructions);\n\n if (isBlank(candidate.instruction) || candidate.instruction.terminal) {\n return instruction;\n }\n\n var newAncestorInstructions: Instruction[] = ancestorInstructions.concat([instruction]);\n\n return this._recognize(candidate.remaining, newAncestorInstructions)\n .then((childInstruction) => {\n if (isBlank(childInstruction)) {\n return null;\n }\n\n // redirect instructions are already absolute\n if (childInstruction instanceof RedirectInstruction) {\n return childInstruction;\n }\n instruction.child = childInstruction;\n return instruction;\n });\n }\n\n if (candidate instanceof RedirectMatch) {\n var instruction =\n this.generate(candidate.redirectTo, ancestorInstructions.concat([null]));\n return new RedirectInstruction(\n instruction.component, instruction.child, instruction.auxInstruction,\n candidate.specificity);\n }\n }));\n\n if ((isBlank(parsedUrl) || parsedUrl.path == '') && possibleMatches.length == 0) {\n return PromiseWrapper.resolve(this.generateDefault(parentComponent));\n }\n\n return PromiseWrapper.all<Instruction>(matchPromises).then(mostSpecific);\n }\n\n private _auxRoutesToUnresolved(auxRoutes: Url[], parentInstructions: Instruction[]):\n {[key: string]: Instruction} {\n var unresolvedAuxInstructions: {[key: string]: Instruction} = {};\n\n auxRoutes.forEach((auxUrl: Url) => {\n unresolvedAuxInstructions[auxUrl.path] = new UnresolvedInstruction(\n () => { return this._recognize(auxUrl, parentInstructions, true); });\n });\n\n return unresolvedAuxInstructions;\n }\n\n\n /**\n * Given a normalized list with component names and params like: `['user', {id: 3 }]`\n * generates a url with a leading slash relative to the provided `parentComponent`.\n *\n * If the optional param `_aux` is `true`, then we generate starting at an auxiliary\n * route boundary.\n */\n generate(linkParams: any[], ancestorInstructions: Instruction[], _aux = false): Instruction {\n var params = splitAndFlattenLinkParams(linkParams);\n var prevInstruction: any /** TODO #9100 */;\n\n // The first segment should be either '.' (generate from parent) or '' (generate from root).\n // When we normalize above, we strip all the slashes, './' becomes '.' and '/' becomes ''.\n if (ListWrapper.first(params) == '') {\n params.shift();\n prevInstruction = ListWrapper.first(ancestorInstructions);\n ancestorInstructions = [];\n } else {\n prevInstruction = ancestorInstructions.length > 0 ? ancestorInstructions.pop() : null;\n\n if (ListWrapper.first(params) == '.') {\n params.shift();\n } else if (ListWrapper.first(params) == '..') {\n while (ListWrapper.first(params) == '..') {\n if (ancestorInstructions.length <= 0) {\n throw new BaseException(\n `Link \"${ListWrapper.toJSON(linkParams)}\" has too many \"../\" segments.`);\n }\n prevInstruction = ancestorInstructions.pop();\n params = ListWrapper.slice(params, 1);\n }\n\n // we're on to implicit child/sibling route\n } else {\n // we must only peak at the link param, and not consume it\n let routeName = ListWrapper.first(params);\n let parentComponentType = this._rootComponent;\n let grandparentComponentType: any /** TODO #9100 */ = null;\n\n if (ancestorInstructions.length > 1) {\n let parentComponentInstruction = ancestorInstructions[ancestorInstructions.length - 1];\n let grandComponentInstruction = ancestorInstructions[ancestorInstructions.length - 2];\n\n parentComponentType = parentComponentInstruction.component.componentType;\n grandparentComponentType = grandComponentInstruction.component.componentType;\n } else if (ancestorInstructions.length == 1) {\n parentComponentType = ancestorInstructions[0].component.componentType;\n grandparentComponentType = this._rootComponent;\n }\n\n // For a link with no leading `./`, `/`, or `../`, we look for a sibling and child.\n // If both exist, we throw. Otherwise, we prefer whichever exists.\n var childRouteExists = this.hasRoute(routeName, parentComponentType);\n var parentRouteExists = isPresent(grandparentComponentType) &&\n this.hasRoute(routeName, grandparentComponentType);\n\n if (parentRouteExists && childRouteExists) {\n let msg =\n `Link \"${ListWrapper.toJSON(linkParams)}\" is ambiguous, use \"./\" or \"../\" to disambiguate.`;\n throw new BaseException(msg);\n }\n\n if (parentRouteExists) {\n prevInstruction = ancestorInstructions.pop();\n }\n }\n }\n\n if (params[params.length - 1] == '') {\n params.pop();\n }\n\n if (params.length > 0 && params[0] == '') {\n params.shift();\n }\n\n if (params.length < 1) {\n let msg = `Link \"${ListWrapper.toJSON(linkParams)}\" must include a route name.`;\n throw new BaseException(msg);\n }\n\n var generatedInstruction =\n this._generate(params, ancestorInstructions, prevInstruction, _aux, linkParams);\n\n // we don't clone the first (root) element\n for (var i = ancestorInstructions.length - 1; i >= 0; i--) {\n let ancestorInstruction = ancestorInstructions[i];\n if (isBlank(ancestorInstruction)) {\n break;\n }\n generatedInstruction = ancestorInstruction.replaceChild(generatedInstruction);\n }\n\n return generatedInstruction;\n }\n\n\n /*\n * Internal helper that does not make any assertions about the beginning of the link DSL.\n * `ancestorInstructions` are parents that will be cloned.\n * `prevInstruction` is the existing instruction that would be replaced, but which might have\n * aux routes that need to be cloned.\n */\n private _generate(\n linkParams: any[], ancestorInstructions: Instruction[], prevInstruction: Instruction,\n _aux = false, _originalLink: any[]): Instruction {\n let parentComponentType = this._rootComponent;\n let componentInstruction: any /** TODO #9100 */ = null;\n let auxInstructions: {[key: string]: Instruction} = {};\n\n let parentInstruction: Instruction = ListWrapper.last(ancestorInstructions);\n if (isPresent(parentInstruction) && isPresent(parentInstruction.component)) {\n parentComponentType = parentInstruction.component.componentType;\n }\n\n if (linkParams.length == 0) {\n let defaultInstruction = this.generateDefault(parentComponentType);\n if (isBlank(defaultInstruction)) {\n throw new BaseException(\n `Link \"${ListWrapper.toJSON(_originalLink)}\" does not resolve to a terminal instruction.`);\n }\n return defaultInstruction;\n }\n\n // for non-aux routes, we want to reuse the predecessor's existing primary and aux routes\n // and only override routes for which the given link DSL provides\n if (isPresent(prevInstruction) && !_aux) {\n auxInstructions = StringMapWrapper.merge(prevInstruction.auxInstruction, auxInstructions);\n componentInstruction = prevInstruction.component;\n }\n\n var rules = this._rules.get(parentComponentType);\n if (isBlank(rules)) {\n throw new BaseException(\n `Component \"${getTypeNameForDebugging(parentComponentType)}\" has no route config.`);\n }\n\n let linkParamIndex = 0;\n let routeParams: {[key: string]: any} = {};\n\n // first, recognize the primary route if one is provided\n if (linkParamIndex < linkParams.length && isString(linkParams[linkParamIndex])) {\n let routeName = linkParams[linkParamIndex];\n if (routeName == '' || routeName == '.' || routeName == '..') {\n throw new BaseException(`\"${routeName}/\" is only allowed at the beginning of a link DSL.`);\n }\n linkParamIndex += 1;\n if (linkParamIndex < linkParams.length) {\n let linkParam = linkParams[linkParamIndex];\n if (isStringMap(linkParam) && !isArray(linkParam)) {\n routeParams = linkParam;\n linkParamIndex += 1;\n }\n }\n var routeRecognizer = (_aux ? rules.auxRulesByName : rules.rulesByName).get(routeName);\n\n if (isBlank(routeRecognizer)) {\n throw new BaseException(\n `Component \"${getTypeNameForDebugging(parentComponentType)}\" has no route named \"${routeName}\".`);\n }\n\n // Create an \"unresolved instruction\" for async routes\n // we'll figure out the rest of the route when we resolve the instruction and\n // perform a navigation\n if (isBlank(routeRecognizer.handler.componentType)) {\n var generatedUrl: GeneratedUrl = routeRecognizer.generateComponentPathValues(routeParams);\n return new UnresolvedInstruction(() => {\n return routeRecognizer.handler.resolveComponentType().then((_) => {\n return this._generate(\n linkParams, ancestorInstructions, prevInstruction, _aux, _originalLink);\n });\n }, generatedUrl.urlPath, convertUrlParamsToArray(generatedUrl.urlParams));\n }\n\n componentInstruction = _aux ? rules.generateAuxiliary(routeName, routeParams) :\n rules.generate(routeName, routeParams);\n }\n\n // Next, recognize auxiliary instructions.\n // If we have an ancestor instruction, we preserve whatever aux routes are active from it.\n while (linkParamIndex < linkParams.length && isArray(linkParams[linkParamIndex])) {\n let auxParentInstruction: Instruction[] = [parentInstruction];\n let auxInstruction = this._generate(\n linkParams[linkParamIndex], auxParentInstruction, null, true, _originalLink);\n\n // TODO: this will not work for aux routes with parameters or multiple segments\n auxInstructions[auxInstruction.component.urlPath] = auxInstruction;\n linkParamIndex += 1;\n }\n\n var instruction = new ResolvedInstruction(componentInstruction, null, auxInstructions);\n\n // If the component is sync, we can generate resolved child route instructions\n // If not, we'll resolve the instructions at navigation time\n if (isPresent(componentInstruction) && isPresent(componentInstruction.componentType)) {\n let childInstruction: Instruction = null;\n if (componentInstruction.terminal) {\n if (linkParamIndex >= linkParams.length) {\n // TODO: throw that there are extra link params beyond the terminal component\n }\n } else {\n let childAncestorComponents: Instruction[] = ancestorInstructions.concat([instruction]);\n let remainingLinkParams = linkParams.slice(linkParamIndex);\n childInstruction = this._generate(\n remainingLinkParams, childAncestorComponents, null, false, _originalLink);\n }\n instruction.child = childInstruction;\n }\n\n return instruction;\n }\n\n public hasRoute(name: string, parentComponent: any): boolean {\n var rules = this._rules.get(parentComponent);\n if (isBlank(rules)) {\n return false;\n }\n return rules.hasRoute(name);\n }\n\n public generateDefault(componentCursor: Type): Instruction {\n if (isBlank(componentCursor)) {\n return null;\n }\n\n var rules = this._rules.get(componentCursor);\n if (isBlank(rules) || isBlank(rules.defaultRule)) {\n return null;\n }\n\n var defaultChild: any /** TODO #9100 */ = null;\n if (isPresent(rules.defaultRule.handler.componentType)) {\n var componentInstruction = rules.defaultRule.generate({});\n if (!rules.defaultRule.terminal) {\n defaultChild = this.generateDefault(rules.defaultRule.handler.componentType);\n }\n return new DefaultInstruction(componentInstruction, defaultChild);\n }\n\n return new UnresolvedInstruction(() => {\n return rules.defaultRule.handler.resolveComponentType().then(\n (_) => this.generateDefault(componentCursor));\n });\n }\n}\n\n/*\n * Given: ['/a/b', {c: 2}]\n * Returns: ['', 'a', 'b', {c: 2}]\n */\nfunction splitAndFlattenLinkParams(linkParams: any[]): any[] {\n var accumulation: any[] /** TODO #9100 */ = [];\n linkParams.forEach(function(item: any) {\n if (isString(item)) {\n var strItem: string = <string>item;\n accumulation = accumulation.concat(strItem.split('/'));\n } else {\n accumulation.push(item);\n }\n });\n return accumulation;\n}\n\n\n/*\n * Given a list of instructions, returns the most specific instruction\n */\nfunction mostSpecific(instructions: Instruction[]): Instruction {\n instructions = instructions.filter((instruction) => isPresent(instruction));\n if (instructions.length == 0) {\n return null;\n }\n if (instructions.length == 1) {\n return instructions[0];\n }\n var first = instructions[0];\n var rest = instructions.slice(1);\n return rest.reduce((instruction: Instruction, contender: Instruction) => {\n if (compareSpecificityStrings(contender.specificity, instruction.specificity) == -1) {\n return contender;\n }\n return instruction;\n }, first);\n}\n\n/*\n * Expects strings to be in the form of \"[0-2]+\"\n * Returns -1 if string A should be sorted above string B, 1 if it should be sorted after,\n * or 0 if they are the same.\n */\nfunction compareSpecificityStrings(a: string, b: string): number {\n var l = Math.min(a.length, b.length);\n for (var i = 0; i < l; i += 1) {\n var ai = StringWrapper.charCodeAt(a, i);\n var bi = StringWrapper.charCodeAt(b, i);\n var difference = bi - ai;\n if (difference != 0) {\n return difference;\n }\n }\n return a.length - b.length;\n}\n\nfunction assertTerminalComponent(component: any /** TODO #9100 */, path: any /** TODO #9100 */) {\n if (!isType(component)) {\n return;\n }\n\n var annotations = reflector.annotations(component);\n if (isPresent(annotations)) {\n for (var i = 0; i < annotations.length; i++) {\n var annotation = annotations[i];\n\n if (annotation instanceof RouteConfig) {\n throw new BaseException(\n `Child routes are not allowed for \"${path}\". Use \"...\" on the parent's route path.`);\n }\n }\n }\n}\n"]}
\No newline at end of file