diff --git a/bower.json b/bower.json index 97cbadbc..f1df23e6 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-validation", - "version": "0.2.7", + "version": "0.2.8", "description": "A validation plugin for Aurelia.", "keywords": [ "aurelia", diff --git a/config.js b/config.js index b2a80981..c179e4f2 100644 --- a/config.js +++ b/config.js @@ -1,18 +1,21 @@ System.config({ - defaultJSExtensions: true, - transpiler: "babel", - babelOptions: { + "transpiler": "babel", + "babelOptions": { "optional": [ "runtime", "optimisation.modules.system" ] }, - paths: { - "github:*": "jspm_packages/github/*", - "npm:*": "jspm_packages/npm/*" + "paths": { + "github:*": "jspm_packages/github/*.js", + "npm:*": "jspm_packages/npm/*.js", + "*": "*.js" }, + "defaultJSExtensions": true +}); - map: { +System.config({ + "map": { "aurelia-binding": "github:aurelia/binding@0.8.6", "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.9.2", "aurelia-logging": "github:aurelia/logging@0.6.4", @@ -72,3 +75,4 @@ System.config({ } } }); + diff --git a/dist/amd/index.js b/dist/amd/index.js index 764fd7e2..5bff05da 100644 --- a/dist/amd/index.js +++ b/dist/amd/index.js @@ -24,11 +24,11 @@ define(['exports', './validation/validation-config', './validation/validation', function configure(aurelia, configCallback) { - aurelia.globalizeResources('./validation/validate-custom-attribute'); + aurelia.globalResources('./validation/validate-custom-attribute'); if (configCallback !== undefined && typeof configCallback === 'function') { configCallback(_validationValidation.Validation.defaults); } - aurelia.withSingleton(_validationValidationConfig.ValidationConfig, _validationValidation.Validation.defaults); + aurelia.singleton(_validationValidationConfig.ValidationConfig, _validationValidation.Validation.defaults); return _validationValidation.Validation.defaults.locale(); } }); \ No newline at end of file diff --git a/dist/amd/validation/validation-rules.js b/dist/amd/validation/validation-rules.js index ed472369..b56ea6ee 100644 --- a/dist/amd/validation/validation-rules.js +++ b/dist/amd/validation/validation-rules.js @@ -8,14 +8,14 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } var ValidationRule = (function () { - function ValidationRule(threshold, onValidate, message) { + function ValidationRule(threshold, onValidate, message, ruleName) { _classCallCheck(this, ValidationRule); this.onValidate = onValidate; this.threshold = threshold; this.message = message; this.errorMessage = null; - this.ruleName = this.constructor.name; + this.ruleName = ruleName; } ValidationRule.prototype.withMessage = function withMessage(message) { @@ -144,7 +144,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] return false; } return true; - }); + }, null, 'URLValidationRule'); } _inherits(URLValidationRule, _ValidationRule); @@ -249,7 +249,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] return false; } return EmailValidationRule.testEmailUserUtf8Regex(user); - }); + }, null, 'EmailValidationRule'); } _inherits(EmailValidationRule, _ValidationRule2); @@ -288,7 +288,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] _ValidationRule3.call(this, minimumLength, function (newValue, minimumLength) { return newValue.length !== undefined && newValue.length >= minimumLength; - }); + }, null, 'MinimumLengthValidationRule'); } _inherits(MinimumLengthValidationRule, _ValidationRule3); @@ -304,7 +304,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] _ValidationRule4.call(this, maximumLength, function (newValue, maximumLength) { return newValue.length !== undefined && newValue.length <= maximumLength; - }); + }, null, 'MaximumLengthValidationRule'); } _inherits(MaximumLengthValidationRule, _ValidationRule4); @@ -320,7 +320,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] _ValidationRule5.call(this, { minimumLength: minimumLength, maximumLength: maximumLength }, function (newValue, threshold) { return newValue.length !== undefined && newValue.length >= threshold.minimumLength && newValue.length <= threshold.maximumLength; - }); + }, null, 'BetweenLengthValidationRule'); } _inherits(BetweenLengthValidationRule, _ValidationRule5); @@ -334,7 +334,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] function CustomFunctionValidationRule(customFunction, threshold) { _classCallCheck(this, CustomFunctionValidationRule); - _ValidationRule6.call(this, threshold, customFunction); + _ValidationRule6.call(this, threshold, customFunction, null, 'CustomFunctionValidationRule'); } _inherits(CustomFunctionValidationRule, _ValidationRule6); @@ -352,7 +352,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] var numericRegex = locale.setting('numericRegex'); var floatValue = parseFloat(newValue); return !Number.isNaN(parseFloat(newValue)) && Number.isFinite(floatValue) && numericRegex.test(newValue); - }); + }, null, 'NumericValidationRule'); } _inherits(NumericValidationRule, _ValidationRule7); @@ -363,12 +363,12 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] exports.NumericValidationRule = NumericValidationRule; var RegexValidationRule = (function (_ValidationRule8) { - function RegexValidationRule(regex) { + function RegexValidationRule(regex, ruleName) { _classCallCheck(this, RegexValidationRule); _ValidationRule8.call(this, regex, function (newValue, regex) { return regex.test(newValue); - }); + }, null, ruleName || 'RegexValidationRule'); } _inherits(RegexValidationRule, _ValidationRule8); @@ -382,7 +382,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] function ContainsOnlyValidationRule(regex) { _classCallCheck(this, ContainsOnlyValidationRule); - _RegexValidationRule.call(this, regex); + _RegexValidationRule.call(this, regex, 'ContainsOnlyValidationRule'); } _inherits(ContainsOnlyValidationRule, _RegexValidationRule); @@ -398,7 +398,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] _ValidationRule9.call(this, minimumValue, function (newValue, minimumValue) { return _validationUtilities.Utilities.getValue(minimumValue) < newValue; - }); + }, null, 'MinimumValueValidationRule'); } _inherits(MinimumValueValidationRule, _ValidationRule9); @@ -414,7 +414,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] _ValidationRule10.call(this, minimumValue, function (newValue, minimumValue) { return _validationUtilities.Utilities.getValue(minimumValue) <= newValue; - }); + }, null, 'MinimumInclusiveValueValidationRule'); } _inherits(MinimumInclusiveValueValidationRule, _ValidationRule10); @@ -430,7 +430,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] _ValidationRule11.call(this, maximumValue, function (newValue, maximumValue) { return newValue < _validationUtilities.Utilities.getValue(maximumValue); - }); + }, null, 'MaximumValueValidationRule'); } _inherits(MaximumValueValidationRule, _ValidationRule11); @@ -446,7 +446,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] _ValidationRule12.call(this, maximumValue, function (newValue, maximumValue) { return newValue <= _validationUtilities.Utilities.getValue(maximumValue); - }); + }, null, 'MaximumInclusiveValueValidationRule'); } _inherits(MaximumInclusiveValueValidationRule, _ValidationRule12); @@ -462,7 +462,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] _ValidationRule13.call(this, { minimumValue: minimumValue, maximumValue: maximumValue }, function (newValue, threshold) { return _validationUtilities.Utilities.getValue(threshold.minimumValue) <= newValue && newValue <= _validationUtilities.Utilities.getValue(threshold.maximumValue); - }); + }, null, 'BetweenValueValidationRule'); } _inherits(BetweenValueValidationRule, _ValidationRule13); @@ -478,7 +478,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] _ValidationRule14.call(this, null, function (newValue, threshold) { return /^\d+$/.test(newValue); - }); + }, null, 'DigitValidationRule'); } _inherits(DigitValidationRule, _ValidationRule14); @@ -494,7 +494,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] _ValidationRule15.call(this, null, function (newValue, threshold) { return /^\S*$/.test(newValue); - }); + }, null, 'NoSpacesValidationRule'); } _inherits(NoSpacesValidationRule, _ValidationRule15); @@ -510,7 +510,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] _ValidationRule16.call(this, null, function (newValue, threshold) { return /^[a-z0-9]+$/i.test(newValue); - }); + }, null, 'AlphaNumericValidationRule'); } _inherits(AlphaNumericValidationRule, _ValidationRule16); @@ -526,7 +526,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] _ValidationRule17.call(this, null, function (newValue, threshold) { return /^[a-z]+$/i.test(newValue); - }); + }, null, 'AlphaValidationRule'); } _inherits(AlphaValidationRule, _ValidationRule17); @@ -542,7 +542,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] _ValidationRule18.call(this, null, function (newValue, threshold) { return /^[a-z\s]+$/i.test(newValue); - }); + }, null, 'AlphaOrWhitespaceValidationRule'); } _inherits(AlphaOrWhitespaceValidationRule, _ValidationRule18); @@ -558,7 +558,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] _ValidationRule19.call(this, null, function (newValue, threshold) { return /^[a-z0-9\s]+$/i.test(newValue); - }); + }, null, 'AlphaNumericOrWhitespaceValidationRule'); } _inherits(AlphaNumericOrWhitespaceValidationRule, _ValidationRule19); @@ -569,7 +569,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] exports.AlphaNumericOrWhitespaceValidationRule = AlphaNumericOrWhitespaceValidationRule; var MediumPasswordValidationRule = (function (_ValidationRule20) { - function MediumPasswordValidationRule(minimumComplexityLevel) { + function MediumPasswordValidationRule(minimumComplexityLevel, ruleName) { _classCallCheck(this, MediumPasswordValidationRule); _ValidationRule20.call(this, minimumComplexityLevel ? minimumComplexityLevel : 3, function (newValue, threshold) { @@ -581,7 +581,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] strength += /[0-9]+/.test(newValue) ? 1 : 0; strength += /[\W]+/.test(newValue) ? 1 : 0; return strength >= threshold; - }); + }, null, ruleName || 'MediumPasswordValidationRule'); } _inherits(MediumPasswordValidationRule, _ValidationRule20); @@ -595,7 +595,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] function StrongPasswordValidationRule() { _classCallCheck(this, StrongPasswordValidationRule); - _MediumPasswordValidationRule.call(this, 4); + _MediumPasswordValidationRule.call(this, 4, 'StrongPasswordValidationRule'); } _inherits(StrongPasswordValidationRule, _MediumPasswordValidationRule); @@ -606,7 +606,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] exports.StrongPasswordValidationRule = StrongPasswordValidationRule; var EqualityValidationRuleBase = (function (_ValidationRule21) { - function EqualityValidationRuleBase(otherValue, equality, otherValueLabel) { + function EqualityValidationRuleBase(otherValue, equality, otherValueLabel, ruleName) { _classCallCheck(this, EqualityValidationRuleBase); _ValidationRule21.call(this, { @@ -617,7 +617,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] var otherValue = _validationUtilities.Utilities.getValue(threshold.otherValue); if (newValue instanceof Date && otherValue instanceof Date) return threshold.equality === (newValue.getTime() === otherValue.getTime()); return threshold.equality === (newValue === otherValue); - }); + }, null, ruleName || 'EqualityValidationRuleBase'); } _inherits(EqualityValidationRuleBase, _ValidationRule21); @@ -631,7 +631,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] function EqualityValidationRule(otherValue) { _classCallCheck(this, EqualityValidationRule); - _EqualityValidationRuleBase.call(this, otherValue, true); + _EqualityValidationRuleBase.call(this, otherValue, true, null, 'EqualityValidationRule'); } _inherits(EqualityValidationRule, _EqualityValidationRuleBase); @@ -645,7 +645,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] function EqualityWithOtherLabelValidationRule(otherValue, otherLabel) { _classCallCheck(this, EqualityWithOtherLabelValidationRule); - _EqualityValidationRuleBase2.call(this, otherValue, true, otherLabel); + _EqualityValidationRuleBase2.call(this, otherValue, true, otherLabel, 'EqualityWithOtherLabelValidationRule'); } _inherits(EqualityWithOtherLabelValidationRule, _EqualityValidationRuleBase2); @@ -659,7 +659,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] function InEqualityValidationRule(otherValue) { _classCallCheck(this, InEqualityValidationRule); - _EqualityValidationRuleBase3.call(this, otherValue, false); + _EqualityValidationRuleBase3.call(this, otherValue, false, null, 'InEqualityValidationRule'); } _inherits(InEqualityValidationRule, _EqualityValidationRuleBase3); @@ -673,7 +673,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] function InEqualityWithOtherLabelValidationRule(otherValue, otherLabel) { _classCallCheck(this, InEqualityWithOtherLabelValidationRule); - _EqualityValidationRuleBase4.call(this, otherValue, false, otherLabel); + _EqualityValidationRuleBase4.call(this, otherValue, false, otherLabel, 'InEqualityWithOtherLabelValidationRule'); } _inherits(InEqualityWithOtherLabelValidationRule, _EqualityValidationRuleBase4); @@ -693,7 +693,7 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] if (newValue === collection[i]) return true; } return false; - }); + }, null, 'InCollectionValidationRule'); } _inherits(InCollectionValidationRule, _ValidationRule22); diff --git a/dist/commonjs/index.js b/dist/commonjs/index.js index 4837f399..42602870 100644 --- a/dist/commonjs/index.js +++ b/dist/commonjs/index.js @@ -45,10 +45,10 @@ exports.ensure = _validationDecorators.ensure; function configure(aurelia, configCallback) { - aurelia.globalizeResources('./validation/validate-custom-attribute'); + aurelia.globalResources('./validation/validate-custom-attribute'); if (configCallback !== undefined && typeof configCallback === 'function') { configCallback(_validationValidation.Validation.defaults); } - aurelia.withSingleton(_validationValidationConfig.ValidationConfig, _validationValidation.Validation.defaults); + aurelia.singleton(_validationValidationConfig.ValidationConfig, _validationValidation.Validation.defaults); return _validationValidation.Validation.defaults.locale(); } \ No newline at end of file diff --git a/dist/commonjs/validation/validation-rules.js b/dist/commonjs/validation/validation-rules.js index f14fce02..1f0fb559 100644 --- a/dist/commonjs/validation/validation-rules.js +++ b/dist/commonjs/validation/validation-rules.js @@ -11,14 +11,14 @@ var _validationUtilities = require('../validation/utilities'); var _validationValidationLocale = require('../validation/validation-locale'); var ValidationRule = (function () { - function ValidationRule(threshold, onValidate, message) { + function ValidationRule(threshold, onValidate, message, ruleName) { _classCallCheck(this, ValidationRule); this.onValidate = onValidate; this.threshold = threshold; this.message = message; this.errorMessage = null; - this.ruleName = this.constructor.name; + this.ruleName = ruleName; } ValidationRule.prototype.withMessage = function withMessage(message) { @@ -147,7 +147,7 @@ var URLValidationRule = (function (_ValidationRule) { return false; } return true; - }); + }, null, 'URLValidationRule'); } _inherits(URLValidationRule, _ValidationRule); @@ -252,7 +252,7 @@ var EmailValidationRule = (function (_ValidationRule2) { return false; } return EmailValidationRule.testEmailUserUtf8Regex(user); - }); + }, null, 'EmailValidationRule'); } _inherits(EmailValidationRule, _ValidationRule2); @@ -291,7 +291,7 @@ var MinimumLengthValidationRule = (function (_ValidationRule3) { _ValidationRule3.call(this, minimumLength, function (newValue, minimumLength) { return newValue.length !== undefined && newValue.length >= minimumLength; - }); + }, null, 'MinimumLengthValidationRule'); } _inherits(MinimumLengthValidationRule, _ValidationRule3); @@ -307,7 +307,7 @@ var MaximumLengthValidationRule = (function (_ValidationRule4) { _ValidationRule4.call(this, maximumLength, function (newValue, maximumLength) { return newValue.length !== undefined && newValue.length <= maximumLength; - }); + }, null, 'MaximumLengthValidationRule'); } _inherits(MaximumLengthValidationRule, _ValidationRule4); @@ -323,7 +323,7 @@ var BetweenLengthValidationRule = (function (_ValidationRule5) { _ValidationRule5.call(this, { minimumLength: minimumLength, maximumLength: maximumLength }, function (newValue, threshold) { return newValue.length !== undefined && newValue.length >= threshold.minimumLength && newValue.length <= threshold.maximumLength; - }); + }, null, 'BetweenLengthValidationRule'); } _inherits(BetweenLengthValidationRule, _ValidationRule5); @@ -337,7 +337,7 @@ var CustomFunctionValidationRule = (function (_ValidationRule6) { function CustomFunctionValidationRule(customFunction, threshold) { _classCallCheck(this, CustomFunctionValidationRule); - _ValidationRule6.call(this, threshold, customFunction); + _ValidationRule6.call(this, threshold, customFunction, null, 'CustomFunctionValidationRule'); } _inherits(CustomFunctionValidationRule, _ValidationRule6); @@ -355,7 +355,7 @@ var NumericValidationRule = (function (_ValidationRule7) { var numericRegex = locale.setting('numericRegex'); var floatValue = parseFloat(newValue); return !Number.isNaN(parseFloat(newValue)) && Number.isFinite(floatValue) && numericRegex.test(newValue); - }); + }, null, 'NumericValidationRule'); } _inherits(NumericValidationRule, _ValidationRule7); @@ -366,12 +366,12 @@ var NumericValidationRule = (function (_ValidationRule7) { exports.NumericValidationRule = NumericValidationRule; var RegexValidationRule = (function (_ValidationRule8) { - function RegexValidationRule(regex) { + function RegexValidationRule(regex, ruleName) { _classCallCheck(this, RegexValidationRule); _ValidationRule8.call(this, regex, function (newValue, regex) { return regex.test(newValue); - }); + }, null, ruleName || 'RegexValidationRule'); } _inherits(RegexValidationRule, _ValidationRule8); @@ -385,7 +385,7 @@ var ContainsOnlyValidationRule = (function (_RegexValidationRule) { function ContainsOnlyValidationRule(regex) { _classCallCheck(this, ContainsOnlyValidationRule); - _RegexValidationRule.call(this, regex); + _RegexValidationRule.call(this, regex, 'ContainsOnlyValidationRule'); } _inherits(ContainsOnlyValidationRule, _RegexValidationRule); @@ -401,7 +401,7 @@ var MinimumValueValidationRule = (function (_ValidationRule9) { _ValidationRule9.call(this, minimumValue, function (newValue, minimumValue) { return _validationUtilities.Utilities.getValue(minimumValue) < newValue; - }); + }, null, 'MinimumValueValidationRule'); } _inherits(MinimumValueValidationRule, _ValidationRule9); @@ -417,7 +417,7 @@ var MinimumInclusiveValueValidationRule = (function (_ValidationRule10) { _ValidationRule10.call(this, minimumValue, function (newValue, minimumValue) { return _validationUtilities.Utilities.getValue(minimumValue) <= newValue; - }); + }, null, 'MinimumInclusiveValueValidationRule'); } _inherits(MinimumInclusiveValueValidationRule, _ValidationRule10); @@ -433,7 +433,7 @@ var MaximumValueValidationRule = (function (_ValidationRule11) { _ValidationRule11.call(this, maximumValue, function (newValue, maximumValue) { return newValue < _validationUtilities.Utilities.getValue(maximumValue); - }); + }, null, 'MaximumValueValidationRule'); } _inherits(MaximumValueValidationRule, _ValidationRule11); @@ -449,7 +449,7 @@ var MaximumInclusiveValueValidationRule = (function (_ValidationRule12) { _ValidationRule12.call(this, maximumValue, function (newValue, maximumValue) { return newValue <= _validationUtilities.Utilities.getValue(maximumValue); - }); + }, null, 'MaximumInclusiveValueValidationRule'); } _inherits(MaximumInclusiveValueValidationRule, _ValidationRule12); @@ -465,7 +465,7 @@ var BetweenValueValidationRule = (function (_ValidationRule13) { _ValidationRule13.call(this, { minimumValue: minimumValue, maximumValue: maximumValue }, function (newValue, threshold) { return _validationUtilities.Utilities.getValue(threshold.minimumValue) <= newValue && newValue <= _validationUtilities.Utilities.getValue(threshold.maximumValue); - }); + }, null, 'BetweenValueValidationRule'); } _inherits(BetweenValueValidationRule, _ValidationRule13); @@ -481,7 +481,7 @@ var DigitValidationRule = (function (_ValidationRule14) { _ValidationRule14.call(this, null, function (newValue, threshold) { return /^\d+$/.test(newValue); - }); + }, null, 'DigitValidationRule'); } _inherits(DigitValidationRule, _ValidationRule14); @@ -497,7 +497,7 @@ var NoSpacesValidationRule = (function (_ValidationRule15) { _ValidationRule15.call(this, null, function (newValue, threshold) { return /^\S*$/.test(newValue); - }); + }, null, 'NoSpacesValidationRule'); } _inherits(NoSpacesValidationRule, _ValidationRule15); @@ -513,7 +513,7 @@ var AlphaNumericValidationRule = (function (_ValidationRule16) { _ValidationRule16.call(this, null, function (newValue, threshold) { return /^[a-z0-9]+$/i.test(newValue); - }); + }, null, 'AlphaNumericValidationRule'); } _inherits(AlphaNumericValidationRule, _ValidationRule16); @@ -529,7 +529,7 @@ var AlphaValidationRule = (function (_ValidationRule17) { _ValidationRule17.call(this, null, function (newValue, threshold) { return /^[a-z]+$/i.test(newValue); - }); + }, null, 'AlphaValidationRule'); } _inherits(AlphaValidationRule, _ValidationRule17); @@ -545,7 +545,7 @@ var AlphaOrWhitespaceValidationRule = (function (_ValidationRule18) { _ValidationRule18.call(this, null, function (newValue, threshold) { return /^[a-z\s]+$/i.test(newValue); - }); + }, null, 'AlphaOrWhitespaceValidationRule'); } _inherits(AlphaOrWhitespaceValidationRule, _ValidationRule18); @@ -561,7 +561,7 @@ var AlphaNumericOrWhitespaceValidationRule = (function (_ValidationRule19) { _ValidationRule19.call(this, null, function (newValue, threshold) { return /^[a-z0-9\s]+$/i.test(newValue); - }); + }, null, 'AlphaNumericOrWhitespaceValidationRule'); } _inherits(AlphaNumericOrWhitespaceValidationRule, _ValidationRule19); @@ -572,7 +572,7 @@ var AlphaNumericOrWhitespaceValidationRule = (function (_ValidationRule19) { exports.AlphaNumericOrWhitespaceValidationRule = AlphaNumericOrWhitespaceValidationRule; var MediumPasswordValidationRule = (function (_ValidationRule20) { - function MediumPasswordValidationRule(minimumComplexityLevel) { + function MediumPasswordValidationRule(minimumComplexityLevel, ruleName) { _classCallCheck(this, MediumPasswordValidationRule); _ValidationRule20.call(this, minimumComplexityLevel ? minimumComplexityLevel : 3, function (newValue, threshold) { @@ -584,7 +584,7 @@ var MediumPasswordValidationRule = (function (_ValidationRule20) { strength += /[0-9]+/.test(newValue) ? 1 : 0; strength += /[\W]+/.test(newValue) ? 1 : 0; return strength >= threshold; - }); + }, null, ruleName || 'MediumPasswordValidationRule'); } _inherits(MediumPasswordValidationRule, _ValidationRule20); @@ -598,7 +598,7 @@ var StrongPasswordValidationRule = (function (_MediumPasswordValidationRule) { function StrongPasswordValidationRule() { _classCallCheck(this, StrongPasswordValidationRule); - _MediumPasswordValidationRule.call(this, 4); + _MediumPasswordValidationRule.call(this, 4, 'StrongPasswordValidationRule'); } _inherits(StrongPasswordValidationRule, _MediumPasswordValidationRule); @@ -609,7 +609,7 @@ var StrongPasswordValidationRule = (function (_MediumPasswordValidationRule) { exports.StrongPasswordValidationRule = StrongPasswordValidationRule; var EqualityValidationRuleBase = (function (_ValidationRule21) { - function EqualityValidationRuleBase(otherValue, equality, otherValueLabel) { + function EqualityValidationRuleBase(otherValue, equality, otherValueLabel, ruleName) { _classCallCheck(this, EqualityValidationRuleBase); _ValidationRule21.call(this, { @@ -620,7 +620,7 @@ var EqualityValidationRuleBase = (function (_ValidationRule21) { var otherValue = _validationUtilities.Utilities.getValue(threshold.otherValue); if (newValue instanceof Date && otherValue instanceof Date) return threshold.equality === (newValue.getTime() === otherValue.getTime()); return threshold.equality === (newValue === otherValue); - }); + }, null, ruleName || 'EqualityValidationRuleBase'); } _inherits(EqualityValidationRuleBase, _ValidationRule21); @@ -634,7 +634,7 @@ var EqualityValidationRule = (function (_EqualityValidationRuleBase) { function EqualityValidationRule(otherValue) { _classCallCheck(this, EqualityValidationRule); - _EqualityValidationRuleBase.call(this, otherValue, true); + _EqualityValidationRuleBase.call(this, otherValue, true, null, 'EqualityValidationRule'); } _inherits(EqualityValidationRule, _EqualityValidationRuleBase); @@ -648,7 +648,7 @@ var EqualityWithOtherLabelValidationRule = (function (_EqualityValidationRuleBas function EqualityWithOtherLabelValidationRule(otherValue, otherLabel) { _classCallCheck(this, EqualityWithOtherLabelValidationRule); - _EqualityValidationRuleBase2.call(this, otherValue, true, otherLabel); + _EqualityValidationRuleBase2.call(this, otherValue, true, otherLabel, 'EqualityWithOtherLabelValidationRule'); } _inherits(EqualityWithOtherLabelValidationRule, _EqualityValidationRuleBase2); @@ -662,7 +662,7 @@ var InEqualityValidationRule = (function (_EqualityValidationRuleBase3) { function InEqualityValidationRule(otherValue) { _classCallCheck(this, InEqualityValidationRule); - _EqualityValidationRuleBase3.call(this, otherValue, false); + _EqualityValidationRuleBase3.call(this, otherValue, false, null, 'InEqualityValidationRule'); } _inherits(InEqualityValidationRule, _EqualityValidationRuleBase3); @@ -676,7 +676,7 @@ var InEqualityWithOtherLabelValidationRule = (function (_EqualityValidationRuleB function InEqualityWithOtherLabelValidationRule(otherValue, otherLabel) { _classCallCheck(this, InEqualityWithOtherLabelValidationRule); - _EqualityValidationRuleBase4.call(this, otherValue, false, otherLabel); + _EqualityValidationRuleBase4.call(this, otherValue, false, otherLabel, 'InEqualityWithOtherLabelValidationRule'); } _inherits(InEqualityWithOtherLabelValidationRule, _EqualityValidationRuleBase4); @@ -696,7 +696,7 @@ var InCollectionValidationRule = (function (_ValidationRule22) { if (newValue === collection[i]) return true; } return false; - }); + }, null, 'InCollectionValidationRule'); } _inherits(InCollectionValidationRule, _ValidationRule22); diff --git a/dist/es6/index.js b/dist/es6/index.js index 4f6c67e8..c46e372c 100644 --- a/dist/es6/index.js +++ b/dist/es6/index.js @@ -15,11 +15,11 @@ import {Validation} from './validation/validation'; export function configure(aurelia, configCallback) { - aurelia.globalizeResources('./validation/validate-custom-attribute'); + aurelia.globalResources('./validation/validate-custom-attribute'); if(configCallback !== undefined && typeof(configCallback) === 'function') { configCallback(Validation.defaults); } - aurelia.withSingleton(ValidationConfig, Validation.defaults); + aurelia.singleton(ValidationConfig, Validation.defaults); return Validation.defaults.locale(); } diff --git a/dist/es6/validation/validation-rules.js b/dist/es6/validation/validation-rules.js index 7fdf5521..7a20b7b0 100644 --- a/dist/es6/validation/validation-rules.js +++ b/dist/es6/validation/validation-rules.js @@ -2,12 +2,12 @@ import {Utilities} from '../validation/utilities'; import {ValidationLocale} from '../validation/validation-locale'; export class ValidationRule { - constructor(threshold, onValidate, message) { + constructor(threshold, onValidate, message, ruleName) { this.onValidate = onValidate; this.threshold = threshold; this.message = message; this.errorMessage = null; - this.ruleName = this.constructor.name; + this.ruleName = ruleName; } withMessage(message) { @@ -237,7 +237,9 @@ export class URLValidationRule extends ValidationRule { return false; } return true; - } + }, + null, + 'URLValidationRule' ); } @@ -284,7 +286,9 @@ export class EmailValidationRule extends ValidationRule { return false; } return EmailValidationRule.testEmailUserUtf8Regex(user); - } + }, + null, + 'EmailValidationRule' ); } @@ -296,7 +300,9 @@ export class MinimumLengthValidationRule extends ValidationRule { minimumLength, (newValue, minimumLength) => { return newValue.length !== undefined && newValue.length >= minimumLength; - } + }, + null, + 'MinimumLengthValidationRule' ); } } @@ -307,7 +313,9 @@ export class MaximumLengthValidationRule extends ValidationRule { maximumLength, (newValue, maximumLength) => { return newValue.length !== undefined && newValue.length <= maximumLength; - } + }, + null, + 'MaximumLengthValidationRule' ); } } @@ -320,7 +328,9 @@ export class BetweenLengthValidationRule extends ValidationRule { return newValue.length !== undefined && newValue.length >= threshold.minimumLength && newValue.length <= threshold.maximumLength; - } + }, + null, + 'BetweenLengthValidationRule' ); } } @@ -329,7 +339,9 @@ export class CustomFunctionValidationRule extends ValidationRule { constructor(customFunction, threshold) { super( threshold, - customFunction + customFunction, + null, + 'CustomFunctionValidationRule' ) } } @@ -344,25 +356,29 @@ export class NumericValidationRule extends ValidationRule { return !Number.isNaN(parseFloat(newValue)) && Number.isFinite(floatValue) && numericRegex.test(newValue); - } + }, + null, + 'NumericValidationRule' ); } } export class RegexValidationRule extends ValidationRule { - constructor(regex) { + constructor(regex, ruleName) { super( regex, (newValue, regex) => { return regex.test(newValue); - } + }, + null, + ruleName || 'RegexValidationRule' ); } } export class ContainsOnlyValidationRule extends RegexValidationRule { constructor(regex) { - super(regex); + super(regex, 'ContainsOnlyValidationRule'); } } @@ -372,7 +388,9 @@ export class MinimumValueValidationRule extends ValidationRule { minimumValue, (newValue, minimumValue) => { return Utilities.getValue(minimumValue) < newValue; - } + }, + null, + 'MinimumValueValidationRule' ); } } @@ -383,7 +401,9 @@ export class MinimumInclusiveValueValidationRule extends ValidationRule { minimumValue, (newValue, minimumValue) => { return Utilities.getValue(minimumValue) <= newValue; - } + }, + null, + 'MinimumInclusiveValueValidationRule' ); } } @@ -394,7 +414,9 @@ export class MaximumValueValidationRule extends ValidationRule { maximumValue, (newValue, maximumValue) => { return newValue < Utilities.getValue(maximumValue); - } + }, + null, + 'MaximumValueValidationRule' ); } } @@ -405,7 +427,9 @@ export class MaximumInclusiveValueValidationRule extends ValidationRule { maximumValue, (newValue, maximumValue) => { return newValue <= Utilities.getValue(maximumValue); - } + }, + null, + 'MaximumInclusiveValueValidationRule' ); } } @@ -416,7 +440,9 @@ export class BetweenValueValidationRule extends ValidationRule { {minimumValue: minimumValue, maximumValue: maximumValue}, (newValue, threshold) => { return Utilities.getValue(threshold.minimumValue) <= newValue && newValue <= Utilities.getValue(threshold.maximumValue); - } + }, + null, + 'BetweenValueValidationRule' ); } } @@ -427,7 +453,9 @@ export class DigitValidationRule extends ValidationRule { null, (newValue, threshold) => { return /^\d+$/.test(newValue); - } + }, + null, + 'DigitValidationRule' ); } } @@ -438,7 +466,9 @@ export class NoSpacesValidationRule extends ValidationRule { null, (newValue, threshold) => { return /^\S*$/.test(newValue); - } + }, + null, + 'NoSpacesValidationRule' ); } } @@ -449,7 +479,9 @@ export class AlphaNumericValidationRule extends ValidationRule { null, (newValue, threshold) => { return /^[a-z0-9]+$/i.test(newValue); - } + }, + null, + 'AlphaNumericValidationRule' ); } } @@ -460,7 +492,9 @@ export class AlphaValidationRule extends ValidationRule { null, (newValue, threshold) => { return /^[a-z]+$/i.test(newValue); - } + }, + null, + 'AlphaValidationRule' ); } } @@ -472,7 +506,9 @@ export class AlphaOrWhitespaceValidationRule extends ValidationRule { null, (newValue, threshold) => { return /^[a-z\s]+$/i.test(newValue); - } + }, + null, + 'AlphaOrWhitespaceValidationRule' ); } } @@ -484,13 +520,15 @@ export class AlphaNumericOrWhitespaceValidationRule extends ValidationRule { null, (newValue, threshold) => { return /^[a-z0-9\s]+$/i.test(newValue); - } + }, + null, + 'AlphaNumericOrWhitespaceValidationRule' ); } } export class MediumPasswordValidationRule extends ValidationRule { - constructor(minimumComplexityLevel) { + constructor(minimumComplexityLevel, ruleName) { super( (minimumComplexityLevel) ? minimumComplexityLevel : 3, (newValue, threshold) => { @@ -503,7 +541,9 @@ export class MediumPasswordValidationRule extends ValidationRule { strength += /[0-9]+/.test(newValue) ? 1 : 0; strength += /[\W]+/.test(newValue) ? 1 : 0; return strength >= threshold; - } + }, + null, + ruleName || 'MediumPasswordValidationRule' ); } } @@ -511,12 +551,12 @@ export class MediumPasswordValidationRule extends ValidationRule { export class StrongPasswordValidationRule extends MediumPasswordValidationRule { constructor() { - super(4); + super(4, 'StrongPasswordValidationRule'); } } export class EqualityValidationRuleBase extends ValidationRule { - constructor(otherValue, equality, otherValueLabel) { + constructor(otherValue, equality, otherValueLabel, ruleName) { super( { otherValue: otherValue, @@ -528,32 +568,34 @@ export class EqualityValidationRuleBase extends ValidationRule { if (newValue instanceof Date && otherValue instanceof Date) return threshold.equality === (newValue.getTime() === otherValue.getTime()); return threshold.equality === (newValue === otherValue); - } + }, + null, + ruleName || 'EqualityValidationRuleBase' ); } } export class EqualityValidationRule extends EqualityValidationRuleBase { constructor(otherValue) { - super(otherValue, true); + super(otherValue, true, null, 'EqualityValidationRule'); } } export class EqualityWithOtherLabelValidationRule extends EqualityValidationRuleBase { constructor(otherValue, otherLabel) { - super(otherValue, true, otherLabel); + super(otherValue, true, otherLabel, 'EqualityWithOtherLabelValidationRule'); } } export class InEqualityValidationRule extends EqualityValidationRuleBase { constructor(otherValue) { - super(otherValue, false); + super(otherValue, false, null, 'InEqualityValidationRule'); } } export class InEqualityWithOtherLabelValidationRule extends EqualityValidationRuleBase { constructor(otherValue, otherLabel) { - super(otherValue, false, otherLabel); + super(otherValue, false, otherLabel, 'InEqualityWithOtherLabelValidationRule'); } } @@ -569,7 +611,9 @@ export class InCollectionValidationRule extends ValidationRule { return true; } return false; - } + }, + null, + 'InCollectionValidationRule' ); } } diff --git a/dist/system/index.js b/dist/system/index.js index 4a3bd70d..1ad557d6 100644 --- a/dist/system/index.js +++ b/dist/system/index.js @@ -7,11 +7,11 @@ System.register(['./validation/validation-config', './validation/validation', '. function configure(aurelia, configCallback) { - aurelia.globalizeResources('./validation/validate-custom-attribute'); + aurelia.globalResources('./validation/validate-custom-attribute'); if (configCallback !== undefined && typeof configCallback === 'function') { configCallback(Validation.defaults); } - aurelia.withSingleton(ValidationConfig, Validation.defaults); + aurelia.singleton(ValidationConfig, Validation.defaults); return Validation.defaults.locale(); } diff --git a/dist/system/validation/validation-rules.js b/dist/system/validation/validation-rules.js index 0ad5fe53..184b6cfa 100644 --- a/dist/system/validation/validation-rules.js +++ b/dist/system/validation/validation-rules.js @@ -15,14 +15,14 @@ System.register(['../validation/utilities', '../validation/validation-locale'], }], execute: function () { ValidationRule = (function () { - function ValidationRule(threshold, onValidate, message) { + function ValidationRule(threshold, onValidate, message, ruleName) { _classCallCheck(this, ValidationRule); this.onValidate = onValidate; this.threshold = threshold; this.message = message; this.errorMessage = null; - this.ruleName = this.constructor.name; + this.ruleName = ruleName; } ValidationRule.prototype.withMessage = function withMessage(message) { @@ -151,7 +151,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], return false; } return true; - }); + }, null, 'URLValidationRule'); } _inherits(URLValidationRule, _ValidationRule); @@ -256,7 +256,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], return false; } return EmailValidationRule.testEmailUserUtf8Regex(user); - }); + }, null, 'EmailValidationRule'); } _inherits(EmailValidationRule, _ValidationRule2); @@ -295,7 +295,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _ValidationRule3.call(this, minimumLength, function (newValue, minimumLength) { return newValue.length !== undefined && newValue.length >= minimumLength; - }); + }, null, 'MinimumLengthValidationRule'); } _inherits(MinimumLengthValidationRule, _ValidationRule3); @@ -311,7 +311,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _ValidationRule4.call(this, maximumLength, function (newValue, maximumLength) { return newValue.length !== undefined && newValue.length <= maximumLength; - }); + }, null, 'MaximumLengthValidationRule'); } _inherits(MaximumLengthValidationRule, _ValidationRule4); @@ -327,7 +327,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _ValidationRule5.call(this, { minimumLength: minimumLength, maximumLength: maximumLength }, function (newValue, threshold) { return newValue.length !== undefined && newValue.length >= threshold.minimumLength && newValue.length <= threshold.maximumLength; - }); + }, null, 'BetweenLengthValidationRule'); } _inherits(BetweenLengthValidationRule, _ValidationRule5); @@ -341,7 +341,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], function CustomFunctionValidationRule(customFunction, threshold) { _classCallCheck(this, CustomFunctionValidationRule); - _ValidationRule6.call(this, threshold, customFunction); + _ValidationRule6.call(this, threshold, customFunction, null, 'CustomFunctionValidationRule'); } _inherits(CustomFunctionValidationRule, _ValidationRule6); @@ -359,7 +359,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], var numericRegex = locale.setting('numericRegex'); var floatValue = parseFloat(newValue); return !Number.isNaN(parseFloat(newValue)) && Number.isFinite(floatValue) && numericRegex.test(newValue); - }); + }, null, 'NumericValidationRule'); } _inherits(NumericValidationRule, _ValidationRule7); @@ -370,12 +370,12 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _export('NumericValidationRule', NumericValidationRule); RegexValidationRule = (function (_ValidationRule8) { - function RegexValidationRule(regex) { + function RegexValidationRule(regex, ruleName) { _classCallCheck(this, RegexValidationRule); _ValidationRule8.call(this, regex, function (newValue, regex) { return regex.test(newValue); - }); + }, null, ruleName || 'RegexValidationRule'); } _inherits(RegexValidationRule, _ValidationRule8); @@ -389,7 +389,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], function ContainsOnlyValidationRule(regex) { _classCallCheck(this, ContainsOnlyValidationRule); - _RegexValidationRule.call(this, regex); + _RegexValidationRule.call(this, regex, 'ContainsOnlyValidationRule'); } _inherits(ContainsOnlyValidationRule, _RegexValidationRule); @@ -405,7 +405,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _ValidationRule9.call(this, minimumValue, function (newValue, minimumValue) { return Utilities.getValue(minimumValue) < newValue; - }); + }, null, 'MinimumValueValidationRule'); } _inherits(MinimumValueValidationRule, _ValidationRule9); @@ -421,7 +421,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _ValidationRule10.call(this, minimumValue, function (newValue, minimumValue) { return Utilities.getValue(minimumValue) <= newValue; - }); + }, null, 'MinimumInclusiveValueValidationRule'); } _inherits(MinimumInclusiveValueValidationRule, _ValidationRule10); @@ -437,7 +437,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _ValidationRule11.call(this, maximumValue, function (newValue, maximumValue) { return newValue < Utilities.getValue(maximumValue); - }); + }, null, 'MaximumValueValidationRule'); } _inherits(MaximumValueValidationRule, _ValidationRule11); @@ -453,7 +453,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _ValidationRule12.call(this, maximumValue, function (newValue, maximumValue) { return newValue <= Utilities.getValue(maximumValue); - }); + }, null, 'MaximumInclusiveValueValidationRule'); } _inherits(MaximumInclusiveValueValidationRule, _ValidationRule12); @@ -469,7 +469,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _ValidationRule13.call(this, { minimumValue: minimumValue, maximumValue: maximumValue }, function (newValue, threshold) { return Utilities.getValue(threshold.minimumValue) <= newValue && newValue <= Utilities.getValue(threshold.maximumValue); - }); + }, null, 'BetweenValueValidationRule'); } _inherits(BetweenValueValidationRule, _ValidationRule13); @@ -485,7 +485,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _ValidationRule14.call(this, null, function (newValue, threshold) { return /^\d+$/.test(newValue); - }); + }, null, 'DigitValidationRule'); } _inherits(DigitValidationRule, _ValidationRule14); @@ -501,7 +501,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _ValidationRule15.call(this, null, function (newValue, threshold) { return /^\S*$/.test(newValue); - }); + }, null, 'NoSpacesValidationRule'); } _inherits(NoSpacesValidationRule, _ValidationRule15); @@ -517,7 +517,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _ValidationRule16.call(this, null, function (newValue, threshold) { return /^[a-z0-9]+$/i.test(newValue); - }); + }, null, 'AlphaNumericValidationRule'); } _inherits(AlphaNumericValidationRule, _ValidationRule16); @@ -533,7 +533,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _ValidationRule17.call(this, null, function (newValue, threshold) { return /^[a-z]+$/i.test(newValue); - }); + }, null, 'AlphaValidationRule'); } _inherits(AlphaValidationRule, _ValidationRule17); @@ -549,7 +549,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _ValidationRule18.call(this, null, function (newValue, threshold) { return /^[a-z\s]+$/i.test(newValue); - }); + }, null, 'AlphaOrWhitespaceValidationRule'); } _inherits(AlphaOrWhitespaceValidationRule, _ValidationRule18); @@ -565,7 +565,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _ValidationRule19.call(this, null, function (newValue, threshold) { return /^[a-z0-9\s]+$/i.test(newValue); - }); + }, null, 'AlphaNumericOrWhitespaceValidationRule'); } _inherits(AlphaNumericOrWhitespaceValidationRule, _ValidationRule19); @@ -576,7 +576,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _export('AlphaNumericOrWhitespaceValidationRule', AlphaNumericOrWhitespaceValidationRule); MediumPasswordValidationRule = (function (_ValidationRule20) { - function MediumPasswordValidationRule(minimumComplexityLevel) { + function MediumPasswordValidationRule(minimumComplexityLevel, ruleName) { _classCallCheck(this, MediumPasswordValidationRule); _ValidationRule20.call(this, minimumComplexityLevel ? minimumComplexityLevel : 3, function (newValue, threshold) { @@ -588,7 +588,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], strength += /[0-9]+/.test(newValue) ? 1 : 0; strength += /[\W]+/.test(newValue) ? 1 : 0; return strength >= threshold; - }); + }, null, ruleName || 'MediumPasswordValidationRule'); } _inherits(MediumPasswordValidationRule, _ValidationRule20); @@ -602,7 +602,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], function StrongPasswordValidationRule() { _classCallCheck(this, StrongPasswordValidationRule); - _MediumPasswordValidationRule.call(this, 4); + _MediumPasswordValidationRule.call(this, 4, 'StrongPasswordValidationRule'); } _inherits(StrongPasswordValidationRule, _MediumPasswordValidationRule); @@ -613,7 +613,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], _export('StrongPasswordValidationRule', StrongPasswordValidationRule); EqualityValidationRuleBase = (function (_ValidationRule21) { - function EqualityValidationRuleBase(otherValue, equality, otherValueLabel) { + function EqualityValidationRuleBase(otherValue, equality, otherValueLabel, ruleName) { _classCallCheck(this, EqualityValidationRuleBase); _ValidationRule21.call(this, { @@ -624,7 +624,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], var otherValue = Utilities.getValue(threshold.otherValue); if (newValue instanceof Date && otherValue instanceof Date) return threshold.equality === (newValue.getTime() === otherValue.getTime()); return threshold.equality === (newValue === otherValue); - }); + }, null, ruleName || 'EqualityValidationRuleBase'); } _inherits(EqualityValidationRuleBase, _ValidationRule21); @@ -638,7 +638,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], function EqualityValidationRule(otherValue) { _classCallCheck(this, EqualityValidationRule); - _EqualityValidationRuleBase.call(this, otherValue, true); + _EqualityValidationRuleBase.call(this, otherValue, true, null, 'EqualityValidationRule'); } _inherits(EqualityValidationRule, _EqualityValidationRuleBase); @@ -652,7 +652,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], function EqualityWithOtherLabelValidationRule(otherValue, otherLabel) { _classCallCheck(this, EqualityWithOtherLabelValidationRule); - _EqualityValidationRuleBase2.call(this, otherValue, true, otherLabel); + _EqualityValidationRuleBase2.call(this, otherValue, true, otherLabel, 'EqualityWithOtherLabelValidationRule'); } _inherits(EqualityWithOtherLabelValidationRule, _EqualityValidationRuleBase2); @@ -666,7 +666,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], function InEqualityValidationRule(otherValue) { _classCallCheck(this, InEqualityValidationRule); - _EqualityValidationRuleBase3.call(this, otherValue, false); + _EqualityValidationRuleBase3.call(this, otherValue, false, null, 'InEqualityValidationRule'); } _inherits(InEqualityValidationRule, _EqualityValidationRuleBase3); @@ -680,7 +680,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], function InEqualityWithOtherLabelValidationRule(otherValue, otherLabel) { _classCallCheck(this, InEqualityWithOtherLabelValidationRule); - _EqualityValidationRuleBase4.call(this, otherValue, false, otherLabel); + _EqualityValidationRuleBase4.call(this, otherValue, false, otherLabel, 'InEqualityWithOtherLabelValidationRule'); } _inherits(InEqualityWithOtherLabelValidationRule, _EqualityValidationRuleBase4); @@ -700,7 +700,7 @@ System.register(['../validation/utilities', '../validation/validation-locale'], if (newValue === collection[i]) return true; } return false; - }); + }, null, 'InCollectionValidationRule'); } _inherits(InCollectionValidationRule, _ValidationRule22); diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index ba5c6293..dde19e72 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,12 @@ +### 0.2.8 (2015-08-20) + + +#### Bug Fixes + + +#### Features + + ### 0.2.7 (2015-07-09) diff --git a/package.json b/package.json index d8012783..51ec9f95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-validation", - "version": "0.2.7", + "version": "0.2.8", "description": "A validation plugin for Aurelia.", "keywords": [ "aurelia",