(js/css) Update generated files

pull/237/head
InverseBot 2017-08-13 01:32:35 -04:00
parent 45a5b533a3
commit b7c8f43bcc
4 changed files with 69 additions and 78 deletions

View File

@ -3,8 +3,8 @@
* NOTICE: This monolithic bundle also bundles the @uirouter/core code.
* 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.5
* For more information, see https://ui-router.github.io/blog/uirouter-for-angularjs-umd-bundles
* @version v1.0.6
* @link https://ui-router.github.io
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
@ -1019,64 +1019,6 @@ function _arraysEq(a1, a2) {
return false;
return arrayTuples(a1, a2).reduce(function (b, t) { return b && _equals(t[0], t[1]); }, true);
}
/**
* Create a sort function
*
* Creates a sort function which sorts by a numeric property.
*
* The `propFn` should return the property as a number which can be sorted.
*
* #### Example:
* This example returns the `priority` prop.
* ```js
* var sortfn = sortBy(obj => obj.priority)
* // equivalent to:
* var longhandSortFn = (a, b) => a.priority - b.priority;
* ```
*
* #### Example:
* This example uses [[prop]]
* ```js
* var sortfn = sortBy(prop('priority'))
* ```
*
* The `checkFn` can be used to exclude objects from sorting.
*
* #### Example:
* This example only sorts objects with type === 'FOO'
* ```js
* var sortfn = sortBy(prop('priority'), propEq('type', 'FOO'))
* ```
*
* @param propFn a function that returns the property (as a number)
* @param checkFn a predicate
*
* @return a sort function like: `(a, b) => (checkFn(a) && checkFn(b)) ? propFn(a) - propFn(b) : 0`
*/
var sortBy = function (propFn, checkFn) {
if (checkFn === void 0) { checkFn = val(true); }
return function (a, b) {
return (checkFn(a) && checkFn(b)) ? propFn(a) - propFn(b) : 0;
};
};
/**
* Composes a list of sort functions
*
* Creates a sort function composed of multiple sort functions.
* Each sort function is invoked in series.
* The first sort function to return non-zero "wins".
*
* @param sortFns list of sort functions
*/
var composeSort = function () {
var sortFns = [];
for (var _i = 0; _i < arguments.length; _i++) {
sortFns[_i] = arguments[_i];
}
return function composedSort(a, b) {
return sortFns.reduce(function (prev, fn) { return prev || fn(a, b); }, 0);
};
};
// issue #2676
var silenceUncaughtInPromise = function (promise) {
return promise.catch(function (e) { return 0; }) && promise;
@ -4895,7 +4837,19 @@ var UrlMatcher = (function () {
return 3;
});
};
var cmp, i, pairs$$1 = arrayTuples(weights(a), weights(b));
/**
* Pads shorter array in-place (mutates)
*/
var padArrays = function (l, r, padVal) {
var len = Math.max(l.length, r.length);
while (l.length < len)
l.push(padVal);
while (r.length < len)
r.push(padVal);
};
var weightsA = weights(a), weightsB = weights(b);
padArrays(weightsA, weightsB, 0);
var cmp, i, pairs$$1 = arrayTuples(weightsA, weightsB);
for (i = 0; i < pairs$$1.length; i++) {
cmp = pairs$$1[i][0] - pairs$$1[i][1];
if (cmp !== 0)
@ -5244,7 +5198,25 @@ function appendBasePath(url, isHtml5, absolute, baseHref) {
return url;
}
/** @hidden */
var getMatcher = prop("urlMatcher");
var prioritySort = function (a, b) {
return (b.priority || 0) - (a.priority || 0);
};
/** @hidden */
var typeSort = function (a, b) {
var weights = { "STATE": 4, "URLMATCHER": 4, "REGEXP": 3, "RAW": 2, "OTHER": 1 };
return (weights[a.type] || 0) - (weights[b.type] || 0);
};
/** @hidden */
var urlMatcherSort = function (a, b) {
return !a.urlMatcher || !b.urlMatcher ? 0 : UrlMatcher.compare(a.urlMatcher, b.urlMatcher);
};
/** @hidden */
var idSort = function (a, b) {
// Identically sorted STATE and URLMATCHER best rule will be chosen by `matchPriority` after each rule matches the URL
var useMatchPriority = { STATE: true, URLMATCHER: true };
var equal = useMatchPriority[a.type] && useMatchPriority[b.type];
return equal ? 0 : (a.$id || 0) - (b.$id || 0);
};
/**
* Default rule priority sorting function.
*
@ -5253,12 +5225,25 @@ var getMatcher = prop("urlMatcher");
* - Explicit priority (set rule priority using [[UrlRulesApi.when]])
* - Rule type (STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1)
* - `UrlMatcher` specificity ([[UrlMatcher.compare]]): works for STATE and URLMATCHER types to pick the most specific rule.
* - Registration order (for rule types other than STATE and URLMATCHER)
* - Rule registration order (for rule types other than STATE and URLMATCHER)
* - Equally sorted State and UrlMatcher rules will each match the URL.
* Then, the *best* match is chosen based on how many parameter values were matched.
*
* @coreapi
*/
var defaultRuleSortFn;
defaultRuleSortFn = composeSort(sortBy(pipe(prop("priority"), function (x) { return -x; })), sortBy(pipe(prop("type"), function (type) { return ({ "STATE": 4, "URLMATCHER": 4, "REGEXP": 3, "RAW": 2, "OTHER": 1 })[type]; })), function (a, b) { return (getMatcher(a) && getMatcher(b)) ? UrlMatcher.compare(getMatcher(a), getMatcher(b)) : 0; }, sortBy(prop("$id"), inArray(["REGEXP", "RAW", "OTHER"])));
defaultRuleSortFn = function (a, b) {
var cmp = prioritySort(a, b);
if (cmp !== 0)
return cmp;
cmp = typeSort(a, b);
if (cmp !== 0)
return cmp;
cmp = urlMatcherSort(a, b);
if (cmp !== 0)
return cmp;
return idSort(a, b);
};
/**
* Updates URL and responds to URL changes
*
@ -5290,12 +5275,22 @@ var UrlRouter = (function () {
};
/** @inheritdoc */
UrlRouter.prototype.sort = function (compareFn) {
this._rules.sort(this._sortFn = compareFn || this._sortFn);
this._rules = this.stableSort(this._rules, this._sortFn = compareFn || this._sortFn);
this._sorted = true;
};
UrlRouter.prototype.ensureSorted = function () {
this._sorted || this.sort();
};
UrlRouter.prototype.stableSort = function (arr, compareFn) {
var arrOfWrapper = arr.map(function (elem, idx) { return ({ elem: elem, idx: idx }); });
arrOfWrapper.sort(function (wrapperA, wrapperB) {
var cmpDiff = compareFn(wrapperA.elem, wrapperB.elem);
return cmpDiff === 0
? wrapperA.idx - wrapperB.idx
: cmpDiff;
});
return arrOfWrapper.map(function (wrapper) { return wrapper.elem; });
};
/**
* Given a URL, check all rules and return the best [[MatchResult]]
* @param url
@ -7641,7 +7636,7 @@ var BrowserLocationConfig = (function () {
return location.protocol.replace(/:/g, '');
};
BrowserLocationConfig.prototype.host = function () {
return location.host;
return location.hostname;
};
BrowserLocationConfig.prototype.html5Mode = function () {
return this._isHtml5;
@ -7754,8 +7749,6 @@ var index$1 = Object.freeze({
applyPairs: applyPairs,
tail: tail,
_extend: _extend,
sortBy: sortBy,
composeSort: composeSort,
silenceUncaughtInPromise: silenceUncaughtInPromise,
silentRejection: silentRejection,
notImplemented: notImplemented,
@ -9906,8 +9899,6 @@ exports.arrayTuples = arrayTuples;
exports.applyPairs = applyPairs;
exports.tail = tail;
exports._extend = _extend;
exports.sortBy = sortBy;
exports.composeSort = composeSort;
exports.silenceUncaughtInPromise = silenceUncaughtInPromise;
exports.silentRejection = silentRejection;
exports.notImplemented = notImplemented;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long