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,UAAI,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,eAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAC1G,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EACpC,EAAE,GAAG,qBAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,EACjE,QAAQ,GAAG,mBAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAEtD,OAAO,gBAAc,EAAE,WAAM,IAAI,SAAI,UAAU,YAAO,OAAO,SAAI,EAAE,SAAI,QAAQ,OAAI,CAAC;IACtF,CAAC;IAv0BD,gBAAgB;IACT,kBAAO,GAAG,UAAU,CAAC;IAu0B9B,iBAAC;CAAA,AAz0BD,IAy0BC;AAz0BY,gCAAU",
|
10 | "sourcesContent": [
|
11 | "import { trace } from '../common/trace';\nimport { services } from '../common/coreservices';\nimport { stringify } from '../common/strings';\nimport { map, find, extend, mergeR, tail, omit, arrayTuples, unnestR, identity, anyTrueR } from '../common/common';\nimport { isObject, isUndefined } from '../common/predicates';\nimport { prop, propEq, val, not, is } from '../common/hof';\nimport { StateDeclaration, StateOrName } from '../state/interface';\nimport {\n TransitionOptions,\n TreeChanges,\n IHookRegistry,\n TransitionHookPhase,\n RegisteredHooks,\n HookRegOptions,\n HookMatchCriteria,\n TransitionStateHookFn,\n TransitionHookFn,\n} from './interface'; // has or is using\nimport { TransitionHook } from './transitionHook';\nimport { matchState, makeEvent, RegisteredHook } from './hookRegistry';\nimport { HookBuilder } from './hookBuilder';\nimport { PathNode } from '../path/pathNode';\nimport { PathUtils } from '../path/pathUtils';\nimport { StateObject } from '../state/stateObject';\nimport { TargetState } from '../state/targetState';\nimport { Param } from '../params/param';\nimport { Resolvable } from '../resolve/resolvable';\nimport { ViewConfig } from '../view/interface';\nimport { ResolveContext } from '../resolve/resolveContext';\nimport { UIRouter } from '../router';\nimport { UIInjector } from '../interface';\nimport { RawParams } from '../params/interface';\nimport { ResolvableLiteral } from '../resolve/interface';\nimport { Rejection } from './rejectFactory';\nimport { applyPairs, flattenR, uniqR } from '../common';\n\n/** @internal */\nconst stateSelf: (_state: StateObject) => StateDeclaration = prop('self');\n\n/**\n * Represents a transition between two states.\n *\n * When navigating to a state, we are transitioning **from** the current state **to** the new state.\n *\n * This object contains all contextual information about the to/from states, parameters, resolves.\n * It has information about all states being entered and exited as a result of the transition.\n */\nexport class Transition implements IHookRegistry {\n /** @internal */\n static diToken = Transition;\n\n /**\n * A unique identifier for the transition.\n *\n * This is an auto incrementing integer, starting from `0`.\n */\n $id: number;\n\n /**\n * A reference to the [[UIRouter]] instance\n *\n * This reference can be used to access the router services, such as the [[StateService]]\n */\n router: UIRouter;\n\n /** @internal */\n private _deferred = services.$q.defer();\n /**\n * This promise is resolved or rejected based on the outcome of the Transition.\n *\n * When the transition is successful, the promise is resolved\n * When the transition is unsuccessful, the promise is rejected with the [[Rejection]] or javascript error\n */\n promise: Promise<any> = this._deferred.promise;\n /**\n * A boolean which indicates if the transition was successful\n *\n * After a successful transition, this value is set to true.\n * After an unsuccessful transition, this value is set to false.\n *\n * The value will be undefined if the transition is not complete\n */\n success: boolean;\n /** @internal */\n _aborted: boolean;\n /** @internal */\n private _error: Rejection;\n\n /** @internal Holds the hook registration functions such as those passed to Transition.onStart() */\n _registeredHooks: RegisteredHooks = {};\n\n /** @internal */\n private _options: TransitionOptions;\n /** @internal */\n private _treeChanges: TreeChanges;\n /** @internal */\n private _targetState: TargetState;\n /** @internal */\n private _hookBuilder = new HookBuilder(this);\n\n /** @internal */\n onBefore(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function {\n return;\n }\n /** @inheritdoc */\n onStart(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function {\n return;\n }\n /** @inheritdoc */\n onExit(criteria: HookMatchCriteria, callback: TransitionStateHookFn, options?: HookRegOptions): Function {\n return;\n }\n /** @inheritdoc */\n onRetain(criteria: HookMatchCriteria, callback: TransitionStateHookFn, options?: HookRegOptions): Function {\n return;\n }\n /** @inheritdoc */\n onEnter(criteria: HookMatchCriteria, callback: TransitionStateHookFn, options?: HookRegOptions): Function {\n return;\n }\n /** @inheritdoc */\n onFinish(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function {\n return;\n }\n /** @inheritdoc */\n onSuccess(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function {\n return;\n }\n /** @inheritdoc */\n onError(criteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function {\n return;\n }\n\n /** @internal\n * Creates the transition-level hook registration functions\n * (which can then be used to register hooks)\n */\n private createTransitionHookRegFns() {\n this.router.transitionService._pluginapi\n ._getEvents()\n .filter((type) => type.hookPhase !== TransitionHookPhase.CREATE)\n .forEach((type) => makeEvent(this, this.router.transitionService, type));\n }\n\n /** @internal */\n getHooks(hookName: string): RegisteredHook[] {\n return this._registeredHooks[hookName];\n }\n\n /**\n * Creates a new Transition object.\n *\n * If the target state is not valid, an error is thrown.\n *\n * @internal\n *\n * @param fromPath The path of [[PathNode]]s from which the transition is leaving. The last node in the `fromPath`\n * encapsulates the \"from state\".\n * @param targetState The target state and parameters being transitioned to (also, the transition options)\n * @param router The [[UIRouter]] instance\n * @internal\n */\n constructor(fromPath: PathNode[], targetState: TargetState, router: UIRouter) {\n this.router = router;\n this._targetState = targetState;\n\n if (!targetState.valid()) {\n throw new Error(targetState.error());\n }\n\n // current() is assumed to come from targetState.options, but provide a naive implementation otherwise.\n this._options = extend({ current: val(this) }, targetState.options());\n this.$id = router.transitionService._transitionCount++;\n const toPath = PathUtils.buildToPath(fromPath, targetState);\n this._treeChanges = PathUtils.treeChanges(fromPath, toPath, this._options.reloadState);\n this.createTransitionHookRegFns();\n\n const onCreateHooks = this._hookBuilder.buildHooksForPhase(TransitionHookPhase.CREATE);\n TransitionHook.invokeHooks(onCreateHooks, () => null);\n\n this.applyViewConfigs(router);\n }\n\n private applyViewConfigs(router: UIRouter) {\n const enteringStates = this._treeChanges.entering.map((node) => node.state);\n PathUtils.applyViewConfigs(router.transitionService.$view, this._treeChanges.to, enteringStates);\n }\n\n /**\n * @internal\n * @returns the internal from [State] object\n */\n $from() {\n return tail(this._treeChanges.from).state;\n }\n\n /**\n * @internal\n * @returns the internal to [State] object\n */\n $to() {\n return tail(this._treeChanges.to).state;\n }\n\n /**\n * Returns the \"from state\"\n *\n * Returns the state that the transition is coming *from*.\n *\n * @returns The state declaration object for the Transition's (\"from state\").\n */\n from(): StateDeclaration {\n return this.$from().self;\n }\n\n /**\n * Returns the \"to state\"\n *\n * Returns the state that the transition is going *to*.\n *\n * @returns The state declaration object for the Transition's target state (\"to state\").\n */\n to(): StateDeclaration {\n return this.$to().self;\n }\n\n /**\n * Gets the Target State\n *\n * A transition's [[TargetState]] encapsulates the [[to]] state, the [[params]], and the [[options]] as a single object.\n *\n * @returns the [[TargetState]] of this Transition\n */\n targetState() {\n return this._targetState;\n }\n\n /**\n * Determines whether two transitions are equivalent.\n * @deprecated\n */\n is(compare: Transition | { to?: any; from?: any }): boolean {\n if (compare instanceof Transition) {\n // TODO: Also compare parameters\n return this.is({ to: compare.$to().name, from: compare.$from().name });\n }\n return !(\n (compare.to && !matchState(this.$to(), compare.to, this)) ||\n (compare.from && !matchState(this.$from(), compare.from, this))\n );\n }\n\n /**\n * Gets transition parameter values\n *\n * Returns the parameter values for a transition as key/value pairs.\n * This object is immutable.\n *\n * By default, returns the new parameter values (for the \"to state\").\n *\n * #### Example:\n * ```js\n * var toParams = transition.params();\n * ```\n *\n * To return the previous parameter values, supply `'from'` as the `pathname` argument.\n *\n * #### Example:\n * ```js\n * var fromParams = transition.params('from');\n * ```\n *\n * @param pathname the name of the treeChanges path to get parameter values for:\n * (`'to'`, `'from'`, `'entering'`, `'exiting'`, `'retained'`)\n *\n * @returns transition parameter values for the desired path.\n */\n params(pathname?: string): { [paramName: string]: any };\n params<T>(pathname?: string): T;\n params(pathname = 'to') {\n return Object.freeze(this._treeChanges[pathname].map(prop('paramValues')).reduce(mergeR, {}));\n }\n\n /**\n * Gets the new values of any parameters that changed during this transition.\n *\n * Returns any parameter values that have changed during a transition, as key/value pairs.\n *\n * - Any parameter values that have changed will be present on the returned object reflecting the new value.\n * - Any parameters that *not* have changed will not be present on the returned object.\n * - Any new parameters that weren't present in the \"from\" state, but are now present in the \"to\" state will be present on the returned object.\n * - Any previous parameters that are no longer present (because the \"to\" state doesn't have them) will be included with a value of `undefined`.\n *\n * The returned object is immutable.\n *\n * #### Examples:\n *\n * Given:\n * ```js\n * var stateA = { name: 'stateA', url: '/stateA/:param1/param2' }\n * var stateB = { name: 'stateB', url: '/stateB/:param3' }\n * var stateC = { name: 'stateB.nest', url: '/nest/:param4' }\n * ```\n *\n * #### Example 1\n *\n * From `/stateA/abc/def` to `/stateA/abc/xyz`\n *\n * ```js\n * var changed = transition.paramsChanged()\n * // changed is { param2: 'xyz' }\n * ```\n *\n * The value of `param2` changed to `xyz`.\n * The value of `param1` stayed the same so its value is not present.\n *\n * #### Example 2\n *\n * From `/stateA/abc/def` to `/stateB/123`\n *\n * ```js\n * var changed = transition.paramsChanged()\n * // changed is { param1: undefined, param2: undefined, param3: '123' }\n * ```\n *\n * The value `param3` is present because it is a new param.\n * Both `param1` and `param2` are no longer present so their value is undefined.\n *\n * #### Example 3\n *\n * From `/stateB/123` to `/stateB/123/nest/456`\n *\n * ```js\n * var changed = transition.paramsChanged()\n * // changed is { param4: '456' }\n * ```\n *\n * The value `param4` is present because it is a new param.\n * The value of `param3` did not change, so its value is not present.\n *\n * @returns an immutable object with changed parameter keys/values.\n */\n paramsChanged(): { [paramName: string]: any };\n paramsChanged<T>(): T;\n paramsChanged() {\n const fromParams = this.params('from');\n const toParams = this.params('to');\n\n // All the parameters declared on both the \"to\" and \"from\" paths\n const allParamDescriptors: Param[] = []\n .concat(this._treeChanges.to)\n .concat(this._treeChanges.from)\n .map((pathNode) => pathNode.paramSchema)\n .reduce(flattenR, [])\n .reduce(uniqR, []);\n\n const changedParamDescriptors = Param.changed(allParamDescriptors, fromParams, toParams);\n\n return changedParamDescriptors.reduce((changedValues, descriptor) => {\n changedValues[descriptor.id] = toParams[descriptor.id];\n return changedValues;\n }, {});\n }\n\n /**\n * Creates a [[UIInjector]] Dependency Injector\n *\n * Returns a Dependency Injector for the Transition's target state (to state).\n * The injector provides resolve values which the target state has access to.\n *\n * The `UIInjector` can also provide values from the native root/global injector (ng1/ng2).\n *\n * #### Example:\n * ```js\n * .onEnter({ entering: 'myState' }, trans => {\n * var myResolveValue = trans.injector().get('myResolve');\n * // Inject a global service from the global/native injector (if it exists)\n * var MyService = trans.injector().get('MyService');\n * })\n * ```\n *\n * In some cases (such as `onBefore`), you may need access to some resolve data but it has not yet been fetched.\n * You can use [[UIInjector.getAsync]] to get a promise for the data.\n * #### Example:\n * ```js\n * .onBefore({}, trans => {\n * return trans.injector().getAsync('myResolve').then(myResolveValue =>\n * return myResolveValue !== 'ABORT';\n * });\n * });\n * ```\n *\n * If a `state` is provided, the injector that is returned will be limited to resolve values that the provided state has access to.\n * This can be useful if both a parent state `foo` and a child state `foo.bar` have both defined a resolve such as `data`.\n * #### Example:\n * ```js\n * .onEnter({ to: 'foo.bar' }, trans => {\n * // returns result of `foo` state's `myResolve` resolve\n * // even though `foo.bar` also has a `myResolve` resolve\n * var fooData = trans.injector('foo').get('myResolve');\n * });\n * ```\n *\n * If you need resolve data from the exiting states, pass `'from'` as `pathName`.\n * The resolve data from the `from` path will be returned.\n * #### Example:\n * ```js\n * .onExit({ exiting: 'foo.bar' }, trans => {\n * // Gets the resolve value of `myResolve` from the state being exited\n * var fooData = trans.injector(null, 'from').get('myResolve');\n * });\n * ```\n *\n *\n * @param state Limits the resolves provided to only the resolves the provided state has access to.\n * @param pathName Default: `'to'`: Chooses the path for which to create the injector. Use this to access resolves for `exiting` states.\n *\n * @returns a [[UIInjector]]\n */\n injector(state?: StateOrName, pathName = 'to'): UIInjector {\n let path: PathNode[] = this._treeChanges[pathName];\n if (state) path = PathUtils.subPath(path, (node) => node.state === state || node.state.name === state);\n return new ResolveContext(path).injector();\n }\n\n /**\n * Gets all available resolve tokens (keys)\n *\n * This method can be used in conjunction with [[injector]] to inspect the resolve values\n * available to the Transition.\n *\n * This returns all the tokens defined on [[StateDeclaration.resolve]] blocks, for the states\n * in the Transition's [[TreeChanges.to]] path.\n *\n * #### Example:\n * This example logs all resolve values\n * ```js\n * let tokens = trans.getResolveTokens();\n * tokens.forEach(token => console.log(token + \" = \" + trans.injector().get(token)));\n * ```\n *\n * #### Example:\n * This example creates promises for each resolve value.\n * This triggers fetches of resolves (if any have not yet been fetched).\n * When all promises have all settled, it logs the resolve values.\n * ```js\n * let tokens = trans.getResolveTokens();\n * let promise = tokens.map(token => trans.injector().getAsync(token));\n * Promise.all(promises).then(values => console.log(\"Resolved values: \" + values));\n * ```\n *\n * Note: Angular 1 users whould use `$q.all()`\n *\n * @param pathname resolve context's path name (e.g., `to` or `from`)\n *\n * @returns an array of resolve tokens (keys)\n */\n getResolveTokens(pathname = 'to'): any[] {\n return new ResolveContext(this._treeChanges[pathname]).getTokens();\n }\n\n /**\n * Dynamically adds a new [[Resolvable]] (i.e., [[StateDeclaration.resolve]]) to this transition.\n *\n * Allows a transition hook to dynamically add a Resolvable to this Transition.\n *\n * Use the [[Transition.injector]] to retrieve the resolved data in subsequent hooks ([[UIInjector.get]]).\n *\n * If a `state` argument is provided, the Resolvable is processed when that state is being entered.\n * If no `state` is provided then the root state is used.\n * If the given `state` has already been entered, the Resolvable is processed when any child state is entered.\n * If no child states will be entered, the Resolvable is processed during the `onFinish` phase of the Transition.\n *\n * The `state` argument also scopes the resolved data.\n * The resolved data is available from the injector for that `state` and any children states.\n *\n * #### Example:\n * ```js\n * transitionService.onBefore({}, transition => {\n * transition.addResolvable({\n * token: 'myResolve',\n * deps: ['MyService'],\n * resolveFn: myService => myService.getData()\n * });\n * });\n * ```\n *\n * @param resolvable a [[ResolvableLiteral]] object (or a [[Resolvable]])\n * @param state the state in the \"to path\" which should receive the new resolve (otherwise, the root state)\n */\n addResolvable(resolvable: Resolvable | ResolvableLiteral, state: StateOrName = ''): void {\n resolvable = is(Resolvable)(resolvable) ? resolvable : new Resolvable(resolvable);\n\n const stateName: string = typeof state === 'string' ? state : state.name;\n const topath = this._treeChanges.to;\n const targetNode = find(topath, (node) => node.state.name === stateName);\n const resolveContext: ResolveContext = new ResolveContext(topath);\n resolveContext.addResolvables([resolvable as Resolvable], targetNode.state);\n }\n\n /**\n * Gets the transition from which this transition was redirected.\n *\n * If the current transition is a redirect, this method returns the transition that was redirected.\n *\n * #### Example:\n * ```js\n * let transitionA = $state.go('A').transition\n * transitionA.onStart({}, () => $state.target('B'));\n * $transitions.onSuccess({ to: 'B' }, (trans) => {\n * trans.to().name === 'B'; // true\n * trans.redirectedFrom() === transitionA; // true\n * });\n * ```\n *\n * @returns The previous Transition, or null if this Transition is not the result of a redirection\n */\n redirectedFrom(): Transition {\n return this._options.redirectedFrom || null;\n }\n\n /**\n * Gets the original transition in a redirect chain\n *\n * A transition might belong to a long chain of multiple redirects.\n * This method walks the [[redirectedFrom]] chain back to the original (first) transition in the chain.\n *\n * #### Example:\n * ```js\n * // states\n * registry.register({ name: 'A', redirectTo: 'B' });\n * registry.register({ name: 'B', redirectTo: 'C' });\n * registry.register({ name: 'C', redirectTo: 'D' });\n * registry.register({ name: 'D' });\n *\n * let transitionA = $state.go('A').transition\n *\n * $transitions.onSuccess({ to: 'D' }, (trans) => {\n * trans.to().name === 'D'; // true\n * trans.redirectedFrom().to().name === 'C'; // true\n * trans.originalTransition() === transitionA; // true\n * trans.originalTransition().to().name === 'A'; // true\n * });\n * ```\n *\n * @returns The original Transition that started a redirect chain\n */\n originalTransition(): Transition {\n const rf = this.redirectedFrom();\n return (rf && rf.originalTransition()) || this;\n }\n\n /**\n * Get the transition options\n *\n * @returns the options for this Transition.\n */\n options(): TransitionOptions {\n return this._options;\n }\n\n /**\n * Gets the states being entered.\n *\n * @returns an array of states that will be entered during this transition.\n */\n entering(): StateDeclaration[] {\n return map(this._treeChanges.entering, prop('state')).map(stateSelf);\n }\n\n /**\n * Gets the states being exited.\n *\n * @returns an array of states that will be exited during this transition.\n */\n exiting(): StateDeclaration[] {\n return map(this._treeChanges.exiting, prop('state')).map(stateSelf).reverse();\n }\n\n /**\n * Gets the states being retained.\n *\n * @returns an array of states that are already entered from a previous Transition, that will not be\n * exited during this Transition\n */\n retained(): StateDeclaration[] {\n return map(this._treeChanges.retained, prop('state')).map(stateSelf);\n }\n\n /**\n * Get the [[ViewConfig]]s associated with this Transition\n *\n * Each state can define one or more views (template/controller), which are encapsulated as `ViewConfig` objects.\n * This method fetches the `ViewConfigs` for a given path in the Transition (e.g., \"to\" or \"entering\").\n *\n * @param pathname the name of the path to fetch views for:\n * (`'to'`, `'from'`, `'entering'`, `'exiting'`, `'retained'`)\n * @param state If provided, only returns the `ViewConfig`s for a single state in the path\n *\n * @returns a list of ViewConfig objects for the given path.\n */\n views(pathname = 'entering', state?: StateObject): ViewConfig[] {\n let path = this._treeChanges[pathname];\n path = !state ? path : path.filter(propEq('state', state));\n return path.map(prop('views')).filter(identity).reduce(unnestR, []);\n }\n\n /**\n * Return the transition's tree changes\n *\n * A transition goes from one state/parameters to another state/parameters.\n * During a transition, states are entered and/or exited.\n *\n * This function returns various branches (paths) which represent the changes to the\n * active state tree that are caused by the transition.\n *\n * @param pathname The name of the tree changes path to get:\n * (`'to'`, `'from'`, `'entering'`, `'exiting'`, `'retained'`)\n */\n treeChanges(pathname: string): PathNode[];\n treeChanges(): TreeChanges;\n treeChanges(pathname?: string) {\n return pathname ? this._treeChanges[pathname] : this._treeChanges;\n }\n\n /**\n * Creates a new transition that is a redirection of the current one.\n *\n * This transition can be returned from a [[TransitionService]] hook to\n * redirect a transition to a new state and/or set of parameters.\n *\n * @internal\n *\n * @returns Returns a new [[Transition]] instance.\n */\n redirect(targetState: TargetState): Transition {\n let redirects = 1,\n trans: Transition = this;\n // tslint:disable-next-line:no-conditional-assignment\n while ((trans = trans.redirectedFrom()) != null) {\n if (++redirects > 20) throw new Error(`Too many consecutive Transition redirects (20+)`);\n }\n\n const redirectOpts: TransitionOptions = { redirectedFrom: this, source: 'redirect' };\n // If the original transition was caused by URL sync, then use { location: 'replace' }\n // on the new transition (unless the target state explicitly specifies location: false).\n // This causes the original url to be replaced with the url for the redirect target\n // so the original url disappears from the browser history.\n if (this.options().source === 'url' && targetState.options().location !== false) {\n redirectOpts.location = 'replace';\n }\n\n const newOptions = extend({}, this.options(), targetState.options(), redirectOpts);\n targetState = targetState.withOptions(newOptions, true);\n\n const newTransition = this.router.transitionService.create(this._treeChanges.from, targetState);\n const originalEnteringNodes = this._treeChanges.entering;\n const redirectEnteringNodes = newTransition._treeChanges.entering;\n\n // --- Re-use resolve data from original transition ---\n // When redirecting from a parent state to a child state where the parent parameter values haven't changed\n // (because of the redirect), the resolves fetched by the original transition are still valid in the\n // redirected transition.\n //\n // This allows you to define a redirect on a parent state which depends on an async resolve value.\n // You can wait for the resolve, then redirect to a child state based on the result.\n // The redirected transition does not have to re-fetch the resolve.\n // ---------------------------------------------------------\n\n const nodeIsReloading = (reloadState: StateObject) => (node: PathNode) => {\n return reloadState && node.state.includes[reloadState.name];\n };\n\n // Find any \"entering\" nodes in the redirect path that match the original path and aren't being reloaded\n const matchingEnteringNodes: PathNode[] = PathUtils.matching(\n redirectEnteringNodes,\n originalEnteringNodes,\n PathUtils.nonDynamicParams\n ).filter(not(nodeIsReloading(targetState.options().reloadState)));\n\n // Use the existing (possibly pre-resolved) resolvables for the matching entering nodes.\n matchingEnteringNodes.forEach((node, idx) => {\n node.resolvables = originalEnteringNodes[idx].resolvables;\n });\n\n return newTransition;\n }\n\n /** @internal If a transition doesn't exit/enter any states, returns any [[Param]] whose value changed */\n private _changedParams(): Param[] {\n const tc = this._treeChanges;\n\n /** Return undefined if it's not a \"dynamic\" transition, for the following reasons */\n // If user explicitly wants a reload\n if (this._options.reload) return undefined;\n // If any states are exiting or entering\n if (tc.exiting.length || tc.entering.length) return undefined;\n // If to/from path lengths differ\n if (tc.to.length !== tc.from.length) return undefined;\n // If the to/from paths are different\n const pathsDiffer: boolean = arrayTuples(tc.to, tc.from)\n .map((tuple) => tuple[0].state !== tuple[1].state)\n .reduce(anyTrueR, false);\n if (pathsDiffer) return undefined;\n\n // Find any parameter values that differ\n const nodeSchemas: Param[][] = tc.to.map((node: PathNode) => node.paramSchema);\n const [toValues, fromValues] = [tc.to, tc.from].map((path) => path.map((x) => x.paramValues));\n const tuples = arrayTuples(nodeSchemas, toValues, fromValues);\n\n return tuples.map(([schema, toVals, fromVals]) => Param.changed(schema, toVals, fromVals)).reduce(unnestR, []);\n }\n\n /**\n * Returns true if the transition is dynamic.\n *\n * A transition is dynamic if no states are entered nor exited, but at least one dynamic parameter has changed.\n *\n * @returns true if the Transition is dynamic\n */\n dynamic(): boolean {\n const changes = this._changedParams();\n return !changes ? false : changes.map((x) => x.dynamic).reduce(anyTrueR, false);\n }\n\n /**\n * Returns true if the transition is ignored.\n *\n * A transition is ignored if no states are entered nor exited, and no parameter values have changed.\n *\n * @returns true if the Transition is ignored.\n */\n ignored(): boolean {\n return !!this._ignoredReason();\n }\n\n /** @internal */\n _ignoredReason(): 'SameAsCurrent' | 'SameAsPending' | undefined {\n const pending = this.router.globals.transition;\n const reloadState = this._options.reloadState;\n\n const same = (pathA, pathB) => {\n if (pathA.length !== pathB.length) return false;\n const matching = PathUtils.matching(pathA, pathB);\n return pathA.length === matching.filter((node) => !reloadState || !node.state.includes[reloadState.name]).length;\n };\n\n const newTC = this.treeChanges();\n const pendTC = pending && pending.treeChanges();\n\n if (pendTC && same(pendTC.to, newTC.to) && same(pendTC.exiting, newTC.exiting)) return 'SameAsPending';\n if (newTC.exiting.length === 0 && newTC.entering.length === 0 && same(newTC.from, newTC.to)) return 'SameAsCurrent';\n }\n\n /**\n * Runs the transition\n *\n * This method is generally called from the [[StateService.transitionTo]]\n *\n * @internal\n *\n * @returns a promise for a successful transition.\n */\n run(): Promise<any> {\n const runAllHooks = TransitionHook.runAllHooks;\n\n // Gets transition hooks array for the given phase\n const getHooksFor = (phase: TransitionHookPhase) => this._hookBuilder.buildHooksForPhase(phase);\n\n // When the chain is complete, then resolve or reject the deferred\n const transitionSuccess = () => {\n trace.traceSuccess(this.$to(), this);\n this.success = true;\n this._deferred.resolve(this.to());\n runAllHooks(getHooksFor(TransitionHookPhase.SUCCESS));\n };\n\n const transitionError = (reason: Rejection) => {\n trace.traceError(reason, this);\n this.success = false;\n this._deferred.reject(reason);\n this._error = reason;\n runAllHooks(getHooksFor(TransitionHookPhase.ERROR));\n };\n\n const runTransition = () => {\n // Wait to build the RUN hook chain until the BEFORE hooks are done\n // This allows a BEFORE hook to dynamically add additional RUN hooks via the Transition object.\n const allRunHooks = getHooksFor(TransitionHookPhase.RUN);\n const done = () => services.$q.when(undefined);\n return TransitionHook.invokeHooks(allRunHooks, done);\n };\n\n const startTransition = () => {\n const globals = this.router.globals;\n\n globals.lastStartedTransitionId = this.$id;\n globals.transition = this;\n globals.transitionHistory.enqueue(this);\n\n trace.traceTransitionStart(this);\n\n return services.$q.when(undefined);\n };\n\n const allBeforeHooks = getHooksFor(TransitionHookPhase.BEFORE);\n TransitionHook.invokeHooks(allBeforeHooks, startTransition)\n .then(runTransition)\n .then(transitionSuccess, transitionError);\n\n return this.promise;\n }\n\n /** Checks if this transition is currently active/running. */\n isActive = () => this.router.globals.transition === this;\n\n /**\n * Checks if the Transition is valid\n *\n * @returns true if the Transition is valid\n */\n valid() {\n return !this.error() || this.success !== undefined;\n }\n\n /**\n * Aborts this transition\n *\n * Imperative API to abort a Transition.\n * This only applies to Transitions that are not yet complete.\n */\n abort() {\n // Do not set flag if the transition is already complete\n if (isUndefined(this.success)) {\n this._aborted = true;\n }\n }\n\n /**\n * The Transition error reason.\n *\n * If the transition is invalid (and could not be run), returns the reason the transition is invalid.\n * If the transition was valid and ran, but was not successful, returns the reason the transition failed.\n *\n * @returns a transition rejection explaining why the transition is invalid, or the reason the transition failed.\n */\n error(): Rejection {\n const state: StateObject = this.$to();\n\n if (state.self.abstract) {\n return Rejection.invalid(`Cannot transition to abstract state '${state.name}'`);\n }\n\n const paramDefs = state.parameters();\n const values = this.params();\n const invalidParams = paramDefs.filter((param) => !param.validates(values[param.id]));\n\n if (invalidParams.length) {\n const invalidValues = invalidParams.map((param) => `[${param.id}:${stringify(values[param.id])}]`).join(', ');\n const detail = `The following parameter values are not valid for state '${state.name}': ${invalidValues}`;\n return Rejection.invalid(detail);\n }\n\n if (this.success === false) return this._error;\n }\n\n /**\n * A string representation of the Transition\n *\n * @returns A string representation of the Transition\n */\n toString() {\n const fromStateOrName = this.from();\n const toStateOrName = this.to();\n\n const avoidEmptyHash = (params: RawParams) =>\n params['#'] !== null && params['#'] !== undefined ? params : omit(params, ['#']);\n\n // (X) means the to state is invalid.\n const id = this.$id,\n from = isObject(fromStateOrName) ? fromStateOrName.name : fromStateOrName,\n fromParams = stringify(avoidEmptyHash(this._treeChanges.from.map(prop('paramValues')).reduce(mergeR, {}))),\n toValid = this.valid() ? '' : '(X) ',\n to = isObject(toStateOrName) ? toStateOrName.name : toStateOrName,\n toParams = stringify(avoidEmptyHash(this.params()));\n\n return `Transition#${id}( '${from}'${fromParams} -> ${toValid}'${to}'${toParams} )`;\n }\n}\n"
|
12 | ]
|
13 | } |
\ | No newline at end of file |