Skip to content

Commit

Permalink
chore(doc): fixing doc task
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jun 14, 2016
1 parent fb30902 commit 3fe0528
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 62 deletions.
2 changes: 1 addition & 1 deletion dist/amd/validation-controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['exports', 'aurelia-dependency-injection', './validator', './validation-renderer', './validate-trigger', './property-info'], function (exports, _aureliaDependencyInjection, _validator, _validationRenderer, _validateTrigger, _propertyInfo) {
define(['exports', 'aurelia-dependency-injection', './validator', './validate-trigger', './property-info'], function (exports, _aureliaDependencyInjection, _validator, _validateTrigger, _propertyInfo) {
'use strict';

Object.defineProperty(exports, "__esModule", {
Expand Down
2 changes: 1 addition & 1 deletion dist/amd/validation-renderer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['exports', 'aurelia-metadata'], function (exports, _aureliaMetadata) {
define(['exports', 'aurelia-metadata', './validation-error'], function (exports, _aureliaMetadata, _validationError) {
'use strict';

Object.defineProperty(exports, "__esModule", {
Expand Down
24 changes: 14 additions & 10 deletions dist/aurelia-validation.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import {
protocol
} from 'aurelia-metadata';
import {
AccessMember,
AccessScope,
Expand All @@ -9,6 +6,9 @@ import {
ValueConverter,
bindingMode
} from 'aurelia-binding';
import {
protocol
} from 'aurelia-metadata';
import {
inject,
Optional,
Expand All @@ -20,11 +20,10 @@ import {
import {
customAttribute
} from 'aurelia-templating';

/**
* Decorator: Indicates that the decorated class/object is a validation-renderer.
*/
export declare const validationRenderer: Function;
export declare interface ValidationRenderer {
render(error: ValidationError, target: Element): void;
unrender(error: ValidationError, target: Element): void;
}
export declare class ValidationError {

/**
Expand Down Expand Up @@ -55,9 +54,14 @@ export declare class ValidationError {
*/
export declare const validateTrigger: any;
export declare function getPropertyInfo(expression?: any, source?: any): any;

/**
* Decorator: Indicates that the decorated class/object is a validation-renderer.
*/
export declare const validationRenderer: Function;
export declare class Validator {
validateProperty(object?: any, propertyName?: any, rules?: any): ValidationErrors[];
validateObject(object?: any, rules?: any): ValidationErrors[];
validateProperty(object?: any, propertyName?: any, rules?: any): ValidationError[];
validateObject(object?: any, rules?: any): ValidationError[];
}
export declare class ValidationController {
bindings: any;
Expand Down
41 changes: 23 additions & 18 deletions dist/aurelia-validation.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
import {protocol} from 'aurelia-metadata';
import {AccessMember,AccessScope,AccessKeyed,BindingBehavior,ValueConverter,bindingMode} from 'aurelia-binding';
import {protocol} from 'aurelia-metadata';
import {inject,Optional,Lazy} from 'aurelia-dependency-injection';
import {TaskQueue} from 'aurelia-task-queue';
import {customAttribute} from 'aurelia-templating';

/**
* Decorator: Indicates that the decorated class/object is a validation-renderer.
*/
export const validationRenderer: Function = protocol.create('aurelia:validation-renderer', function(target) {
if (!(typeof target.render === 'function')) {
return 'Validation renderers must implement: render(error: ValidationError, target: Element): void';
}

if (!(typeof target.unrender === 'function')) {
return 'Validation renderers must implement: unrender(error: ValidationError, target: Element): void';
}

return true;
});

export class ValidationError {
/**
* The rule associated with the error. Validator implementation specific.
Expand Down Expand Up @@ -108,12 +93,32 @@ export function getPropertyInfo(expression, source) {
return { object, property };
}

/**
* Decorator: Indicates that the decorated class/object is a validation-renderer.
*/
export const validationRenderer: Function = protocol.create('aurelia:validation-renderer', function(target) {
if (!(typeof target.render === 'function')) {
return 'Validation renderers must implement: render(error: ValidationError, target: Element): void';
}

if (!(typeof target.unrender === 'function')) {
return 'Validation renderers must implement: unrender(error: ValidationError, target: Element): void';
}

return true;
});

interface ValidationRenderer {
render(error: ValidationError, target: Element): void;
unrender(error: ValidationError, target: Element): void
}

export class Validator {
validateProperty(object, propertyName, rules = null): ValidationErrors[] {
validateProperty(object, propertyName, rules = null): ValidationError[] {
throw new Error('A Validator must implement validateProperty');
}

validateObject(object, rules = null): ValidationErrors[] {
validateObject(object, rules = null): ValidationError[] {
throw new Error('A Validator must implement validateObject');
}
}
Expand Down
2 changes: 0 additions & 2 deletions dist/commonjs/validation-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ var _aureliaDependencyInjection = require('aurelia-dependency-injection');

var _validator = require('./validator');

var _validationRenderer = require('./validation-renderer');

var _validateTrigger = require('./validate-trigger');

var _propertyInfo = require('./property-info');
Expand Down
2 changes: 2 additions & 0 deletions dist/commonjs/validation-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ exports.validationRenderer = undefined;

var _aureliaMetadata = require('aurelia-metadata');

var _validationError = require('./validation-error');

var validationRenderer = exports.validationRenderer = _aureliaMetadata.protocol.create('aurelia:validation-renderer', function (target) {
if (!(typeof target.render === 'function')) {
return 'Validation renderers must implement: render(error: ValidationError, target: Element): void';
Expand Down
1 change: 0 additions & 1 deletion dist/es2015/validation-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var _dec, _class;

import { inject } from 'aurelia-dependency-injection';
import { Validator } from './validator';
import { ValidationRenderer } from './validation-renderer';
import { validateTrigger } from './validate-trigger';
import { getPropertyInfo } from './property-info';

Expand Down
1 change: 1 addition & 0 deletions dist/es2015/validation-renderer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { protocol } from 'aurelia-metadata';
import { ValidationError } from './validation-error';

export const validationRenderer = protocol.create('aurelia:validation-renderer', function (target) {
if (!(typeof target.render === 'function')) {
Expand Down
1 change: 0 additions & 1 deletion dist/native-modules/validation-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var _dec, _class;

import { inject } from 'aurelia-dependency-injection';
import { Validator } from './validator';
import { ValidationRenderer } from './validation-renderer';
import { validateTrigger } from './validate-trigger';
import { getPropertyInfo } from './property-info';

Expand Down
1 change: 1 addition & 0 deletions dist/native-modules/validation-renderer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { protocol } from 'aurelia-metadata';
import { ValidationError } from './validation-error';

export var validationRenderer = protocol.create('aurelia:validation-renderer', function (target) {
if (!(typeof target.render === 'function')) {
Expand Down
6 changes: 2 additions & 4 deletions dist/system/validation-controller.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

System.register(['aurelia-dependency-injection', './validator', './validation-renderer', './validate-trigger', './property-info'], function (_export, _context) {
System.register(['aurelia-dependency-injection', './validator', './validate-trigger', './property-info'], function (_export, _context) {
"use strict";

var inject, Validator, ValidationRenderer, validateTrigger, getPropertyInfo, _dec, _class, ValidationController;
var inject, Validator, validateTrigger, getPropertyInfo, _dec, _class, ValidationController;



Expand All @@ -12,8 +12,6 @@ System.register(['aurelia-dependency-injection', './validator', './validation-re
inject = _aureliaDependencyInjection.inject;
}, function (_validator) {
Validator = _validator.Validator;
}, function (_validationRenderer) {
ValidationRenderer = _validationRenderer.ValidationRenderer;
}, function (_validateTrigger) {
validateTrigger = _validateTrigger.validateTrigger;
}, function (_propertyInfo) {
Expand Down
6 changes: 4 additions & 2 deletions dist/system/validation-renderer.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
'use strict';

System.register(['aurelia-metadata'], function (_export, _context) {
System.register(['aurelia-metadata', './validation-error'], function (_export, _context) {
"use strict";

var protocol, validationRenderer;
var protocol, ValidationError, validationRenderer;
return {
setters: [function (_aureliaMetadata) {
protocol = _aureliaMetadata.protocol;
}, function (_validationError) {
ValidationError = _validationError.ValidationError;
}],
execute: function () {
_export('validationRenderer', validationRenderer = protocol.create('aurelia:validation-renderer', function (target) {
Expand Down
38 changes: 19 additions & 19 deletions dist/temp/aurelia-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ValidationRendererCustomAttribute = exports.ValidationErrorsCustomAttribute = exports.ValidateBindingBehavior = exports.ValidationController = exports.Validator = exports.validateTrigger = exports.ValidationError = exports.validationRenderer = undefined;
exports.ValidationRendererCustomAttribute = exports.ValidationErrorsCustomAttribute = exports.ValidateBindingBehavior = exports.ValidationController = exports.Validator = exports.validationRenderer = exports.validateTrigger = exports.ValidationError = undefined;

var _dec, _class2, _dec2, _class4, _dec3, _dec4, _class5;

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };

exports.getPropertyInfo = getPropertyInfo;

var _aureliaMetadata = require('aurelia-metadata');

var _aureliaBinding = require('aurelia-binding');

var _aureliaMetadata = require('aurelia-metadata');

var _aureliaDependencyInjection = require('aurelia-dependency-injection');

var _aureliaTaskQueue = require('aurelia-task-queue');
Expand All @@ -23,18 +23,6 @@ var _aureliaTemplating = require('aurelia-templating');

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var validationRenderer = exports.validationRenderer = _aureliaMetadata.protocol.create('aurelia:validation-renderer', function (target) {
if (!(typeof target.render === 'function')) {
return 'Validation renderers must implement: render(error: ValidationError, target: Element): void';
}

if (!(typeof target.unrender === 'function')) {
return 'Validation renderers must implement: unrender(error: ValidationError, target: Element): void';
}

return true;
});

var ValidationError = exports.ValidationError = function ValidationError(rule, message, object) {
var propertyName = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3];

Expand Down Expand Up @@ -91,6 +79,18 @@ function getPropertyInfo(expression, source) {
return { object: object, property: property };
}

var validationRenderer = exports.validationRenderer = _aureliaMetadata.protocol.create('aurelia:validation-renderer', function (target) {
if (!(typeof target.render === 'function')) {
return 'Validation renderers must implement: render(error: ValidationError, target: Element): void';
}

if (!(typeof target.unrender === 'function')) {
return 'Validation renderers must implement: unrender(error: ValidationError, target: Element): void';
}

return true;
});

var Validator = exports.Validator = function () {
function Validator() {
_classCallCheck(this, Validator);
Expand Down Expand Up @@ -138,12 +138,12 @@ var ValidationController = exports.ValidationController = (_dec = (0, _aureliaDe
var _ref2 = _ref;
var binding = _ref2[0];
var _ref2$ = _ref2[1];
var target = _ref2$.target;
var _target = _ref2$.target;
var rules = _ref2$.rules;
var errors = _ref2$.errors;

for (var i = 0, ii = errors.length; i < ii; i++) {
renderer.render(errors[i], target);
renderer.render(errors[i], _target);
}
}
this.renderers.push(renderer);
Expand All @@ -165,12 +165,12 @@ var ValidationController = exports.ValidationController = (_dec = (0, _aureliaDe
var _ref4 = _ref3;
var binding = _ref4[0];
var _ref4$ = _ref4[1];
var target = _ref4$.target;
var _target2 = _ref4$.target;
var rules = _ref4$.rules;
var errors = _ref4$.errors;

for (var i = 0, ii = errors.length; i < ii; i++) {
renderer.unrender(errors[i], target);
renderer.unrender(errors[i], _target2);
}
}
this.renderers.splice(this.renderers.indexOf(renderer), 1);
Expand Down
1 change: 0 additions & 1 deletion src/validation-controller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {inject} from 'aurelia-dependency-injection';
import {Validator} from './validator';
import {ValidationRenderer} from './validation-renderer';
import {validateTrigger} from './validate-trigger';
import {getPropertyInfo} from './property-info';

Expand Down
6 changes: 6 additions & 0 deletions src/validation-renderer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {protocol} from 'aurelia-metadata';
import {ValidationError} from './validation-error';

/**
* Decorator: Indicates that the decorated class/object is a validation-renderer.
Expand All @@ -14,3 +15,8 @@ export const validationRenderer: Function = protocol.create('aurelia:validation-

return true;
});

interface ValidationRenderer {
render(error: ValidationError, target: Element): void;
unrender(error: ValidationError, target: Element): void
}
4 changes: 2 additions & 2 deletions src/validator.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {ValidationError} from './validation-error';

export class Validator {
validateProperty(object, propertyName, rules = null): ValidationErrors[] {
validateProperty(object, propertyName, rules = null): ValidationError[] {
throw new Error('A Validator must implement validateProperty');
}

validateObject(object, rules = null): ValidationErrors[] {
validateObject(object, rules = null): ValidationError[] {
throw new Error('A Validator must implement validateObject');
}
}

0 comments on commit 3fe0528

Please sign in to comment.