mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-18 18:05:36 +00:00
(js/css) Update generated files
This commit is contained in:
+291
-107
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @license AngularJS v1.7.5
|
||||
* @license AngularJS v1.7.6
|
||||
* (c) 2010-2018 Google, Inc. http://angularjs.org
|
||||
* License: MIT
|
||||
*/
|
||||
@@ -99,7 +99,7 @@ function isValidObjectMaxDepth(maxDepth) {
|
||||
function minErr(module, ErrorConstructor) {
|
||||
ErrorConstructor = ErrorConstructor || Error;
|
||||
|
||||
var url = 'https://errors.angularjs.org/1.7.5/';
|
||||
var url = 'https://errors.angularjs.org/1.7.6/';
|
||||
var regex = url.replace('.', '\\.') + '[\\s\\S]*';
|
||||
var errRegExp = new RegExp(regex, 'g');
|
||||
|
||||
@@ -1835,13 +1835,8 @@ function angularInit(element, bootstrap) {
|
||||
});
|
||||
if (appElement) {
|
||||
if (!isAutoBootstrapAllowed) {
|
||||
try {
|
||||
window.console.error('AngularJS: disabling automatic bootstrap. <script> protocol indicates ' +
|
||||
window.console.error('AngularJS: disabling automatic bootstrap. <script> protocol indicates ' +
|
||||
'an extension, document.location.href does not match.');
|
||||
} catch (e) {
|
||||
// Support: Safari 11 w/ Webdriver
|
||||
// The console.error will throw and make the test fail
|
||||
}
|
||||
return;
|
||||
}
|
||||
config.strictDi = getNgAttribute(appElement, 'strict-di') !== null;
|
||||
@@ -2675,7 +2670,7 @@ function toDebugString(obj, maxDepth) {
|
||||
|
||||
htmlAnchorDirective,
|
||||
inputDirective,
|
||||
inputDirective,
|
||||
hiddenInputBrowserCacheDirective,
|
||||
formDirective,
|
||||
scriptDirective,
|
||||
selectDirective,
|
||||
@@ -2787,11 +2782,11 @@ function toDebugString(obj, maxDepth) {
|
||||
var version = {
|
||||
// These placeholder strings will be replaced by grunt's `build` task.
|
||||
// They need to be double- or single-quoted.
|
||||
full: '1.7.5',
|
||||
full: '1.7.6',
|
||||
major: 1,
|
||||
minor: 7,
|
||||
dot: 5,
|
||||
codeName: 'anti-prettification'
|
||||
dot: 6,
|
||||
codeName: 'gravity-manipulation'
|
||||
};
|
||||
|
||||
|
||||
@@ -2889,7 +2884,8 @@ function publishExternalAPI(angular) {
|
||||
ngModelOptions: ngModelOptionsDirective
|
||||
}).
|
||||
directive({
|
||||
ngInclude: ngIncludeFillContentDirective
|
||||
ngInclude: ngIncludeFillContentDirective,
|
||||
input: hiddenInputBrowserCacheDirective
|
||||
}).
|
||||
directive(ngAttributeAliasDirectives).
|
||||
directive(ngEventDirectives);
|
||||
@@ -2940,7 +2936,7 @@ function publishExternalAPI(angular) {
|
||||
});
|
||||
}
|
||||
])
|
||||
.info({ angularVersion: '1.7.5' });
|
||||
.info({ angularVersion: '1.7.6' });
|
||||
}
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
@@ -6591,6 +6587,9 @@ function Browser(window, document, $log, $sniffer, $$taskTrackerFactory) {
|
||||
if (url) {
|
||||
var sameState = lastHistoryState === state;
|
||||
|
||||
// Normalize the inputted URL
|
||||
url = urlResolve(url).href;
|
||||
|
||||
// Don't change anything if previous and current URLs and states match. This also prevents
|
||||
// IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode.
|
||||
// See https://github.com/angular/angular.js/commit/ffb2701
|
||||
@@ -9464,7 +9463,16 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
this.$$element.removeAttr(attrName);
|
||||
} else {
|
||||
if (SIMPLE_ATTR_NAME.test(attrName)) {
|
||||
this.$$element.attr(attrName, value);
|
||||
// jQuery skips special boolean attrs treatment in XML nodes for
|
||||
// historical reasons and hence AngularJS cannot freely call
|
||||
// `.attr(attrName, false) with such attributes. To avoid issues
|
||||
// in XHTML, call `removeAttr` in such cases instead.
|
||||
// See https://github.com/jquery/jquery/issues/4249
|
||||
if (booleanKey && value === false) {
|
||||
this.$$element.removeAttr(attrName);
|
||||
} else {
|
||||
this.$$element.attr(attrName, value);
|
||||
}
|
||||
} else {
|
||||
setSpecialAttr(this.$$element[0], attrName, value);
|
||||
}
|
||||
@@ -11061,7 +11069,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
pre: function ngPropPreLinkFn(scope, $element) {
|
||||
function applyPropValue() {
|
||||
var propValue = ngPropGetter(scope);
|
||||
$element.prop(propName, sanitizer(propValue));
|
||||
$element[0][propName] = sanitizer(propValue);
|
||||
}
|
||||
|
||||
applyPropValue();
|
||||
@@ -13850,7 +13858,7 @@ function $InterpolateProvider() {
|
||||
|
||||
// Provide a quick exit and simplified result function for text with no interpolation
|
||||
if (!text.length || text.indexOf(startSymbol) === -1) {
|
||||
if (mustHaveExpression && !contextAllowsConcatenation) return;
|
||||
if (mustHaveExpression) return;
|
||||
|
||||
var unescapedText = unescapeText(text);
|
||||
if (contextAllowsConcatenation) {
|
||||
@@ -18238,7 +18246,13 @@ function markQStateExceptionHandled(state) {
|
||||
state.pur = true;
|
||||
}
|
||||
function markQExceptionHandled(q) {
|
||||
markQStateExceptionHandled(q.$$state);
|
||||
// Built-in `$q` promises will always have a `$$state` property. This check is to allow
|
||||
// overwriting `$q` with a different promise library (e.g. Bluebird + angular-bluebird-promises).
|
||||
// (Currently, this is the only method that might be called with a promise, even if it is not
|
||||
// created by the built-in `$q`.)
|
||||
if (q.$$state) {
|
||||
markQStateExceptionHandled(q.$$state);
|
||||
}
|
||||
}
|
||||
|
||||
/** @this */
|
||||
@@ -21619,6 +21633,12 @@ var urlParsingNode = window.document.createElement('a');
|
||||
var originUrl = urlResolve(window.location.href);
|
||||
var baseUrlParsingNode;
|
||||
|
||||
urlParsingNode.href = 'http://[::1]';
|
||||
|
||||
// Support: IE 9-11 only, Edge 16-17 only (fixed in 18 Preview)
|
||||
// IE/Edge don't wrap IPv6 addresses' hostnames in square brackets
|
||||
// when parsed out of an anchor element.
|
||||
var ipv6InBrackets = urlParsingNode.hostname === '[::1]';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -21681,13 +21701,19 @@ function urlResolve(url) {
|
||||
|
||||
urlParsingNode.setAttribute('href', href);
|
||||
|
||||
var hostname = urlParsingNode.hostname;
|
||||
|
||||
if (!ipv6InBrackets && hostname.indexOf(':') > -1) {
|
||||
hostname = '[' + hostname + ']';
|
||||
}
|
||||
|
||||
return {
|
||||
href: urlParsingNode.href,
|
||||
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
||||
host: urlParsingNode.host,
|
||||
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
||||
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
||||
hostname: urlParsingNode.hostname,
|
||||
hostname: hostname,
|
||||
port: urlParsingNode.port,
|
||||
pathname: (urlParsingNode.pathname.charAt(0) === '/')
|
||||
? urlParsingNode.pathname
|
||||
@@ -24359,7 +24385,7 @@ forEach(ALIASED_ATTR, function(htmlAttr, ngAttr) {
|
||||
// ng-src, ng-srcset, ng-href are interpolated
|
||||
forEach(['src', 'srcset', 'href'], function(attrName) {
|
||||
var normalized = directiveNormalize('ng-' + attrName);
|
||||
ngAttributeAliasDirectives[normalized] = function() {
|
||||
ngAttributeAliasDirectives[normalized] = ['$sce', function($sce) {
|
||||
return {
|
||||
priority: 99, // it needs to run after the attributes are interpolated
|
||||
link: function(scope, element, attr) {
|
||||
@@ -24373,6 +24399,10 @@ forEach(['src', 'srcset', 'href'], function(attrName) {
|
||||
propName = null;
|
||||
}
|
||||
|
||||
// We need to sanitize the url at least once, in case it is a constant
|
||||
// non-interpolated attribute.
|
||||
attr.$set(normalized, $sce.getTrustedMediaUrl(attr[normalized]));
|
||||
|
||||
attr.$observe(normalized, function(value) {
|
||||
if (!value) {
|
||||
if (attrName === 'href') {
|
||||
@@ -24392,7 +24422,7 @@ forEach(['src', 'srcset', 'href'], function(attrName) {
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
}];
|
||||
});
|
||||
|
||||
/* global -nullFormCtrl, -PENDING_CLASS, -SUBMITTED_CLASS
|
||||
@@ -26618,7 +26648,7 @@ function createDateParser(regexp, mapping) {
|
||||
}
|
||||
|
||||
function createDateInputType(type, regexp, parseDate, format) {
|
||||
return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) {
|
||||
return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {
|
||||
badInputChecker(scope, element, attr, ctrl, type);
|
||||
baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
|
||||
|
||||
@@ -26661,24 +26691,34 @@ function createDateInputType(type, regexp, parseDate, format) {
|
||||
});
|
||||
|
||||
if (isDefined(attr.min) || attr.ngMin) {
|
||||
var minVal;
|
||||
var minVal = attr.min || $parse(attr.ngMin)(scope);
|
||||
var parsedMinVal = parseObservedDateValue(minVal);
|
||||
|
||||
ctrl.$validators.min = function(value) {
|
||||
return !isValidDate(value) || isUndefined(minVal) || parseDate(value) >= minVal;
|
||||
return !isValidDate(value) || isUndefined(parsedMinVal) || parseDate(value) >= parsedMinVal;
|
||||
};
|
||||
attr.$observe('min', function(val) {
|
||||
minVal = parseObservedDateValue(val);
|
||||
ctrl.$validate();
|
||||
if (val !== minVal) {
|
||||
parsedMinVal = parseObservedDateValue(val);
|
||||
minVal = val;
|
||||
ctrl.$validate();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (isDefined(attr.max) || attr.ngMax) {
|
||||
var maxVal;
|
||||
var maxVal = attr.max || $parse(attr.ngMax)(scope);
|
||||
var parsedMaxVal = parseObservedDateValue(maxVal);
|
||||
|
||||
ctrl.$validators.max = function(value) {
|
||||
return !isValidDate(value) || isUndefined(maxVal) || parseDate(value) <= maxVal;
|
||||
return !isValidDate(value) || isUndefined(parsedMaxVal) || parseDate(value) <= parsedMaxVal;
|
||||
};
|
||||
attr.$observe('max', function(val) {
|
||||
maxVal = parseObservedDateValue(val);
|
||||
ctrl.$validate();
|
||||
if (val !== maxVal) {
|
||||
parsedMaxVal = parseObservedDateValue(val);
|
||||
maxVal = val;
|
||||
ctrl.$validate();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -26830,50 +26870,68 @@ function isValidForStep(viewValue, stepBase, step) {
|
||||
return (value - stepBase) % step === 0;
|
||||
}
|
||||
|
||||
function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
||||
function numberInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {
|
||||
badInputChecker(scope, element, attr, ctrl, 'number');
|
||||
numberFormatterParser(ctrl);
|
||||
baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
|
||||
|
||||
var minVal;
|
||||
var maxVal;
|
||||
var parsedMinVal;
|
||||
|
||||
if (isDefined(attr.min) || attr.ngMin) {
|
||||
var minVal = attr.min || $parse(attr.ngMin)(scope);
|
||||
parsedMinVal = parseNumberAttrVal(minVal);
|
||||
|
||||
ctrl.$validators.min = function(modelValue, viewValue) {
|
||||
return ctrl.$isEmpty(viewValue) || isUndefined(minVal) || viewValue >= minVal;
|
||||
return ctrl.$isEmpty(viewValue) || isUndefined(parsedMinVal) || viewValue >= parsedMinVal;
|
||||
};
|
||||
|
||||
attr.$observe('min', function(val) {
|
||||
minVal = parseNumberAttrVal(val);
|
||||
// TODO(matsko): implement validateLater to reduce number of validations
|
||||
ctrl.$validate();
|
||||
if (val !== minVal) {
|
||||
parsedMinVal = parseNumberAttrVal(val);
|
||||
minVal = val;
|
||||
// TODO(matsko): implement validateLater to reduce number of validations
|
||||
ctrl.$validate();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (isDefined(attr.max) || attr.ngMax) {
|
||||
var maxVal = attr.max || $parse(attr.ngMax)(scope);
|
||||
var parsedMaxVal = parseNumberAttrVal(maxVal);
|
||||
|
||||
ctrl.$validators.max = function(modelValue, viewValue) {
|
||||
return ctrl.$isEmpty(viewValue) || isUndefined(maxVal) || viewValue <= maxVal;
|
||||
return ctrl.$isEmpty(viewValue) || isUndefined(parsedMaxVal) || viewValue <= parsedMaxVal;
|
||||
};
|
||||
|
||||
attr.$observe('max', function(val) {
|
||||
maxVal = parseNumberAttrVal(val);
|
||||
// TODO(matsko): implement validateLater to reduce number of validations
|
||||
ctrl.$validate();
|
||||
if (val !== maxVal) {
|
||||
parsedMaxVal = parseNumberAttrVal(val);
|
||||
maxVal = val;
|
||||
// TODO(matsko): implement validateLater to reduce number of validations
|
||||
ctrl.$validate();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (isDefined(attr.step) || attr.ngStep) {
|
||||
var stepVal;
|
||||
var stepVal = attr.step || $parse(attr.ngStep)(scope);
|
||||
var parsedStepVal = parseNumberAttrVal(stepVal);
|
||||
|
||||
ctrl.$validators.step = function(modelValue, viewValue) {
|
||||
return ctrl.$isEmpty(viewValue) || isUndefined(stepVal) ||
|
||||
isValidForStep(viewValue, minVal || 0, stepVal);
|
||||
return ctrl.$isEmpty(viewValue) || isUndefined(parsedStepVal) ||
|
||||
isValidForStep(viewValue, parsedMinVal || 0, parsedStepVal);
|
||||
};
|
||||
|
||||
attr.$observe('step', function(val) {
|
||||
stepVal = parseNumberAttrVal(val);
|
||||
// TODO(matsko): implement validateLater to reduce number of validations
|
||||
ctrl.$validate();
|
||||
if (val !== stepVal) {
|
||||
parsedStepVal = parseNumberAttrVal(val);
|
||||
stepVal = val;
|
||||
ctrl.$validate();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26903,6 +26961,8 @@ function rangeInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
||||
originalRender;
|
||||
|
||||
if (hasMinAttr) {
|
||||
minVal = parseNumberAttrVal(attr.min);
|
||||
|
||||
ctrl.$validators.min = supportsRange ?
|
||||
// Since all browsers set the input to a valid value, we don't need to check validity
|
||||
function noopMinValidator() { return true; } :
|
||||
@@ -26915,6 +26975,8 @@ function rangeInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
||||
}
|
||||
|
||||
if (hasMaxAttr) {
|
||||
maxVal = parseNumberAttrVal(attr.max);
|
||||
|
||||
ctrl.$validators.max = supportsRange ?
|
||||
// Since all browsers set the input to a valid value, we don't need to check validity
|
||||
function noopMaxValidator() { return true; } :
|
||||
@@ -26927,6 +26989,8 @@ function rangeInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
||||
}
|
||||
|
||||
if (hasStepAttr) {
|
||||
stepVal = parseNumberAttrVal(attr.step);
|
||||
|
||||
ctrl.$validators.step = supportsRange ?
|
||||
function nativeStepValidator() {
|
||||
// Currently, only FF implements the spec on step change correctly (i.e. adjusting the
|
||||
@@ -26948,7 +27012,13 @@ function rangeInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
||||
// attribute value when the input is first rendered, so that the browser can adjust the
|
||||
// input value based on the min/max value
|
||||
element.attr(htmlAttrName, attr[htmlAttrName]);
|
||||
attr.$observe(htmlAttrName, changeFn);
|
||||
var oldVal = attr[htmlAttrName];
|
||||
attr.$observe(htmlAttrName, function wrappedObserver(val) {
|
||||
if (val !== oldVal) {
|
||||
oldVal = val;
|
||||
changeFn(val);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function minChange(val) {
|
||||
@@ -27002,11 +27072,11 @@ function rangeInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
||||
}
|
||||
|
||||
// Some browsers don't adjust the input value correctly, but set the stepMismatch error
|
||||
if (supportsRange && ctrl.$viewValue !== element.val()) {
|
||||
ctrl.$setViewValue(element.val());
|
||||
} else {
|
||||
if (!supportsRange) {
|
||||
// TODO(matsko): implement validateLater to reduce number of validations
|
||||
ctrl.$validate();
|
||||
} else if (ctrl.$viewValue !== element.val()) {
|
||||
ctrl.$setViewValue(element.val());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27314,6 +27384,48 @@ var inputDirective = ['$browser', '$sniffer', '$filter', '$parse',
|
||||
}];
|
||||
|
||||
|
||||
var hiddenInputBrowserCacheDirective = function() {
|
||||
var valueProperty = {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
get: function() {
|
||||
return this.getAttribute('value') || '';
|
||||
},
|
||||
set: function(val) {
|
||||
this.setAttribute('value', val);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
restrict: 'E',
|
||||
priority: 200,
|
||||
compile: function(_, attr) {
|
||||
if (lowercase(attr.type) !== 'hidden') {
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
pre: function(scope, element, attr, ctrls) {
|
||||
var node = element[0];
|
||||
|
||||
// Support: Edge
|
||||
// Moving the DOM around prevents autofillling
|
||||
if (node.parentNode) {
|
||||
node.parentNode.insertBefore(node, node.nextSibling);
|
||||
}
|
||||
|
||||
// Support: FF, IE
|
||||
// Avoiding direct assignment to .value prevents autofillling
|
||||
if (Object.defineProperty) {
|
||||
Object.defineProperty(node, 'value', valueProperty);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
|
||||
/**
|
||||
@@ -30454,6 +30566,7 @@ NgModelController.prototype = {
|
||||
* `$modelValue`, i.e. either the last parsed value or the last value set from the scope.
|
||||
*/
|
||||
$validate: function() {
|
||||
|
||||
// ignore $validate before model is initialized
|
||||
if (isNumberNaN(this.$modelValue)) {
|
||||
return;
|
||||
@@ -33588,6 +33701,13 @@ var ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $ani
|
||||
return block.clone[block.clone.length - 1];
|
||||
};
|
||||
|
||||
var trackByIdArrayFn = function($scope, key, value) {
|
||||
return hashKey(value);
|
||||
};
|
||||
|
||||
var trackByIdObjFn = function($scope, key) {
|
||||
return key;
|
||||
};
|
||||
|
||||
return {
|
||||
restrict: 'A',
|
||||
@@ -33627,32 +33747,23 @@ var ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $ani
|
||||
aliasAs);
|
||||
}
|
||||
|
||||
var trackByExpGetter, trackByIdExpFn, trackByIdArrayFn, trackByIdObjFn;
|
||||
var hashFnLocals = {$id: hashKey};
|
||||
var trackByIdExpFn;
|
||||
|
||||
if (trackByExp) {
|
||||
trackByExpGetter = $parse(trackByExp);
|
||||
} else {
|
||||
trackByIdArrayFn = function(key, value) {
|
||||
return hashKey(value);
|
||||
};
|
||||
trackByIdObjFn = function(key) {
|
||||
return key;
|
||||
var hashFnLocals = {$id: hashKey};
|
||||
var trackByExpGetter = $parse(trackByExp);
|
||||
|
||||
trackByIdExpFn = function($scope, key, value, index) {
|
||||
// assign key, value, and $index to the locals so that they can be used in hash functions
|
||||
if (keyIdentifier) hashFnLocals[keyIdentifier] = key;
|
||||
hashFnLocals[valueIdentifier] = value;
|
||||
hashFnLocals.$index = index;
|
||||
return trackByExpGetter($scope, hashFnLocals);
|
||||
};
|
||||
}
|
||||
|
||||
return function ngRepeatLink($scope, $element, $attr, ctrl, $transclude) {
|
||||
|
||||
if (trackByExpGetter) {
|
||||
trackByIdExpFn = function(key, value, index) {
|
||||
// assign key, value, and $index to the locals so that they can be used in hash functions
|
||||
if (keyIdentifier) hashFnLocals[keyIdentifier] = key;
|
||||
hashFnLocals[valueIdentifier] = value;
|
||||
hashFnLocals.$index = index;
|
||||
return trackByExpGetter($scope, hashFnLocals);
|
||||
};
|
||||
}
|
||||
|
||||
// Store a list of elements from previous run. This is a hash where key is the item from the
|
||||
// iterator, and the value is objects with following properties.
|
||||
// - scope: bound scope
|
||||
@@ -33706,7 +33817,7 @@ var ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $ani
|
||||
for (index = 0; index < collectionLength; index++) {
|
||||
key = (collection === collectionKeys) ? index : collectionKeys[index];
|
||||
value = collection[key];
|
||||
trackById = trackByIdFn(key, value, index);
|
||||
trackById = trackByIdFn($scope, key, value, index);
|
||||
if (lastBlockMap[trackById]) {
|
||||
// found previously seen block
|
||||
block = lastBlockMap[trackById];
|
||||
@@ -33728,6 +33839,12 @@ var ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $ani
|
||||
}
|
||||
}
|
||||
|
||||
// Clear the value property from the hashFnLocals object to prevent a reference to the last value
|
||||
// being leaked into the ngRepeatCompile function scope
|
||||
if (hashFnLocals) {
|
||||
hashFnLocals[valueIdentifier] = undefined;
|
||||
}
|
||||
|
||||
// remove leftover items
|
||||
for (var blockKey in lastBlockMap) {
|
||||
block = lastBlockMap[blockKey];
|
||||
@@ -34283,7 +34400,14 @@ var ngHideDirective = ['$animate', function($animate) {
|
||||
var ngStyleDirective = ngDirective(function(scope, element, attr) {
|
||||
scope.$watchCollection(attr.ngStyle, function ngStyleWatchAction(newStyles, oldStyles) {
|
||||
if (oldStyles && (newStyles !== oldStyles)) {
|
||||
forEach(oldStyles, function(val, style) { element.css(style, '');});
|
||||
if (!newStyles) {
|
||||
newStyles = {};
|
||||
}
|
||||
forEach(oldStyles, function(val, style) {
|
||||
if (newStyles[style] == null) {
|
||||
newStyles[style] = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
if (newStyles) element.css(newStyles);
|
||||
});
|
||||
@@ -35745,24 +35869,29 @@ var optionDirective = ['$interpolate', function($interpolate) {
|
||||
* </file>
|
||||
* </example>
|
||||
*/
|
||||
var requiredDirective = function() {
|
||||
var requiredDirective = ['$parse', function($parse) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
require: '?ngModel',
|
||||
link: function(scope, elm, attr, ctrl) {
|
||||
if (!ctrl) return;
|
||||
var oldVal = attr.required || $parse(attr.ngRequired)(scope);
|
||||
|
||||
attr.required = true; // force truthy in case we are on non input element
|
||||
|
||||
ctrl.$validators.required = function(modelValue, viewValue) {
|
||||
return !attr.required || !ctrl.$isEmpty(viewValue);
|
||||
};
|
||||
|
||||
attr.$observe('required', function() {
|
||||
ctrl.$validate();
|
||||
attr.$observe('required', function(val) {
|
||||
if (oldVal !== val) {
|
||||
oldVal = val;
|
||||
ctrl.$validate();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
}];
|
||||
|
||||
/**
|
||||
* @ngdoc directive
|
||||
@@ -35845,36 +35974,59 @@ var requiredDirective = function() {
|
||||
* </file>
|
||||
* </example>
|
||||
*/
|
||||
var patternDirective = function() {
|
||||
var patternDirective = ['$parse', function($parse) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
require: '?ngModel',
|
||||
link: function(scope, elm, attr, ctrl) {
|
||||
if (!ctrl) return;
|
||||
compile: function(tElm, tAttr) {
|
||||
var patternExp;
|
||||
var parseFn;
|
||||
|
||||
var regexp, patternExp = attr.ngPattern || attr.pattern;
|
||||
attr.$observe('pattern', function(regex) {
|
||||
if (isString(regex) && regex.length > 0) {
|
||||
regex = new RegExp('^' + regex + '$');
|
||||
if (tAttr.ngPattern) {
|
||||
patternExp = tAttr.ngPattern;
|
||||
|
||||
// ngPattern might be a scope expression, or an inlined regex, which is not parsable.
|
||||
// We get value of the attribute here, so we can compare the old and the new value
|
||||
// in the observer to avoid unnecessary validations
|
||||
if (tAttr.ngPattern.charAt(0) === '/' && REGEX_STRING_REGEXP.test(tAttr.ngPattern)) {
|
||||
parseFn = function() { return tAttr.ngPattern; };
|
||||
} else {
|
||||
parseFn = $parse(tAttr.ngPattern);
|
||||
}
|
||||
}
|
||||
|
||||
return function(scope, elm, attr, ctrl) {
|
||||
if (!ctrl) return;
|
||||
|
||||
var attrVal = attr.pattern;
|
||||
|
||||
if (attr.ngPattern) {
|
||||
attrVal = parseFn(scope);
|
||||
} else {
|
||||
patternExp = attr.pattern;
|
||||
}
|
||||
|
||||
if (regex && !regex.test) {
|
||||
throw minErr('ngPattern')('noregexp',
|
||||
'Expected {0} to be a RegExp but was {1}. Element: {2}', patternExp,
|
||||
regex, startingTag(elm));
|
||||
}
|
||||
var regexp = parsePatternAttr(attrVal, patternExp, elm);
|
||||
|
||||
regexp = regex || undefined;
|
||||
ctrl.$validate();
|
||||
});
|
||||
attr.$observe('pattern', function(newVal) {
|
||||
var oldRegexp = regexp;
|
||||
|
||||
ctrl.$validators.pattern = function(modelValue, viewValue) {
|
||||
// HTML5 pattern constraint validates the input value, so we validate the viewValue
|
||||
return ctrl.$isEmpty(viewValue) || isUndefined(regexp) || regexp.test(viewValue);
|
||||
regexp = parsePatternAttr(newVal, patternExp, elm);
|
||||
|
||||
if ((oldRegexp && oldRegexp.toString()) !== (regexp && regexp.toString())) {
|
||||
ctrl.$validate();
|
||||
}
|
||||
});
|
||||
|
||||
ctrl.$validators.pattern = function(modelValue, viewValue) {
|
||||
// HTML5 pattern constraint validates the input value, so we validate the viewValue
|
||||
return ctrl.$isEmpty(viewValue) || isUndefined(regexp) || regexp.test(viewValue);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
}];
|
||||
|
||||
/**
|
||||
* @ngdoc directive
|
||||
@@ -35947,25 +36099,29 @@ var patternDirective = function() {
|
||||
* </file>
|
||||
* </example>
|
||||
*/
|
||||
var maxlengthDirective = function() {
|
||||
var maxlengthDirective = ['$parse', function($parse) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
require: '?ngModel',
|
||||
link: function(scope, elm, attr, ctrl) {
|
||||
if (!ctrl) return;
|
||||
|
||||
var maxlength = -1;
|
||||
var maxlength = attr.maxlength || $parse(attr.ngMaxlength)(scope);
|
||||
var maxlengthParsed = parseLength(maxlength);
|
||||
|
||||
attr.$observe('maxlength', function(value) {
|
||||
var intVal = toInt(value);
|
||||
maxlength = isNumberNaN(intVal) ? -1 : intVal;
|
||||
ctrl.$validate();
|
||||
if (maxlength !== value) {
|
||||
maxlengthParsed = parseLength(value);
|
||||
maxlength = value;
|
||||
ctrl.$validate();
|
||||
}
|
||||
});
|
||||
ctrl.$validators.maxlength = function(modelValue, viewValue) {
|
||||
return (maxlength < 0) || ctrl.$isEmpty(viewValue) || (viewValue.length <= maxlength);
|
||||
return (maxlengthParsed < 0) || ctrl.$isEmpty(viewValue) || (viewValue.length <= maxlengthParsed);
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
}];
|
||||
|
||||
/**
|
||||
* @ngdoc directive
|
||||
@@ -36036,24 +36192,52 @@ var maxlengthDirective = function() {
|
||||
* </file>
|
||||
* </example>
|
||||
*/
|
||||
var minlengthDirective = function() {
|
||||
var minlengthDirective = ['$parse', function($parse) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
require: '?ngModel',
|
||||
link: function(scope, elm, attr, ctrl) {
|
||||
if (!ctrl) return;
|
||||
|
||||
var minlength = 0;
|
||||
var minlength = attr.minlength || $parse(attr.ngMinlength)(scope);
|
||||
var minlengthParsed = parseLength(minlength) || -1;
|
||||
|
||||
attr.$observe('minlength', function(value) {
|
||||
minlength = toInt(value) || 0;
|
||||
ctrl.$validate();
|
||||
if (minlength !== value) {
|
||||
minlengthParsed = parseLength(value) || -1;
|
||||
minlength = value;
|
||||
ctrl.$validate();
|
||||
}
|
||||
|
||||
});
|
||||
ctrl.$validators.minlength = function(modelValue, viewValue) {
|
||||
return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;
|
||||
return ctrl.$isEmpty(viewValue) || viewValue.length >= minlengthParsed;
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
}];
|
||||
|
||||
|
||||
function parsePatternAttr(regex, patternExp, elm) {
|
||||
if (!regex) return undefined;
|
||||
|
||||
if (isString(regex)) {
|
||||
regex = new RegExp('^' + regex + '$');
|
||||
}
|
||||
|
||||
if (!regex.test) {
|
||||
throw minErr('ngPattern')('noregexp',
|
||||
'Expected {0} to be a RegExp but was {1}. Element: {2}', patternExp,
|
||||
regex, startingTag(elm));
|
||||
}
|
||||
|
||||
return regex;
|
||||
}
|
||||
|
||||
function parseLength(val) {
|
||||
var intVal = toInt(val);
|
||||
return isNumberNaN(intVal) ? -1 : intVal;
|
||||
}
|
||||
|
||||
if (window.angular.bootstrap) {
|
||||
// AngularJS is already loaded, so we can return here...
|
||||
|
||||
Reference in New Issue
Block a user