Skip to content

Commit

Permalink
chore(prepare-release): prepare release 0.3.1
Browse files Browse the repository at this point in the history
Includes many nice community-added features and enhancements.
  • Loading branch information
plwalters committed Sep 19, 2015
1 parent 01dc500 commit 8642558
Show file tree
Hide file tree
Showing 139 changed files with 21,372 additions and 3,271 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-validation",
"version": "0.3.0",
"version": "0.3.1",
"description": "A validation plugin for Aurelia.",
"keywords": [
"aurelia",
Expand Down
563 changes: 563 additions & 0 deletions dist/amd/aurelia-validation.d.ts

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
32 changes: 16 additions & 16 deletions dist/amd/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['exports', './validation/validation-config', './validation/validation', './validation/utilities', './validation/validation-locale', './validation/validation-result', './validation/validation-rules', './validation/validate-custom-attribute', './validation/validate-custom-attribute-view-strategy', './validation/decorators'], function (exports, _validationValidationConfig, _validationValidation, _validationUtilities, _validationValidationLocale, _validationValidationResult, _validationValidationRules, _validationValidateCustomAttribute, _validationValidateCustomAttributeViewStrategy, _validationDecorators) {
define(['exports', './validation-config', './validation', './utilities', './validation-locale', './validation-result', './validation-rules', './validation-group', './validate-custom-attribute', './validation-view-strategy', './strategies/twbootstrap-view-strategy', './decorators'], function (exports, _validationConfig, _validation, _utilities, _validationLocale, _validationResult, _validationRules, _validationGroup, _validateCustomAttribute, _validationViewStrategy, _strategiesTwbootstrapViewStrategy, _decorators) {
'use strict';

exports.__esModule = true;
Expand All @@ -8,27 +8,27 @@ define(['exports', './validation/validation-config', './validation/validation',

function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }

exports.Utilities = _validationUtilities.Utilities;
exports.ValidationConfig = _validationValidationConfig.ValidationConfig;
exports.ValidationLocale = _validationValidationLocale.ValidationLocale;
exports.Utilities = _utilities.Utilities;
exports.ValidationConfig = _validationConfig.ValidationConfig;
exports.ValidationLocale = _validationLocale.ValidationLocale;

_defaults(exports, _interopRequireWildcard(_validationValidationResult));
_defaults(exports, _interopRequireWildcard(_validationResult));

_defaults(exports, _interopRequireWildcard(_validationValidationRules));
_defaults(exports, _interopRequireWildcard(_validationRules));

exports.Validation = _validationValidation.Validation;
exports.ValidateCustomAttribute = _validationValidateCustomAttribute.ValidateCustomAttribute;
exports.ValidateCustomAttributeViewStrategy = _validationValidateCustomAttributeViewStrategy.ValidateCustomAttributeViewStrategy;
exports.ValidateCustomAttributeViewStrategyBase = _validationValidateCustomAttributeViewStrategy.ValidateCustomAttributeViewStrategyBase;
exports.ensure = _validationDecorators.ensure;
exports.Validation = _validation.Validation;
exports.ValidationGroup = _validationGroup.ValidationGroup;
exports.ValidateCustomAttribute = _validateCustomAttribute.ValidateCustomAttribute;
exports.ValidationViewStrategy = _validationViewStrategy.ValidationViewStrategy;
exports.TWBootstrapViewStrategy = _strategiesTwbootstrapViewStrategy.TWBootstrapViewStrategy;
exports.ensure = _decorators.ensure;

function configure(aurelia, configCallback) {

aurelia.globalResources('./validation/validate-custom-attribute');
aurelia.globalResources('./validate-custom-attribute');
if (configCallback !== undefined && typeof configCallback === 'function') {
configCallback(_validationValidation.Validation.defaults);
configCallback(_validation.Validation.defaults);
}
aurelia.singleton(_validationValidationConfig.ValidationConfig, _validationValidation.Validation.defaults);
return _validationValidation.Validation.defaults.locale();
aurelia.singleton(_validationConfig.ValidationConfig, _validation.Validation.defaults);
return _validation.Validation.defaults.locale();
}
});
45 changes: 27 additions & 18 deletions dist/amd/validation/path-observer.js → dist/amd/path-observer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['exports', 'aurelia-binding'], function (exports, _aureliaBinding) {
define(['exports'], function (exports) {
'use strict';

exports.__esModule = true;
Expand All @@ -14,43 +14,47 @@ define(['exports', 'aurelia-binding'], function (exports, _aureliaBinding) {
this.subject = subject;
this.observers = [];
this.callbacks = [];
if (this.path.length > 1) this.observeParts();
if (this.path.length > 1) {
this.observeParts();
}
}

PathObserver.prototype.observeParts = function observeParts(propertyName) {
var _this = this;

var currentSubject = this.subject;
var observersAreComplete = undefined;

if (propertyName !== undefined && propertyName !== null) {
for (var i = this.observers.length - 1; i >= 0; i--) {
var currentObserver = this.observers[i];
var observer = undefined;
if (currentObserver.propertyName === propertyName) {
break;
}
var observer = this.observers.pop();
observer = this.observers.pop();
if (observer && observer.subscription) {
observer.subscription();
}
}
}

var currentSubject = this.subject;

var observersAreComplete = this.observers.length === this.path.length;
observersAreComplete = this.observers.length === this.path.length;

var _loop = function (i) {
var observer = _this.observers[i];
var currentPath = _this.path[i];
var subscription = undefined;
var currentValue = undefined;
if (!observer) {

var currentPath = _this.path[i];
observer = _this.observerLocator.getObserver(currentSubject, currentPath);
_this.observers.push(observer);
var subscription = observer.subscribe(function (newValue, oldValue) {
subscription = observer.subscribe(function (newValue, oldValue) {
_this.observeParts(observer.propertyName);
});
observer.subscription = subscription;
}

var currentValue = observer.getValue();
currentValue = observer.getValue();
if (currentValue === undefined || currentValue === null) {
return 'break';
} else {
Expand Down Expand Up @@ -79,8 +83,8 @@ define(['exports', 'aurelia-binding'], function (exports, _aureliaBinding) {
};

PathObserver.prototype.getObserver = function getObserver() {
if (this.path.length == 1) {
var resolve = this.subject[this.path[0]];
if (this.path.length === 1) {
this.subject[this.path[0]];
return this.observerLocator.getObserver(this.subject, this.path[0]);
}
return this;
Expand All @@ -98,14 +102,17 @@ define(['exports', 'aurelia-binding'], function (exports, _aureliaBinding) {
break;
}
}

if (currentObserver.obj !== expectedSubject) {
this.observeParts(this.path[i - 1]);
break;
}
this.observeParts(this.path[i - 1]);
break;
}
expectedSubject = currentObserver.getValue();
}

if (this.observers.length !== this.path.length) return undefined;
if (this.observers.length !== this.path.length) {
return undefined;
}
var value = this.observers[this.observers.length - 1].getValue();
return value;
};
Expand All @@ -124,7 +131,9 @@ define(['exports', 'aurelia-binding'], function (exports, _aureliaBinding) {

PathObserver.prototype.unsubscribe = function unsubscribe() {
this.callbacks = [];
if (this.subscription) this.subscription();
if (this.subscription) {
this.subscription();
}
for (var i = this.observers.length - 1; i >= 0; i--) {
var observer = this.observers.pop();
if (observer && observer.subscription) {
Expand Down
28 changes: 14 additions & 14 deletions dist/amd/resources/bg-BG.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['exports', '../validation/utilities'], function (exports, _validationUtilities) {
define(['exports', '../utilities'], function (exports, _utilities) {
'use strict';

exports.__esModule = true;
Expand All @@ -22,10 +22,10 @@ define(['exports', '../validation/utilities'], function (exports, _validationUti
return 'трябва да съдържа само букви или интервали';
},
'BetweenLengthValidationRule': function BetweenLengthValidationRule(newValue, threshold) {
return 'броят на символите трябва да бъде между ' + _validationUtilities.Utilities.getValue(threshold.minimumLength) + ' и ' + _validationUtilities.Utilities.getValue(threshold.maximumLength);
return 'броят на символите трябва да бъде между ' + _utilities.Utilities.getValue(threshold.minimumLength) + ' и ' + _utilities.Utilities.getValue(threshold.maximumLength);
},
'BetweenValueValidationRule': function BetweenValueValidationRule(newValue, threshold) {
return 'стойността трябва да бъде между ' + _validationUtilities.Utilities.getValue(threshold.minimumValue) + ' и ' + _validationUtilities.Utilities.getValue(threshold.maximumValue);
return 'стойността трябва да бъде между ' + _utilities.Utilities.getValue(threshold.minimumValue) + ' и ' + _utilities.Utilities.getValue(threshold.maximumValue);
},
'CustomFunctionValidationRule': function CustomFunctionValidationRule(newValue, threshold) {
return 'невалидна стойност';
Expand All @@ -37,37 +37,37 @@ define(['exports', '../validation/utilities'], function (exports, _validationUti
return 'невалидна електронна поща';
},
'EqualityValidationRule': function EqualityValidationRule(newValue, threshold) {
return 'стойността трябва да бъде ' + _validationUtilities.Utilities.getValue(threshold.otherValue);
return 'стойността трябва да бъде ' + _utilities.Utilities.getValue(threshold.otherValue);
},
'InEqualityValidationRule': function InEqualityValidationRule(newValue, threshold) {
return 'стойността не може да бъде ' + _validationUtilities.Utilities.getValue(threshold.otherValue);
return 'стойността не може да бъде ' + _utilities.Utilities.getValue(threshold.otherValue);
},
'EqualityWithOtherLabelValidationRule': function EqualityWithOtherLabelValidationRule(newValue, threshold) {
return 'стойността не съвпада с ' + _validationUtilities.Utilities.getValue(threshold.otherValueLabel);
return 'стойността не съвпада с ' + _utilities.Utilities.getValue(threshold.otherValueLabel);
},
'InEqualityWithOtherLabelValidationRule': function InEqualityWithOtherLabelValidationRule(newValue, threshold) {
return 'стойността не може да съвпада с ' + _validationUtilities.Utilities.getValue(threshold.otherValueLabel);
return 'стойността не може да съвпада с ' + _utilities.Utilities.getValue(threshold.otherValueLabel);
},
'InCollectionValidationRule': function InCollectionValidationRule(newValue, threshold) {
return 'невалидна стойност';
},
'MinimumInclusiveValueValidationRule': function MinimumInclusiveValueValidationRule(newValue, threshold) {
return 'стойността трябва да бъде ' + _validationUtilities.Utilities.getValue(threshold) + ' или повече';
return 'стойността трябва да бъде ' + _utilities.Utilities.getValue(threshold) + ' или повече';
},
'MinimumLengthValidationRule': function MinimumLengthValidationRule(newValue, threshold) {
return 'броят на символите трябва да бъде поне ' + _validationUtilities.Utilities.getValue(threshold);
return 'броят на символите трябва да бъде поне ' + _utilities.Utilities.getValue(threshold);
},
'MinimumValueValidationRule': function MinimumValueValidationRule(newValue, threshold) {
return 'стойността трябва да бъде повече от ' + _validationUtilities.Utilities.getValue(threshold);
return 'стойността трябва да бъде повече от ' + _utilities.Utilities.getValue(threshold);
},
'MaximumInclusiveValueValidationRule': function MaximumInclusiveValueValidationRule(newValue, threshold) {
return 'стойността трябва да бъде ' + _validationUtilities.Utilities.getValue(threshold) + ' или по-малко';
return 'стойността трябва да бъде ' + _utilities.Utilities.getValue(threshold) + ' или по-малко';
},
'MaximumLengthValidationRule': function MaximumLengthValidationRule(newValue, threshold) {
return 'броят на символите не може да бъде повече от ' + _validationUtilities.Utilities.getValue(threshold);
return 'броят на символите не може да бъде повече от ' + _utilities.Utilities.getValue(threshold);
},
'MaximumValueValidationRule': function MaximumValueValidationRule(newValue, threshold) {
return 'стойността трябва да бъде по-малко от ' + _validationUtilities.Utilities.getValue(threshold);
return 'стойността трябва да бъде по-малко от ' + _utilities.Utilities.getValue(threshold);
},
'NumericValidationRule': function NumericValidationRule(newValue, threshold) {
return 'стойността на полето трябва да бъде число';
Expand All @@ -82,7 +82,7 @@ define(['exports', '../validation/utilities'], function (exports, _validationUti
return 'трябва да съдържа комбинация от малки и големи букви, цифри и специални знаци';
},
'MediumPasswordValidationRule': function MediumPasswordValidationRule(newValue, threshold) {
return 'трябва да съдържа поне ' + _validationUtilities.Utilities.getValue(threshold) + ' от следните групи: малки и големи букви, цифри и специални знаци';
return 'трябва да съдържа поне ' + _utilities.Utilities.getValue(threshold) + ' от следните групи: малки и големи букви, цифри и специални знаци';
}
}
};
Expand Down
Loading

0 comments on commit 8642558

Please sign in to comment.