(js/css) Update generated files

This commit is contained in:
InverseBot
2017-06-30 01:28:54 -04:00
parent fa7aba89c2
commit 14b902241d
10 changed files with 464 additions and 283 deletions
+177 -178
View File
@@ -4,7 +4,7 @@
* This causes it to be incompatible with plugins that depend on @uirouter/core.
* We recommend switching to the ui-router-core.js and ui-router-angularjs.js bundles instead.
* For more information, see http://ui-router.github.io/blog/angular-ui-router-umd-bundles
* @version v1.0.4
* @version v1.0.5
* @link https://ui-router.github.io
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
@@ -429,16 +429,16 @@ var StateObject = (function () {
StateObject.prototype.toString = function () {
return this.fqn();
};
/** Predicate which returns true if the object is an class with @State() decorator */
StateObject.isStateClass = function (stateDecl) {
return isFunction(stateDecl) && stateDecl['__uiRouterState'] === true;
};
/** Predicate which returns true if the object is an internal [[StateObject]] object */
StateObject.isState = function (obj) {
return isObject(obj['__stateObjectCache']);
};
return StateObject;
}());
/** Predicate which returns true if the object is an class with @State() decorator */
StateObject.isStateClass = function (stateDecl) {
return isFunction(stateDecl) && stateDecl['__uiRouterState'] === true;
};
/** Predicate which returns true if the object is an internal [[StateObject]] object */
StateObject.isState = function (obj) {
return isObject(obj['__stateObjectCache']);
};
/** Predicates
*
@@ -1247,17 +1247,17 @@ var Rejection = (function () {
* @module trace
*/ /** for typedoc */
/** @hidden */
function uiViewString(viewData) {
if (!viewData)
function uiViewString(uiview) {
if (!uiview)
return 'ui-view (defunct)';
return "[ui-view#" + viewData.id + " tag " +
("in template from '" + (viewData.creationContext && viewData.creationContext.name || '(root)') + "' state]: ") +
("fqn: '" + viewData.fqn + "', ") +
("name: '" + viewData.name + "@" + viewData.creationContext + "')");
var state = uiview.creationContext ? uiview.creationContext.name || '(root)' : '(none)';
return "[ui-view#" + uiview.id + " " + uiview.$type + ":" + uiview.fqn + " (" + uiview.name + "@" + state + ")]";
}
/** @hidden */
var viewConfigString = function (viewConfig) {
return "[ViewConfig#" + viewConfig.$id + " from '" + (viewConfig.viewDecl.$context.name || '(root)') + "' state]: target ui-view: '" + viewConfig.viewDecl.$uiViewName + "@" + viewConfig.viewDecl.$uiViewContextAnchor + "'";
var view = viewConfig.viewDecl;
var state = view.$context.name || '(root)';
return "[View#" + viewConfig.$id + " from '" + state + "' state]: target ui-view: '" + view.$uiViewName + "@" + view.$uiViewContextAnchor + "'";
};
/** @hidden */
function normalizedCat(input) {
@@ -1308,16 +1308,6 @@ var Trace = (function () {
}
categories.map(normalizedCat).forEach(function (category) { return _this._enabled[category] = enabled; });
};
/**
* Enables a trace [[Category]]
*
* ```js
* trace.enable("TRANSITION");
* ```
*
* @param categories categories to enable. If `categories` is omitted, all categories are enabled.
* Also takes strings (category name) or ordinal (category position)
*/
Trace.prototype.enable = function () {
var categories = [];
for (var _i = 0; _i < arguments.length; _i++) {
@@ -1325,16 +1315,6 @@ var Trace = (function () {
}
this._set(true, categories);
};
/**
* Disables a trace [[Category]]
*
* ```js
* trace.disable("VIEWCONFIG");
* ```
*
* @param categories categories to disable. If `categories` is omitted, all categories are disabled.
* Also takes strings (category name) or ordinal (category position)
*/
Trace.prototype.disable = function () {
var categories = [];
for (var _i = 0; _i < arguments.length; _i++) {
@@ -1423,6 +1403,18 @@ var Trace = (function () {
this.traceUIViewEvent("Fill", viewData, " with: " + maxLength(200, html));
};
/** @internalapi called by ui-router code */
Trace.prototype.traceViewSync = function (pairs) {
if (!this.enabled(exports.Category.VIEWCONFIG))
return;
var mapping = pairs.map(function (_a) {
var uiViewData = _a[0], config = _a[1];
var uiView = uiViewData.$type + ":" + uiViewData.fqn;
var view = config && config.viewDecl.$context.name + ": " + config.viewDecl.$name + " (" + config.viewDecl.$type + ")";
return { 'ui-view fqn': uiView, 'state: view name': view };
}).sort(function (a, b) { return a['ui-view fqn'].localeCompare(b['ui-view fqn']); });
console.table(mapping);
};
/** @internalapi called by ui-router code */
Trace.prototype.traceViewServiceEvent = function (event, viewConfig) {
if (!this.enabled(exports.Category.VIEWCONFIG))
return;
@@ -1562,12 +1554,12 @@ var TargetState = (function () {
TargetState.prototype.toString = function () {
return "'" + this.name() + "'" + toJson(this.params());
};
/** Returns true if the object has a state property that might be a state or state name */
TargetState.isDef = function (obj) {
return obj && obj.state && (isString(obj.state) || isString(obj.state.name));
};
return TargetState;
}());
/** Returns true if the object has a state property that might be a state or state name */
TargetState.isDef = function (obj) {
return obj && obj.state && (isString(obj.state) || isString(obj.state.name));
};
/**
* @coreapi
@@ -1744,38 +1736,38 @@ var TransitionHook = (function () {
TransitionHook.runAllHooks = function (hooks) {
hooks.forEach(function (hook) { return hook.invokeHook(); });
};
/**
* These GetResultHandler(s) are used by [[invokeHook]] below
* Each HookType chooses a GetResultHandler (See: [[TransitionService._defineCoreEvents]])
*/
TransitionHook.HANDLE_RESULT = function (hook) { return function (result) {
return hook.handleHookResult(result);
}; };
/**
* If the result is a promise rejection, log it.
* Otherwise, ignore the result.
*/
TransitionHook.LOG_REJECTED_RESULT = function (hook) { return function (result) {
isPromise(result) && result.catch(function (err) {
return hook.logError(Rejection.normalize(err));
});
return undefined;
}; };
/**
* These GetErrorHandler(s) are used by [[invokeHook]] below
* Each HookType chooses a GetErrorHandler (See: [[TransitionService._defineCoreEvents]])
*/
TransitionHook.LOG_ERROR = function (hook) { return function (error) {
return hook.logError(error);
}; };
TransitionHook.REJECT_ERROR = function (hook) { return function (error) {
return silentRejection(error);
}; };
TransitionHook.THROW_ERROR = function (hook) { return function (error) {
throw error;
}; };
return TransitionHook;
}());
/**
* These GetResultHandler(s) are used by [[invokeHook]] below
* Each HookType chooses a GetResultHandler (See: [[TransitionService._defineCoreEvents]])
*/
TransitionHook.HANDLE_RESULT = function (hook) { return function (result) {
return hook.handleHookResult(result);
}; };
/**
* If the result is a promise rejection, log it.
* Otherwise, ignore the result.
*/
TransitionHook.LOG_REJECTED_RESULT = function (hook) { return function (result) {
isPromise(result) && result.catch(function (err) {
return hook.logError(Rejection.normalize(err));
});
return undefined;
}; };
/**
* These GetErrorHandler(s) are used by [[invokeHook]] below
* Each HookType chooses a GetErrorHandler (See: [[TransitionService._defineCoreEvents]])
*/
TransitionHook.LOG_ERROR = function (hook) { return function (error) {
return hook.logError(error);
}; };
TransitionHook.REJECT_ERROR = function (hook) { return function (error) {
return silentRejection(error);
}; };
TransitionHook.THROW_ERROR = function (hook) { return function (error) {
throw error;
}; };
/**
* @coreapi
@@ -2589,16 +2581,16 @@ var PathUtils = (function () {
var elementIdx = path.indexOf(node);
return elementIdx === -1 ? undefined : path.slice(0, elementIdx + 1);
};
PathUtils.nonDynamicParams = function (node) {
return node.state.parameters({ inherit: false })
.filter(function (param) { return !param.dynamic; });
};
/** Gets the raw parameter values from a path */
PathUtils.paramValues = function (path) {
return path.reduce(function (acc, node) { return extend(acc, node.paramValues); }, {});
};
return PathUtils;
}());
PathUtils.nonDynamicParams = function (node) {
return node.state.parameters({ inherit: false })
.filter(function (param) { return !param.dynamic; });
};
/** Gets the raw parameter values from a path */
PathUtils.paramValues = function (path) {
return path.reduce(function (acc, node) { return extend(acc, node.paramValues); }, {});
};
/**
* @coreapi
@@ -2629,7 +2621,7 @@ var Resolvable = (function () {
extend(this, arg1);
}
else if (isFunction(resolveFn)) {
if (arg1 == null || arg1 == undefined)
if (isNullOrUndefined(arg1))
throw new Error("new Resolvable(): token argument is required");
if (!isFunction(resolveFn))
throw new Error("new Resolvable(): resolveFn argument must be a function");
@@ -2719,11 +2711,11 @@ var Resolvable = (function () {
Resolvable.prototype.clone = function () {
return new Resolvable(this);
};
Resolvable.fromData = function (token, data) {
return new Resolvable(token, function () { return data; }, null, null, data);
};
return Resolvable;
}());
Resolvable.fromData = function (token, data) {
return new Resolvable(token, function () { return data; }, null, null, data);
};
/** @internalapi */
var resolvePolicies = {
@@ -3535,10 +3527,10 @@ var Transition = (function () {
var id = this.$id, from = isObject(fromStateOrName) ? fromStateOrName.name : fromStateOrName, fromParams = toJson(avoidEmptyHash(this._treeChanges.from.map(prop('paramValues')).reduce(mergeR, {}))), toValid = this.valid() ? "" : "(X) ", to = isObject(toStateOrName) ? toStateOrName.name : toStateOrName, toParams = toJson(avoidEmptyHash(this.params()));
return "Transition#" + id + "( '" + from + "'" + fromParams + " -> " + toValid + "'" + to + "'" + toParams + " )";
};
/** @hidden */
Transition.diToken = Transition;
return Transition;
}());
/** @hidden */
Transition.diToken = Transition;
/**
* Functions that manipulate strings
@@ -4100,15 +4092,20 @@ var StateBuilder = (function () {
return state;
};
StateBuilder.prototype.parentName = function (state) {
// name = 'foo.bar.baz.**'
var name = state.name || "";
// segments = ['foo', 'bar', 'baz', '.**']
var segments = name.split('.');
if (segments.length > 1) {
// segments = ['foo', 'bar', 'baz']
var lastSegment = segments.pop();
// segments = ['foo', 'bar'] (ignore .** segment for future states)
if (lastSegment === '**')
segments.pop();
if (segments.length) {
if (state.parent) {
throw new Error("States that specify the 'parent:' property should not have a '.' in their name (" + name + ")");
}
var lastSegment = segments.pop();
if (lastSegment === '**')
segments.pop();
// 'foo.bar'
return segments.join(".");
}
if (!state.parent)
@@ -4550,7 +4547,7 @@ var UrlMatcher = (function () {
var matchDetails = function (m, isSearch) {
// IE[78] returns '' for unmatched groups instead of null
var id = m[2] || m[3];
var regexp = isSearch ? m[4] : m[4] || (m[1] === '*' ? '.*' : null);
var regexp = isSearch ? m[4] : m[4] || (m[1] === '*' ? '[\\s\\S]*' : null);
var makeRegexpType = function (regexp) { return inherit(paramTypes.type(isSearch ? "query" : "path"), {
pattern: new RegExp(regexp, _this.config.caseInsensitive ? 'i' : undefined)
}); };
@@ -4906,10 +4903,10 @@ var UrlMatcher = (function () {
}
return 0;
};
/** @hidden */
UrlMatcher.nameValidator = /^\w+([-.]+\w+)*(?:\[\])?$/;
return UrlMatcher;
}());
/** @hidden */
UrlMatcher.nameValidator = /^\w+([-.]+\w+)*(?:\[\])?$/;
/**
* @internalapi
@@ -5209,11 +5206,11 @@ var UrlRuleFactory = (function () {
var details = { regexp: regexp, type: "REGEXP" };
return extend(new BaseUrlRule(match, _handler), details);
};
UrlRuleFactory.isUrlRule = function (obj) {
return obj && ['type', 'match', 'handler'].every(function (key) { return isDefined(obj[key]); });
};
return UrlRuleFactory;
}());
UrlRuleFactory.isUrlRule = function (obj) {
return obj && ['type', 'match', 'handler'].every(function (key) { return isDefined(obj[key]); });
};
/**
* A base rule which calls `match`
*
@@ -5597,7 +5594,9 @@ var ViewService = (function () {
uiView.configUpdated(viewConfig);
};
// Sort views by FQN and state depth. Process uiviews nearest the root first.
this._uiViews.sort(depthCompare(uiViewDepth, 1)).map(matchingConfigPair).forEach(configureUIView);
var pairs$$1 = this._uiViews.sort(depthCompare(uiViewDepth, 1)).map(matchingConfigPair);
trace.traceViewSync(pairs$$1);
pairs$$1.forEach(configureUIView);
};
/**
@@ -5618,8 +5617,8 @@ var ViewService = (function () {
ViewService.prototype.registerUIView = function (uiView) {
trace.traceViewServiceUIViewEvent("-> Registering", uiView);
var uiViews = this._uiViews;
var fqnMatches = function (uiv) { return uiv.fqn === uiView.fqn; };
if (uiViews.filter(fqnMatches).length)
var fqnAndTypeMatches = function (uiv) { return uiv.fqn === uiView.fqn && uiv.$type === uiView.$type; };
if (uiViews.filter(fqnAndTypeMatches).length)
trace.traceViewServiceUIViewEvent("!!!! duplicate uiView named:", uiView);
uiViews.push(uiView);
this.sync();
@@ -5692,84 +5691,84 @@ var ViewService = (function () {
}
return { uiViewName: uiViewName, uiViewContextAnchor: uiViewContextAnchor };
};
/**
* Given a ui-view and a ViewConfig, determines if they "match".
*
* A ui-view has a fully qualified name (fqn) and a context object. The fqn is built from its overall location in
* the DOM, describing its nesting relationship to any parent ui-view tags it is nested inside of.
*
* A ViewConfig has a target ui-view name and a context anchor. The ui-view name can be a simple name, or
* can be a segmented ui-view path, describing a portion of a ui-view fqn.
*
* In order for a ui-view to match ViewConfig, ui-view's $type must match the ViewConfig's $type
*
* If the ViewConfig's target ui-view name is a simple name (no dots), then a ui-view matches if:
* - the ui-view's name matches the ViewConfig's target name
* - the ui-view's context matches the ViewConfig's anchor
*
* If the ViewConfig's target ui-view name is a segmented name (with dots), then a ui-view matches if:
* - There exists a parent ui-view where:
* - the parent ui-view's name matches the first segment (index 0) of the ViewConfig's target name
* - the parent ui-view's context matches the ViewConfig's anchor
* - And the remaining segments (index 1..n) of the ViewConfig's target name match the tail of the ui-view's fqn
*
* Example:
*
* DOM:
* <ui-view> <!-- created in the root context (name: "") -->
* <ui-view name="foo"> <!-- created in the context named: "A" -->
* <ui-view> <!-- created in the context named: "A.B" -->
* <ui-view name="bar"> <!-- created in the context named: "A.B.C" -->
* </ui-view>
* </ui-view>
* </ui-view>
* </ui-view>
*
* uiViews: [
* { fqn: "$default", creationContext: { name: "" } },
* { fqn: "$default.foo", creationContext: { name: "A" } },
* { fqn: "$default.foo.$default", creationContext: { name: "A.B" } }
* { fqn: "$default.foo.$default.bar", creationContext: { name: "A.B.C" } }
* ]
*
* These four view configs all match the ui-view with the fqn: "$default.foo.$default.bar":
*
* - ViewConfig1: { uiViewName: "bar", uiViewContextAnchor: "A.B.C" }
* - ViewConfig2: { uiViewName: "$default.bar", uiViewContextAnchor: "A.B" }
* - ViewConfig3: { uiViewName: "foo.$default.bar", uiViewContextAnchor: "A" }
* - ViewConfig4: { uiViewName: "$default.foo.$default.bar", uiViewContextAnchor: "" }
*
* Using ViewConfig3 as an example, it matches the ui-view with fqn "$default.foo.$default.bar" because:
* - The ViewConfig's segmented target name is: [ "foo", "$default", "bar" ]
* - There exists a parent ui-view (which has fqn: "$default.foo") where:
* - the parent ui-view's name "foo" matches the first segment "foo" of the ViewConfig's target name
* - the parent ui-view's context "A" matches the ViewConfig's anchor context "A"
* - And the remaining segments [ "$default", "bar" ].join("."_ of the ViewConfig's target name match
* the tail of the ui-view's fqn "default.bar"
*
* @internalapi
*/
ViewService.matches = function (uiViewsByFqn, uiView) { return function (viewConfig) {
// Don't supply an ng1 ui-view with an ng2 ViewConfig, etc
if (uiView.$type !== viewConfig.viewDecl.$type)
return false;
// Split names apart from both viewConfig and uiView into segments
var vc = viewConfig.viewDecl;
var vcSegments = vc.$uiViewName.split(".");
var uivSegments = uiView.fqn.split(".");
// Check if the tails of the segment arrays match. ex, these arrays' tails match:
// vc: ["foo", "bar"], uiv fqn: ["$default", "foo", "bar"]
if (!equals(vcSegments, uivSegments.slice(0 - vcSegments.length)))
return false;
// Now check if the fqn ending at the first segment of the viewConfig matches the context:
// ["$default", "foo"].join(".") == "$default.foo", does the ui-view $default.foo context match?
var negOffset = (1 - vcSegments.length) || undefined;
var fqnToFirstSegment = uivSegments.slice(0, negOffset).join(".");
var uiViewContext = uiViewsByFqn[fqnToFirstSegment].creationContext;
return vc.$uiViewContextAnchor === (uiViewContext && uiViewContext.name);
}; };
return ViewService;
}());
/**
* Given a ui-view and a ViewConfig, determines if they "match".
*
* A ui-view has a fully qualified name (fqn) and a context object. The fqn is built from its overall location in
* the DOM, describing its nesting relationship to any parent ui-view tags it is nested inside of.
*
* A ViewConfig has a target ui-view name and a context anchor. The ui-view name can be a simple name, or
* can be a segmented ui-view path, describing a portion of a ui-view fqn.
*
* In order for a ui-view to match ViewConfig, ui-view's $type must match the ViewConfig's $type
*
* If the ViewConfig's target ui-view name is a simple name (no dots), then a ui-view matches if:
* - the ui-view's name matches the ViewConfig's target name
* - the ui-view's context matches the ViewConfig's anchor
*
* If the ViewConfig's target ui-view name is a segmented name (with dots), then a ui-view matches if:
* - There exists a parent ui-view where:
* - the parent ui-view's name matches the first segment (index 0) of the ViewConfig's target name
* - the parent ui-view's context matches the ViewConfig's anchor
* - And the remaining segments (index 1..n) of the ViewConfig's target name match the tail of the ui-view's fqn
*
* Example:
*
* DOM:
* <ui-view> <!-- created in the root context (name: "") -->
* <ui-view name="foo"> <!-- created in the context named: "A" -->
* <ui-view> <!-- created in the context named: "A.B" -->
* <ui-view name="bar"> <!-- created in the context named: "A.B.C" -->
* </ui-view>
* </ui-view>
* </ui-view>
* </ui-view>
*
* uiViews: [
* { fqn: "$default", creationContext: { name: "" } },
* { fqn: "$default.foo", creationContext: { name: "A" } },
* { fqn: "$default.foo.$default", creationContext: { name: "A.B" } }
* { fqn: "$default.foo.$default.bar", creationContext: { name: "A.B.C" } }
* ]
*
* These four view configs all match the ui-view with the fqn: "$default.foo.$default.bar":
*
* - ViewConfig1: { uiViewName: "bar", uiViewContextAnchor: "A.B.C" }
* - ViewConfig2: { uiViewName: "$default.bar", uiViewContextAnchor: "A.B" }
* - ViewConfig3: { uiViewName: "foo.$default.bar", uiViewContextAnchor: "A" }
* - ViewConfig4: { uiViewName: "$default.foo.$default.bar", uiViewContextAnchor: "" }
*
* Using ViewConfig3 as an example, it matches the ui-view with fqn "$default.foo.$default.bar" because:
* - The ViewConfig's segmented target name is: [ "foo", "$default", "bar" ]
* - There exists a parent ui-view (which has fqn: "$default.foo") where:
* - the parent ui-view's name "foo" matches the first segment "foo" of the ViewConfig's target name
* - the parent ui-view's context "A" matches the ViewConfig's anchor context "A"
* - And the remaining segments [ "$default", "bar" ].join("."_ of the ViewConfig's target name match
* the tail of the ui-view's fqn "default.bar"
*
* @internalapi
*/
ViewService.matches = function (uiViewsByFqn, uiView) { return function (viewConfig) {
// Don't supply an ng1 ui-view with an ng2 ViewConfig, etc
if (uiView.$type !== viewConfig.viewDecl.$type)
return false;
// Split names apart from both viewConfig and uiView into segments
var vc = viewConfig.viewDecl;
var vcSegments = vc.$uiViewName.split(".");
var uivSegments = uiView.fqn.split(".");
// Check if the tails of the segment arrays match. ex, these arrays' tails match:
// vc: ["foo", "bar"], uiv fqn: ["$default", "foo", "bar"]
if (!equals(vcSegments, uivSegments.slice(0 - vcSegments.length)))
return false;
// Now check if the fqn ending at the first segment of the viewConfig matches the context:
// ["$default", "foo"].join(".") == "$default.foo", does the ui-view $default.foo context match?
var negOffset = (1 - vcSegments.length) || undefined;
var fqnToFirstSegment = uivSegments.slice(0, negOffset).join(".");
var uiViewContext = uiViewsByFqn[fqnToFirstSegment].creationContext;
return vc.$uiViewContextAnchor === (uiViewContext && uiViewContext.name);
}; };
/**
* @coreapi
@@ -5872,12 +5871,12 @@ var UrlService = (function () {
UrlService.prototype.deferIntercept = function (defer) { return; };
/** @inheritdoc */
UrlService.prototype.match = function (urlParts) { return; };
/** @hidden */
UrlService.locationServiceStub = makeStub(locationServicesFns);
/** @hidden */
UrlService.locationConfigStub = makeStub(locationConfigFns);
return UrlService;
}());
/** @hidden */
UrlService.locationServiceStub = makeStub(locationServicesFns);
/** @hidden */
UrlService.locationConfigStub = makeStub(locationConfigFns);
/**
* @coreapi
@@ -8654,7 +8653,7 @@ function runBlock($injector$$1, $q$$1, $uiRouter) {
.map(function (x) { return x.$$state().resolvables; })
.reduce(unnestR, [])
.filter(function (x) { return x.deps === "deferred"; })
.forEach(function (resolvable) { return resolvable.deps = $injector$$1.annotate(resolvable.resolveFn); });
.forEach(function (resolvable) { return resolvable.deps = $injector$$1.annotate(resolvable.resolveFn, $injector$$1.strictDi); });
}
// $urlRouter service and $urlRouterProvider
var getUrlRouterProvider = function (uiRouter) {