Skip to content

Commit

Permalink
chore(all): prepare release 0.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Aug 27, 2016
1 parent 88925cb commit 1120e8e
Show file tree
Hide file tree
Showing 53 changed files with 421 additions and 103 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.12.0",
"version": "0.12.1",
"description": "Validation for Aurelia applications",
"keywords": [
"aurelia",
Expand Down
2 changes: 1 addition & 1 deletion dist/amd/aurelia-validation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export * from './validation-errors-custom-attribute';
export * from './validation-renderer-custom-attribute';
export * from './validation-renderer';
export * from './validator';
export * from './implementation/metadata-key';
export * from './implementation/rule';
export * from './implementation/rules';
export * from './implementation/standard-validator';
export * from './implementation/validation-messages';
export * from './implementation/validation-parser';
Expand Down
4 changes: 2 additions & 2 deletions dist/amd/aurelia-validation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Exports
define(["require", "exports", './validate-binding-behavior', './validate-trigger', './validation-controller', './validation-controller-factory', './validation-error', './validation-errors-custom-attribute', './validation-renderer-custom-attribute', './validator', './implementation/metadata-key', './implementation/standard-validator', './implementation/validation-messages', './implementation/validation-parser', './implementation/validation-rules', './validator', './implementation/standard-validator', './implementation/validation-parser', './implementation/validation-rules'], function (require, exports, validate_binding_behavior_1, validate_trigger_1, validation_controller_1, validation_controller_factory_1, validation_error_1, validation_errors_custom_attribute_1, validation_renderer_custom_attribute_1, validator_1, metadata_key_1, standard_validator_1, validation_messages_1, validation_parser_1, validation_rules_1, validator_2, standard_validator_2, validation_parser_2, validation_rules_2) {
define(["require", "exports", './validate-binding-behavior', './validate-trigger', './validation-controller', './validation-controller-factory', './validation-error', './validation-errors-custom-attribute', './validation-renderer-custom-attribute', './validator', './implementation/rules', './implementation/standard-validator', './implementation/validation-messages', './implementation/validation-parser', './implementation/validation-rules', './validator', './implementation/standard-validator', './implementation/validation-parser', './implementation/validation-rules'], function (require, exports, validate_binding_behavior_1, validate_trigger_1, validation_controller_1, validation_controller_factory_1, validation_error_1, validation_errors_custom_attribute_1, validation_renderer_custom_attribute_1, validator_1, rules_1, standard_validator_1, validation_messages_1, validation_parser_1, validation_rules_1, validator_2, standard_validator_2, validation_parser_2, validation_rules_2) {
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
Expand All @@ -12,7 +12,7 @@ define(["require", "exports", './validate-binding-behavior', './validate-trigger
__export(validation_errors_custom_attribute_1);
__export(validation_renderer_custom_attribute_1);
__export(validator_1);
__export(metadata_key_1);
__export(rules_1);
__export(standard_validator_1);
__export(validation_messages_1);
__export(validation_parser_1);
Expand Down
1 change: 0 additions & 1 deletion dist/amd/implementation/metadata-key.d.ts

This file was deleted.

4 changes: 0 additions & 4 deletions dist/amd/implementation/metadata-key.js

This file was deleted.

22 changes: 22 additions & 0 deletions dist/amd/implementation/rules.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Rule } from './rule';
/**
* Sets, unsets and retrieves rules on an object or constructor function.
*/
export declare class Rules {
/**
* The name of the property that stores the rules.
*/
static key: string;
/**
* Applies the rules to a target.
*/
static set(target: any, rules: Rule<any, any>[]): void;
/**
* Removes rules from a target.
*/
static unset(target: any): void;
/**
* Retrieves the target's rules.
*/
static get(target: any): Rule<any, any>[] | null;
}
40 changes: 40 additions & 0 deletions dist/amd/implementation/rules.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
define(["require", "exports"], function (require, exports) {
"use strict";
/**
* Sets, unsets and retrieves rules on an object or constructor function.
*/
var Rules = (function () {
function Rules() {
}
/**
* Applies the rules to a target.
*/
Rules.set = function (target, rules) {
if (target instanceof Function) {
target = target.prototype;
}
Object.defineProperty(target, Rules.key, { enumerable: false, configurable: false, writable: true, value: rules });
};
/**
* Removes rules from a target.
*/
Rules.unset = function (target) {
if (target instanceof Function) {
target = target.prototype;
}
target[Rules.key] = null;
};
/**
* Retrieves the target's rules.
*/
Rules.get = function (target) {
return target[Rules.key] || null;
};
/**
* The name of the property that stores the rules.
*/
Rules.key = '__rules__';
return Rules;
}());
exports.Rules = Rules;
});
6 changes: 3 additions & 3 deletions dist/amd/implementation/standard-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var __extends = (this && this.__extends) || function (d, b) {
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
define(["require", "exports", 'aurelia-templating', 'aurelia-metadata', '../validator', '../validation-error', './metadata-key', './validation-messages'], function (require, exports, aurelia_templating_1, aurelia_metadata_1, validator_1, validation_error_1, metadata_key_1, validation_messages_1) {
define(["require", "exports", 'aurelia-templating', '../validator', '../validation-error', './rules', './validation-messages'], function (require, exports, aurelia_templating_1, validator_1, validation_error_1, rules_1, validation_messages_1) {
"use strict";
/**
* Validates.
Expand Down Expand Up @@ -36,8 +36,8 @@ define(["require", "exports", 'aurelia-templating', 'aurelia-metadata', '../vali
var errors = [];
// rules specified?
if (!rules) {
// no. locate the rules via metadata.
rules = aurelia_metadata_1.metadata.get(metadata_key_1.metadataKey, object);
// no. locate the rules via metadata.
rules = rules_1.Rules.get(object);
}
// any rules?
if (!rules) {
Expand Down
3 changes: 2 additions & 1 deletion dist/amd/implementation/validation-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ define(["require", "exports", 'aurelia-binding', 'aurelia-templating', './util']
else {
accessor = this.getAccessorExpression(property);
}
if (accessor instanceof aurelia_binding_1.AccessMember && accessor.object instanceof aurelia_binding_1.AccessScope) {
if (accessor instanceof aurelia_binding_1.AccessScope
|| accessor instanceof aurelia_binding_1.AccessMember && accessor.object instanceof aurelia_binding_1.AccessScope) {
return {
name: accessor.name,
displayName: null
Expand Down
5 changes: 5 additions & 0 deletions dist/amd/implementation/validation-rules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,9 @@ export declare class ValidationRules {
* @param tag The tag to search for.
*/
static taggedRules(rules: Rule<any, any>[], tag: string): Rule<any, any>[];
/**
* Removes the rules from a class or object.
* @param target A class or object.
*/
static off(target: any): void;
}
14 changes: 9 additions & 5 deletions dist/amd/implementation/validation-rules.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(["require", "exports", 'aurelia-metadata', './util', './metadata-key', './validation-messages'], function (require, exports, aurelia_metadata_1, util_1, metadata_key_1, validation_messages_1) {
define(["require", "exports", './util', './rules', './validation-messages'], function (require, exports, util_1, rules_1, validation_messages_1) {
"use strict";
/**
* Part of the fluent rule API. Enables customizing property rules.
Expand Down Expand Up @@ -303,10 +303,7 @@ define(["require", "exports", 'aurelia-metadata', './util', './metadata-key', '.
* @param target A class or object.
*/
FluentEnsure.prototype.on = function (target) {
if (target instanceof Function) {
target = target.prototype;
}
aurelia_metadata_1.metadata.define(metadata_key_1.metadataKey, this.rules, target);
rules_1.Rules.set(target, this.rules);
return this;
};
FluentEnsure.prototype.assertInitialized = function () {
Expand Down Expand Up @@ -359,6 +356,13 @@ define(["require", "exports", 'aurelia-metadata', './util', './metadata-key', '.
ValidationRules.taggedRules = function (rules, tag) {
return rules.filter(function (r) { return r.tag === tag; });
};
/**
* Removes the rules from a class or object.
* @param target A class or object.
*/
ValidationRules.off = function (target) {
rules_1.Rules.unset(target);
};
return ValidationRules;
}());
exports.ValidationRules = ValidationRules;
Expand Down
2 changes: 1 addition & 1 deletion dist/commonjs/aurelia-validation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export * from './validation-errors-custom-attribute';
export * from './validation-renderer-custom-attribute';
export * from './validation-renderer';
export * from './validator';
export * from './implementation/metadata-key';
export * from './implementation/rule';
export * from './implementation/rules';
export * from './implementation/standard-validator';
export * from './implementation/validation-messages';
export * from './implementation/validation-parser';
Expand Down
2 changes: 1 addition & 1 deletion dist/commonjs/aurelia-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ __export(require('./validation-error'));
__export(require('./validation-errors-custom-attribute'));
__export(require('./validation-renderer-custom-attribute'));
__export(require('./validator'));
__export(require('./implementation/metadata-key'));
__export(require('./implementation/rules'));
__export(require('./implementation/standard-validator'));
__export(require('./implementation/validation-messages'));
__export(require('./implementation/validation-parser'));
Expand Down
1 change: 0 additions & 1 deletion dist/commonjs/implementation/metadata-key.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions dist/commonjs/implementation/metadata-key.js

This file was deleted.

22 changes: 22 additions & 0 deletions dist/commonjs/implementation/rules.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Rule } from './rule';
/**
* Sets, unsets and retrieves rules on an object or constructor function.
*/
export declare class Rules {
/**
* The name of the property that stores the rules.
*/
static key: string;
/**
* Applies the rules to a target.
*/
static set(target: any, rules: Rule<any, any>[]): void;
/**
* Removes rules from a target.
*/
static unset(target: any): void;
/**
* Retrieves the target's rules.
*/
static get(target: any): Rule<any, any>[] | null;
}
38 changes: 38 additions & 0 deletions dist/commonjs/implementation/rules.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"use strict";
/**
* Sets, unsets and retrieves rules on an object or constructor function.
*/
var Rules = (function () {
function Rules() {
}
/**
* Applies the rules to a target.
*/
Rules.set = function (target, rules) {
if (target instanceof Function) {
target = target.prototype;
}
Object.defineProperty(target, Rules.key, { enumerable: false, configurable: false, writable: true, value: rules });
};
/**
* Removes rules from a target.
*/
Rules.unset = function (target) {
if (target instanceof Function) {
target = target.prototype;
}
target[Rules.key] = null;
};
/**
* Retrieves the target's rules.
*/
Rules.get = function (target) {
return target[Rules.key] || null;
};
/**
* The name of the property that stores the rules.
*/
Rules.key = '__rules__';
return Rules;
}());
exports.Rules = Rules;
7 changes: 3 additions & 4 deletions dist/commonjs/implementation/standard-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ var __extends = (this && this.__extends) || function (d, b) {
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var aurelia_templating_1 = require('aurelia-templating');
var aurelia_metadata_1 = require('aurelia-metadata');
var validator_1 = require('../validator');
var validation_error_1 = require('../validation-error');
var metadata_key_1 = require('./metadata-key');
var rules_1 = require('./rules');
var validation_messages_1 = require('./validation-messages');
/**
* Validates.
Expand Down Expand Up @@ -41,8 +40,8 @@ var StandardValidator = (function (_super) {
var errors = [];
// rules specified?
if (!rules) {
// no. locate the rules via metadata.
rules = aurelia_metadata_1.metadata.get(metadata_key_1.metadataKey, object);
// no. locate the rules via metadata.
rules = rules_1.Rules.get(object);
}
// any rules?
if (!rules) {
Expand Down
3 changes: 2 additions & 1 deletion dist/commonjs/implementation/validation-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ var ValidationParser = (function () {
else {
accessor = this.getAccessorExpression(property);
}
if (accessor instanceof aurelia_binding_1.AccessMember && accessor.object instanceof aurelia_binding_1.AccessScope) {
if (accessor instanceof aurelia_binding_1.AccessScope
|| accessor instanceof aurelia_binding_1.AccessMember && accessor.object instanceof aurelia_binding_1.AccessScope) {
return {
name: accessor.name,
displayName: null
Expand Down
5 changes: 5 additions & 0 deletions dist/commonjs/implementation/validation-rules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,9 @@ export declare class ValidationRules {
* @param tag The tag to search for.
*/
static taggedRules(rules: Rule<any, any>[], tag: string): Rule<any, any>[];
/**
* Removes the rules from a class or object.
* @param target A class or object.
*/
static off(target: any): void;
}
15 changes: 9 additions & 6 deletions dist/commonjs/implementation/validation-rules.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use strict";
var aurelia_metadata_1 = require('aurelia-metadata');
var util_1 = require('./util');
var metadata_key_1 = require('./metadata-key');
var rules_1 = require('./rules');
var validation_messages_1 = require('./validation-messages');
/**
* Part of the fluent rule API. Enables customizing property rules.
Expand Down Expand Up @@ -306,10 +305,7 @@ var FluentEnsure = (function () {
* @param target A class or object.
*/
FluentEnsure.prototype.on = function (target) {
if (target instanceof Function) {
target = target.prototype;
}
aurelia_metadata_1.metadata.define(metadata_key_1.metadataKey, this.rules, target);
rules_1.Rules.set(target, this.rules);
return this;
};
FluentEnsure.prototype.assertInitialized = function () {
Expand Down Expand Up @@ -362,6 +358,13 @@ var ValidationRules = (function () {
ValidationRules.taggedRules = function (rules, tag) {
return rules.filter(function (r) { return r.tag === tag; });
};
/**
* Removes the rules from a class or object.
* @param target A class or object.
*/
ValidationRules.off = function (target) {
rules_1.Rules.unset(target);
};
return ValidationRules;
}());
exports.ValidationRules = ValidationRules;
2 changes: 1 addition & 1 deletion dist/es2015/aurelia-validation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export * from './validation-errors-custom-attribute';
export * from './validation-renderer-custom-attribute';
export * from './validation-renderer';
export * from './validator';
export * from './implementation/metadata-key';
export * from './implementation/rule';
export * from './implementation/rules';
export * from './implementation/standard-validator';
export * from './implementation/validation-messages';
export * from './implementation/validation-parser';
Expand Down
2 changes: 1 addition & 1 deletion dist/es2015/aurelia-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export * from './validation-errors-custom-attribute';
export * from './validation-renderer-custom-attribute';
export * from './validation-renderer';
export * from './validator';
export * from './implementation/metadata-key';
export * from './implementation/rule';
export * from './implementation/rules';
export * from './implementation/standard-validator';
export * from './implementation/validation-messages';
export * from './implementation/validation-parser';
Expand Down
1 change: 0 additions & 1 deletion dist/es2015/implementation/metadata-key.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/es2015/implementation/metadata-key.js

This file was deleted.

22 changes: 22 additions & 0 deletions dist/es2015/implementation/rules.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Rule } from './rule';
/**
* Sets, unsets and retrieves rules on an object or constructor function.
*/
export declare class Rules {
/**
* The name of the property that stores the rules.
*/
static key: string;
/**
* Applies the rules to a target.
*/
static set(target: any, rules: Rule<any, any>[]): void;
/**
* Removes rules from a target.
*/
static unset(target: any): void;
/**
* Retrieves the target's rules.
*/
static get(target: any): Rule<any, any>[] | null;
}
Loading

0 comments on commit 1120e8e

Please sign in to comment.