diff --git a/bower.json b/bower.json index 27b55c66..a251a9d2 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-validation", - "version": "0.12.4", + "version": "0.12.5", "description": "Validation for Aurelia applications", "keywords": [ "aurelia", diff --git a/dist/amd/implementation/validation-parser.js b/dist/amd/implementation/validation-parser.js index 955b2fa1..82fc7d03 100644 --- a/dist/amd/implementation/validation-parser.js +++ b/dist/amd/implementation/validation-parser.js @@ -35,7 +35,7 @@ define(["require", "exports", 'aurelia-binding', 'aurelia-templating', './util', return expression; }; ValidationParser.prototype.getAccessorExpression = function (fn) { - var classic = /^function\s*\([$_\w\d]+\)\s*\{\s*return\s+[$_\w\d]+\.([$_\w\d]+)\s*;?\s*\}$/; + var classic = /^function\s*\([$_\w\d]+\)\s*\{\s*(?:"use strict";)?\s*return\s+[$_\w\d]+\.([$_\w\d]+)\s*;?\s*\}$/; var arrow = /^[$_\w\d]+\s*=>\s*[$_\w\d]+\.([$_\w\d]+)$/; var match = classic.exec(fn) || arrow.exec(fn); if (match === null) { diff --git a/dist/amd/validation-controller-factory.d.ts b/dist/amd/validation-controller-factory.d.ts index 94d3a93f..fcb37841 100644 --- a/dist/amd/validation-controller-factory.d.ts +++ b/dist/amd/validation-controller-factory.d.ts @@ -4,7 +4,7 @@ import { Container } from 'aurelia-dependency-injection'; */ export declare class ValidationControllerFactory { private container; - static inject: typeof Container[]; + static get(container: Container): ValidationControllerFactory; constructor(container: Container); /** * Creates a new controller and registers it in the current element's container so that it's diff --git a/dist/amd/validation-controller-factory.js b/dist/amd/validation-controller-factory.js index 158d5a00..cd9263d7 100644 --- a/dist/amd/validation-controller-factory.js +++ b/dist/amd/validation-controller-factory.js @@ -1,4 +1,4 @@ -define(["require", "exports", 'aurelia-dependency-injection', './validation-controller'], function (require, exports, aurelia_dependency_injection_1, validation_controller_1) { +define(["require", "exports", './validation-controller'], function (require, exports, validation_controller_1) { "use strict"; /** * Creates ValidationController instances. @@ -7,6 +7,9 @@ define(["require", "exports", 'aurelia-dependency-injection', './validation-cont function ValidationControllerFactory(container) { this.container = container; } + ValidationControllerFactory.get = function (container) { + return new ValidationControllerFactory(container); + }; /** * Creates a new controller and registers it in the current element's container so that it's * available to the validate binding behavior and renderers. @@ -23,8 +26,8 @@ define(["require", "exports", 'aurelia-dependency-injection', './validation-cont this.container.registerInstance(validation_controller_1.ValidationController, controller); return controller; }; - ValidationControllerFactory.inject = [aurelia_dependency_injection_1.Container]; return ValidationControllerFactory; }()); exports.ValidationControllerFactory = ValidationControllerFactory; + ValidationControllerFactory['protocol:aurelia:resolver'] = true; }); diff --git a/dist/commonjs/implementation/validation-parser.js b/dist/commonjs/implementation/validation-parser.js index d80608b4..b02edd02 100644 --- a/dist/commonjs/implementation/validation-parser.js +++ b/dist/commonjs/implementation/validation-parser.js @@ -38,7 +38,7 @@ var ValidationParser = (function () { return expression; }; ValidationParser.prototype.getAccessorExpression = function (fn) { - var classic = /^function\s*\([$_\w\d]+\)\s*\{\s*return\s+[$_\w\d]+\.([$_\w\d]+)\s*;?\s*\}$/; + var classic = /^function\s*\([$_\w\d]+\)\s*\{\s*(?:"use strict";)?\s*return\s+[$_\w\d]+\.([$_\w\d]+)\s*;?\s*\}$/; var arrow = /^[$_\w\d]+\s*=>\s*[$_\w\d]+\.([$_\w\d]+)$/; var match = classic.exec(fn) || arrow.exec(fn); if (match === null) { diff --git a/dist/commonjs/validation-controller-factory.d.ts b/dist/commonjs/validation-controller-factory.d.ts index 94d3a93f..fcb37841 100644 --- a/dist/commonjs/validation-controller-factory.d.ts +++ b/dist/commonjs/validation-controller-factory.d.ts @@ -4,7 +4,7 @@ import { Container } from 'aurelia-dependency-injection'; */ export declare class ValidationControllerFactory { private container; - static inject: typeof Container[]; + static get(container: Container): ValidationControllerFactory; constructor(container: Container); /** * Creates a new controller and registers it in the current element's container so that it's diff --git a/dist/commonjs/validation-controller-factory.js b/dist/commonjs/validation-controller-factory.js index f9913835..f20af392 100644 --- a/dist/commonjs/validation-controller-factory.js +++ b/dist/commonjs/validation-controller-factory.js @@ -1,5 +1,4 @@ "use strict"; -var aurelia_dependency_injection_1 = require('aurelia-dependency-injection'); var validation_controller_1 = require('./validation-controller'); /** * Creates ValidationController instances. @@ -8,6 +7,9 @@ var ValidationControllerFactory = (function () { function ValidationControllerFactory(container) { this.container = container; } + ValidationControllerFactory.get = function (container) { + return new ValidationControllerFactory(container); + }; /** * Creates a new controller and registers it in the current element's container so that it's * available to the validate binding behavior and renderers. @@ -24,7 +26,7 @@ var ValidationControllerFactory = (function () { this.container.registerInstance(validation_controller_1.ValidationController, controller); return controller; }; - ValidationControllerFactory.inject = [aurelia_dependency_injection_1.Container]; return ValidationControllerFactory; }()); exports.ValidationControllerFactory = ValidationControllerFactory; +ValidationControllerFactory['protocol:aurelia:resolver'] = true; diff --git a/dist/es2015/implementation/validation-parser.js b/dist/es2015/implementation/validation-parser.js index b52934da..a693e726 100644 --- a/dist/es2015/implementation/validation-parser.js +++ b/dist/es2015/implementation/validation-parser.js @@ -32,7 +32,7 @@ export class ValidationParser { return expression; } getAccessorExpression(fn) { - const classic = /^function\s*\([$_\w\d]+\)\s*\{\s*return\s+[$_\w\d]+\.([$_\w\d]+)\s*;?\s*\}$/; + const classic = /^function\s*\([$_\w\d]+\)\s*\{\s*(?:"use strict";)?\s*return\s+[$_\w\d]+\.([$_\w\d]+)\s*;?\s*\}$/; const arrow = /^[$_\w\d]+\s*=>\s*[$_\w\d]+\.([$_\w\d]+)$/; const match = classic.exec(fn) || arrow.exec(fn); if (match === null) { diff --git a/dist/es2015/validation-controller-factory.d.ts b/dist/es2015/validation-controller-factory.d.ts index 94d3a93f..fcb37841 100644 --- a/dist/es2015/validation-controller-factory.d.ts +++ b/dist/es2015/validation-controller-factory.d.ts @@ -4,7 +4,7 @@ import { Container } from 'aurelia-dependency-injection'; */ export declare class ValidationControllerFactory { private container; - static inject: typeof Container[]; + static get(container: Container): ValidationControllerFactory; constructor(container: Container); /** * Creates a new controller and registers it in the current element's container so that it's diff --git a/dist/es2015/validation-controller-factory.js b/dist/es2015/validation-controller-factory.js index 5c3b7f85..1380c159 100644 --- a/dist/es2015/validation-controller-factory.js +++ b/dist/es2015/validation-controller-factory.js @@ -1,4 +1,3 @@ -import { Container } from 'aurelia-dependency-injection'; import { ValidationController } from './validation-controller'; /** * Creates ValidationController instances. @@ -7,6 +6,9 @@ export class ValidationControllerFactory { constructor(container) { this.container = container; } + static get(container) { + return new ValidationControllerFactory(container); + } /** * Creates a new controller and registers it in the current element's container so that it's * available to the validate binding behavior and renderers. @@ -24,4 +26,4 @@ export class ValidationControllerFactory { return controller; } } -ValidationControllerFactory.inject = [Container]; +ValidationControllerFactory['protocol:aurelia:resolver'] = true; diff --git a/dist/native-modules/implementation/validation-parser.js b/dist/native-modules/implementation/validation-parser.js index 94ef5ca4..d74994c1 100644 --- a/dist/native-modules/implementation/validation-parser.js +++ b/dist/native-modules/implementation/validation-parser.js @@ -37,7 +37,7 @@ export var ValidationParser = (function () { return expression; }; ValidationParser.prototype.getAccessorExpression = function (fn) { - var classic = /^function\s*\([$_\w\d]+\)\s*\{\s*return\s+[$_\w\d]+\.([$_\w\d]+)\s*;?\s*\}$/; + var classic = /^function\s*\([$_\w\d]+\)\s*\{\s*(?:"use strict";)?\s*return\s+[$_\w\d]+\.([$_\w\d]+)\s*;?\s*\}$/; var arrow = /^[$_\w\d]+\s*=>\s*[$_\w\d]+\.([$_\w\d]+)$/; var match = classic.exec(fn) || arrow.exec(fn); if (match === null) { diff --git a/dist/native-modules/validation-controller-factory.d.ts b/dist/native-modules/validation-controller-factory.d.ts index 94d3a93f..fcb37841 100644 --- a/dist/native-modules/validation-controller-factory.d.ts +++ b/dist/native-modules/validation-controller-factory.d.ts @@ -4,7 +4,7 @@ import { Container } from 'aurelia-dependency-injection'; */ export declare class ValidationControllerFactory { private container; - static inject: typeof Container[]; + static get(container: Container): ValidationControllerFactory; constructor(container: Container); /** * Creates a new controller and registers it in the current element's container so that it's diff --git a/dist/native-modules/validation-controller-factory.js b/dist/native-modules/validation-controller-factory.js index 394db2dd..a1a55b44 100644 --- a/dist/native-modules/validation-controller-factory.js +++ b/dist/native-modules/validation-controller-factory.js @@ -1,4 +1,3 @@ -import { Container } from 'aurelia-dependency-injection'; import { ValidationController } from './validation-controller'; /** * Creates ValidationController instances. @@ -7,6 +6,9 @@ export var ValidationControllerFactory = (function () { function ValidationControllerFactory(container) { this.container = container; } + ValidationControllerFactory.get = function (container) { + return new ValidationControllerFactory(container); + }; /** * Creates a new controller and registers it in the current element's container so that it's * available to the validate binding behavior and renderers. @@ -23,6 +25,6 @@ export var ValidationControllerFactory = (function () { this.container.registerInstance(ValidationController, controller); return controller; }; - ValidationControllerFactory.inject = [Container]; return ValidationControllerFactory; }()); +ValidationControllerFactory['protocol:aurelia:resolver'] = true; diff --git a/dist/system/implementation/validation-parser.js b/dist/system/implementation/validation-parser.js index c1adcb82..730bfd46 100644 --- a/dist/system/implementation/validation-parser.js +++ b/dist/system/implementation/validation-parser.js @@ -53,7 +53,7 @@ System.register(['aurelia-binding', 'aurelia-templating', './util', 'aurelia-log return expression; }; ValidationParser.prototype.getAccessorExpression = function (fn) { - var classic = /^function\s*\([$_\w\d]+\)\s*\{\s*return\s+[$_\w\d]+\.([$_\w\d]+)\s*;?\s*\}$/; + var classic = /^function\s*\([$_\w\d]+\)\s*\{\s*(?:"use strict";)?\s*return\s+[$_\w\d]+\.([$_\w\d]+)\s*;?\s*\}$/; var arrow = /^[$_\w\d]+\s*=>\s*[$_\w\d]+\.([$_\w\d]+)$/; var match = classic.exec(fn) || arrow.exec(fn); if (match === null) { diff --git a/dist/system/validation-controller-factory.d.ts b/dist/system/validation-controller-factory.d.ts index 94d3a93f..fcb37841 100644 --- a/dist/system/validation-controller-factory.d.ts +++ b/dist/system/validation-controller-factory.d.ts @@ -4,7 +4,7 @@ import { Container } from 'aurelia-dependency-injection'; */ export declare class ValidationControllerFactory { private container; - static inject: typeof Container[]; + static get(container: Container): ValidationControllerFactory; constructor(container: Container); /** * Creates a new controller and registers it in the current element's container so that it's diff --git a/dist/system/validation-controller-factory.js b/dist/system/validation-controller-factory.js index 05bf71ef..0e20863c 100644 --- a/dist/system/validation-controller-factory.js +++ b/dist/system/validation-controller-factory.js @@ -1,13 +1,10 @@ -System.register(['aurelia-dependency-injection', './validation-controller'], function(exports_1, context_1) { +System.register(['./validation-controller'], function(exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; - var aurelia_dependency_injection_1, validation_controller_1; + var validation_controller_1; var ValidationControllerFactory; return { setters:[ - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - }, function (validation_controller_1_1) { validation_controller_1 = validation_controller_1_1; }], @@ -19,6 +16,9 @@ System.register(['aurelia-dependency-injection', './validation-controller'], fun function ValidationControllerFactory(container) { this.container = container; } + ValidationControllerFactory.get = function (container) { + return new ValidationControllerFactory(container); + }; /** * Creates a new controller and registers it in the current element's container so that it's * available to the validate binding behavior and renderers. @@ -35,10 +35,10 @@ System.register(['aurelia-dependency-injection', './validation-controller'], fun this.container.registerInstance(validation_controller_1.ValidationController, controller); return controller; }; - ValidationControllerFactory.inject = [aurelia_dependency_injection_1.Container]; return ValidationControllerFactory; }()); exports_1("ValidationControllerFactory", ValidationControllerFactory); + ValidationControllerFactory['protocol:aurelia:resolver'] = true; } } }); diff --git a/package.json b/package.json index 12461ffd..518060d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-validation", - "version": "0.12.4", + "version": "0.12.5", "description": "Validation for Aurelia applications", "keywords": [ "aurelia",