Skip to content

Commit

Permalink
chore(all): prepare release 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed May 17, 2016
1 parent adc0787 commit e79f936
Show file tree
Hide file tree
Showing 16 changed files with 122 additions and 127 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-validatejs",
"version": "0.3.0",
"version": "0.3.1",
"description": "This is a plugin that will allow using validate.js in your Aurelia application for expressive validation.",
"keywords": [
"aurelia",
Expand Down
14 changes: 7 additions & 7 deletions dist/amd/aurelia-validatejs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ declare module 'aurelia-validatejs' {
getProperties(): any;
ensure(prop: any): any;
length(configuration: any): any;
presence(): any;
required(): any;
numericality(): any;
date(): any;
datetime(): any;
email(): any;
presence(configuration: any): any;
required(configuration: any): any;
numericality(configuration: any): any;
date(configuration: any): any;
datetime(configuration: any): any;
email(configuration: any): any;
equality(configuration: any): any;
format(configuration: any): any;
inclusion(configuration: any): any;
exclusion(configuration: any): any;
url(): any;
url(configuration: any): any;
}
export function base(targetOrConfig: any, key: any, descriptor: any, rule: any): any;
export function length(targetOrConfig: any, key: any, descriptor: any): any;
Expand Down
7 changes: 3 additions & 4 deletions dist/amd/validation-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@ define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) {
}

ValidationRenderer.prototype.renderErrors = function renderErrors(node, relevantErrors) {
this.unrenderErrors(node);
if (relevantErrors.length) {
node.parentElement.classList.add('has-error');
relevantErrors.forEach(function (error) {
if (node.parentElement.textContent.indexOf(error.message) === -1) {
var errorMessageHelper = _aureliaPal.DOM.createElement('span');
var errorMessageNode = _aureliaPal.DOM.createTextNode(error.message);
errorMessageHelper.appendChild(errorMessageNode);
errorMessageHelper.classList.add('help-block');
errorMessageHelper.classList.add('help-block', 'au-validation');
node.parentElement.appendChild(errorMessageHelper);
}
});
} else {
this.unrenderErrors(node);
}
};

Expand All @@ -40,7 +39,7 @@ define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) {
var children = node.parentElement.children;
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (child.classList.contains('help-block')) {
if (child.classList.contains('help-block') && child.classList.contains('au-validation')) {
deleteThese.push(child);
}
}
Expand Down
28 changes: 14 additions & 14 deletions dist/amd/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,33 @@ define(['exports', './metadata-key', './validation-config', './validation-engine
return this;
};

Validator.prototype.presence = function presence() {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.presence());
Validator.prototype.presence = function presence(configuration) {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.presence(configuration));
return this;
};

Validator.prototype.required = function required() {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.presence());
Validator.prototype.required = function required(configuration) {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.presence(configuration));
return this;
};

Validator.prototype.numericality = function numericality() {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.numericality());
Validator.prototype.numericality = function numericality(configuration) {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.numericality(configuration));
return this;
};

Validator.prototype.date = function date() {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.date());
Validator.prototype.date = function date(configuration) {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.date(configuration));
return this;
};

Validator.prototype.datetime = function datetime() {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.datetime());
Validator.prototype.datetime = function datetime(configuration) {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.datetime(configuration));
return this;
};

Validator.prototype.email = function email() {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.email());
Validator.prototype.email = function email(configuration) {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.email(configuration));
return this;
};

Expand All @@ -95,8 +95,8 @@ define(['exports', './metadata-key', './validation-config', './validation-engine
return this;
};

Validator.prototype.url = function url() {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.url());
Validator.prototype.url = function url(configuration) {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.url(configuration));
return this;
};

Expand Down
14 changes: 7 additions & 7 deletions dist/aurelia-validatejs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ declare module 'aurelia-validatejs' {
getProperties(): any;
ensure(prop: any): any;
length(configuration: any): any;
presence(): any;
required(): any;
numericality(): any;
date(): any;
datetime(): any;
email(): any;
presence(configuration: any): any;
required(configuration: any): any;
numericality(configuration: any): any;
date(configuration: any): any;
datetime(configuration: any): any;
email(configuration: any): any;
equality(configuration: any): any;
format(configuration: any): any;
inclusion(configuration: any): any;
exclusion(configuration: any): any;
url(): any;
url(configuration: any): any;
}
export function base(targetOrConfig: any, key: any, descriptor: any, rule: any): any;
export function length(targetOrConfig: any, key: any, descriptor: any): any;
Expand Down
35 changes: 17 additions & 18 deletions dist/aurelia-validatejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ import {metadata} from 'aurelia-metadata';

export class ValidationRenderer {
renderErrors(node, relevantErrors) {
this.unrenderErrors(node);
if (relevantErrors.length) {
node.parentElement.classList.add('has-error');
relevantErrors.forEach(error => {
if (node.parentElement.textContent.indexOf(error.message) === -1) {
let errorMessageHelper = DOM.createElement('span');
let errorMessageNode = DOM.createTextNode(error.message);
errorMessageHelper.appendChild(errorMessageNode);
errorMessageHelper.classList.add('help-block');
errorMessageHelper.classList.add('help-block', 'au-validation');
node.parentElement.appendChild(errorMessageHelper);
}
});
} else {
this.unrenderErrors(node);
}
}
unrenderErrors(node) {
Expand All @@ -26,7 +25,7 @@ export class ValidationRenderer {
let children = node.parentElement.children;
for (let i = 0; i < children.length; i++) {
let child = children[i];
if (child.classList.contains('help-block')) {
if (child.classList.contains('help-block') && child.classList.contains('au-validation')) {
deleteThese.push(child);
}
}
Expand Down Expand Up @@ -295,28 +294,28 @@ export class Validator {
this.config.addRule(this.currentProperty, ValidationRule.lengthRule(configuration));
return this;
}
presence() {
this.config.addRule(this.currentProperty, ValidationRule.presence());
presence(configuration) {
this.config.addRule(this.currentProperty, ValidationRule.presence(configuration));
return this;
}
required() {
this.config.addRule(this.currentProperty, ValidationRule.presence());
required(configuration) {
this.config.addRule(this.currentProperty, ValidationRule.presence(configuration));
return this;
}
numericality() {
this.config.addRule(this.currentProperty, ValidationRule.numericality());
numericality(configuration) {
this.config.addRule(this.currentProperty, ValidationRule.numericality(configuration));
return this;
}
date() {
this.config.addRule(this.currentProperty, ValidationRule.date());
date(configuration) {
this.config.addRule(this.currentProperty, ValidationRule.date(configuration));
return this;
}
datetime() {
this.config.addRule(this.currentProperty, ValidationRule.datetime());
datetime(configuration) {
this.config.addRule(this.currentProperty, ValidationRule.datetime(configuration));
return this;
}
email() {
this.config.addRule(this.currentProperty, ValidationRule.email());
email(configuration) {
this.config.addRule(this.currentProperty, ValidationRule.email(configuration));
return this;
}
equality(configuration) {
Expand All @@ -335,8 +334,8 @@ export class Validator {
this.config.addRule(this.currentProperty, ValidationRule.exclusion(configuration));
return this;
}
url() {
this.config.addRule(this.currentProperty, ValidationRule.url());
url(configuration) {
this.config.addRule(this.currentProperty, ValidationRule.url(configuration));
return this;
}
}
Expand Down
14 changes: 7 additions & 7 deletions dist/commonjs/aurelia-validatejs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ declare module 'aurelia-validatejs' {
getProperties(): any;
ensure(prop: any): any;
length(configuration: any): any;
presence(): any;
required(): any;
numericality(): any;
date(): any;
datetime(): any;
email(): any;
presence(configuration: any): any;
required(configuration: any): any;
numericality(configuration: any): any;
date(configuration: any): any;
datetime(configuration: any): any;
email(configuration: any): any;
equality(configuration: any): any;
format(configuration: any): any;
inclusion(configuration: any): any;
exclusion(configuration: any): any;
url(): any;
url(configuration: any): any;
}
export function base(targetOrConfig: any, key: any, descriptor: any, rule: any): any;
export function length(targetOrConfig: any, key: any, descriptor: any): any;
Expand Down
7 changes: 3 additions & 4 deletions dist/commonjs/validation-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@ var ValidationRenderer = exports.ValidationRenderer = function () {
}

ValidationRenderer.prototype.renderErrors = function renderErrors(node, relevantErrors) {
this.unrenderErrors(node);
if (relevantErrors.length) {
node.parentElement.classList.add('has-error');
relevantErrors.forEach(function (error) {
if (node.parentElement.textContent.indexOf(error.message) === -1) {
var errorMessageHelper = _aureliaPal.DOM.createElement('span');
var errorMessageNode = _aureliaPal.DOM.createTextNode(error.message);
errorMessageHelper.appendChild(errorMessageNode);
errorMessageHelper.classList.add('help-block');
errorMessageHelper.classList.add('help-block', 'au-validation');
node.parentElement.appendChild(errorMessageHelper);
}
});
} else {
this.unrenderErrors(node);
}
};

Expand All @@ -37,7 +36,7 @@ var ValidationRenderer = exports.ValidationRenderer = function () {
var children = node.parentElement.children;
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (child.classList.contains('help-block')) {
if (child.classList.contains('help-block') && child.classList.contains('au-validation')) {
deleteThese.push(child);
}
}
Expand Down
28 changes: 14 additions & 14 deletions dist/commonjs/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,33 @@ var Validator = exports.Validator = function () {
return this;
};

Validator.prototype.presence = function presence() {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.presence());
Validator.prototype.presence = function presence(configuration) {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.presence(configuration));
return this;
};

Validator.prototype.required = function required() {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.presence());
Validator.prototype.required = function required(configuration) {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.presence(configuration));
return this;
};

Validator.prototype.numericality = function numericality() {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.numericality());
Validator.prototype.numericality = function numericality(configuration) {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.numericality(configuration));
return this;
};

Validator.prototype.date = function date() {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.date());
Validator.prototype.date = function date(configuration) {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.date(configuration));
return this;
};

Validator.prototype.datetime = function datetime() {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.datetime());
Validator.prototype.datetime = function datetime(configuration) {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.datetime(configuration));
return this;
};

Validator.prototype.email = function email() {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.email());
Validator.prototype.email = function email(configuration) {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.email(configuration));
return this;
};

Expand All @@ -100,8 +100,8 @@ var Validator = exports.Validator = function () {
return this;
};

Validator.prototype.url = function url() {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.url());
Validator.prototype.url = function url(configuration) {
this.config.addRule(this.currentProperty, _validationRule.ValidationRule.url(configuration));
return this;
};

Expand Down
14 changes: 7 additions & 7 deletions dist/es2015/aurelia-validatejs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ declare module 'aurelia-validatejs' {
getProperties(): any;
ensure(prop: any): any;
length(configuration: any): any;
presence(): any;
required(): any;
numericality(): any;
date(): any;
datetime(): any;
email(): any;
presence(configuration: any): any;
required(configuration: any): any;
numericality(configuration: any): any;
date(configuration: any): any;
datetime(configuration: any): any;
email(configuration: any): any;
equality(configuration: any): any;
format(configuration: any): any;
inclusion(configuration: any): any;
exclusion(configuration: any): any;
url(): any;
url(configuration: any): any;
}
export function base(targetOrConfig: any, key: any, descriptor: any, rule: any): any;
export function length(targetOrConfig: any, key: any, descriptor: any): any;
Expand Down
7 changes: 3 additions & 4 deletions dist/es2015/validation-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@ import { DOM } from 'aurelia-pal';

export let ValidationRenderer = class ValidationRenderer {
renderErrors(node, relevantErrors) {
this.unrenderErrors(node);
if (relevantErrors.length) {
node.parentElement.classList.add('has-error');
relevantErrors.forEach(error => {
if (node.parentElement.textContent.indexOf(error.message) === -1) {
let errorMessageHelper = DOM.createElement('span');
let errorMessageNode = DOM.createTextNode(error.message);
errorMessageHelper.appendChild(errorMessageNode);
errorMessageHelper.classList.add('help-block');
errorMessageHelper.classList.add('help-block', 'au-validation');
node.parentElement.appendChild(errorMessageHelper);
}
});
} else {
this.unrenderErrors(node);
}
}
unrenderErrors(node) {
Expand All @@ -23,7 +22,7 @@ export let ValidationRenderer = class ValidationRenderer {
let children = node.parentElement.children;
for (let i = 0; i < children.length; i++) {
let child = children[i];
if (child.classList.contains('help-block')) {
if (child.classList.contains('help-block') && child.classList.contains('au-validation')) {
deleteThese.push(child);
}
}
Expand Down
Loading

0 comments on commit e79f936

Please sign in to comment.