Skip to content

Commit

Permalink
chore(all): update build
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jun 22, 2016
1 parent c0ec3bc commit a480df2
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 199 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "./node_modules/aurelia-tools/.eslintrc.json",
"rules": {
"no-unused-vars": 0
"no-unused-vars": 0,
"no-cond-assign": 0
}
}
2 changes: 1 addition & 1 deletion dist/amd/validate-binding-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-task-queue', './vali
break;
}
}
return controller.view.firstChild.parentElement;
return controller.view.firstChild.parentNode;
};

ValidateBindingBehavior.prototype.bind = function bind(binding, source, rules) {
Expand Down
35 changes: 7 additions & 28 deletions dist/amd/validation-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,35 +138,14 @@ define(['exports', 'aurelia-dependency-injection', './validator', './validate-tr
};

ValidationController.prototype._updateErrors = function _updateErrors(errors, newErrors, target) {
var _this = this;

var i = 0;

var _loop = function _loop() {
var error = errors[i];
var index = newErrors.findIndex(function (x) {
return x.rule === error.rule;
});
if (index === -1) {
errors.splice(i, 1);
_this._unrenderError(error, target);
return 'continue';
}
newErrors.splice(index, 1);
i++;
};

while (i < errors.length) {
var _ret = _loop();

if (_ret === 'continue') continue;
var error = void 0;
while (error = errors.pop()) {
this._unrenderError(error, target);
}
i = 0;
while (i < newErrors.length) {
var _error = newErrors[i];
errors.push(_error);
this._renderError(_error, target);
i++;
for (var i = 0, ii = newErrors.length; i < ii; i++) {
error = newErrors[i];
errors.push(error);
this._renderError(error, target);
}
};

Expand Down
26 changes: 7 additions & 19 deletions dist/aurelia-validation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,28 +104,16 @@ export declare class ValidationController {
* Resets all renderers (clears all the validation errors).
*/
reset(): any;
_renderError(error?: any, target?: any): any;
_unrenderError(error?: any, target?: any): any;

/*
* Reconciles a binding's existing errors array with the new errors array.
* Renders errors related to newly broken rules. Unrenders errors related to
* rules that are no longer broken.
*/
_updateErrors(errors?: any, newErrors?: any, target?: any): any;

/**
* Validates and renders errors for a particular binding.
*/
_validateBinding(binding?: any): any;

/**
* Resets and unrenders errors for a particular binding.
*/
_resetBinding(binding?: any): any;
}
export declare class ValidateBindingBehavior {
constructor(taskQueue?: any);

/**
* Gets the DOM element associated with the data-binding. Most of the time it's
* the binding.target but sometimes binding.target is an aurelia custom element,
* which is a javascript "class" instance, so we need to use the controller to
* locate the actual DOM element.
*/
getTarget(binding?: any, view?: any): any;
bind(binding?: any, source?: any, rules?: any): any;
unbind(binding?: any, source?: any): any;
Expand Down
28 changes: 12 additions & 16 deletions dist/aurelia-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,24 +221,14 @@ export class ValidationController {
* rules that are no longer broken.
*/
_updateErrors(errors, newErrors, target) {
let i = 0;
while (i < errors.length) {
const error = errors[i];
const index = newErrors.findIndex(x => x.rule === error.rule);
if (index === -1) {
errors.splice(i, 1);
this._unrenderError(error, target);
continue;
}
newErrors.splice(index, 1);
i++;
let error;
while (error = errors.pop()) {
this._unrenderError(error, target);
}
i = 0;
while (i < newErrors.length) {
const error = newErrors[i];
for (let i = 0, ii = newErrors.length; i < ii; i++) {
error = newErrors[i];
errors.push(error);
this._renderError(error, target);
i++;
}
}

Expand Down Expand Up @@ -268,6 +258,12 @@ export class ValidateBindingBehavior {
this.taskQueue = taskQueue;
}

/**
* Gets the DOM element associated with the data-binding. Most of the time it's
* the binding.target but sometimes binding.target is an aurelia custom element,
* which is a javascript "class" instance, so we need to use the controller to
* locate the actual DOM element.
*/
getTarget(binding, view) {
const target = binding.target;
if (target instanceof Element) {
Expand All @@ -280,7 +276,7 @@ export class ValidateBindingBehavior {
break;
}
}
return controller.view.firstChild.parentElement;
return controller.view.firstChild.parentNode;
}

bind(binding, source, rules) {
Expand Down
2 changes: 1 addition & 1 deletion dist/commonjs/validate-binding-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var ValidateBindingBehavior = exports.ValidateBindingBehavior = (_dec = (0, _aur
break;
}
}
return controller.view.firstChild.parentElement;
return controller.view.firstChild.parentNode;
};

ValidateBindingBehavior.prototype.bind = function bind(binding, source, rules) {
Expand Down
35 changes: 7 additions & 28 deletions dist/commonjs/validation-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,35 +145,14 @@ var ValidationController = exports.ValidationController = (_dec = (0, _aureliaDe
};

ValidationController.prototype._updateErrors = function _updateErrors(errors, newErrors, target) {
var _this = this;

var i = 0;

var _loop = function _loop() {
var error = errors[i];
var index = newErrors.findIndex(function (x) {
return x.rule === error.rule;
});
if (index === -1) {
errors.splice(i, 1);
_this._unrenderError(error, target);
return 'continue';
}
newErrors.splice(index, 1);
i++;
};

while (i < errors.length) {
var _ret = _loop();

if (_ret === 'continue') continue;
var error = void 0;
while (error = errors.pop()) {
this._unrenderError(error, target);
}
i = 0;
while (i < newErrors.length) {
var _error = newErrors[i];
errors.push(_error);
this._renderError(_error, target);
i++;
for (var i = 0, ii = newErrors.length; i < ii; i++) {
error = newErrors[i];
errors.push(error);
this._renderError(error, target);
}
};

Expand Down
2 changes: 1 addition & 1 deletion dist/es2015/validate-binding-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export let ValidateBindingBehavior = (_dec = inject(TaskQueue), _dec(_class = cl
break;
}
}
return controller.view.firstChild.parentElement;
return controller.view.firstChild.parentNode;
}

bind(binding, source, rules) {
Expand Down
20 changes: 5 additions & 15 deletions dist/es2015/validation-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,14 @@ export let ValidationController = (_dec = inject(Validator), _dec(_class = class
}

_updateErrors(errors, newErrors, target) {
let i = 0;
while (i < errors.length) {
const error = errors[i];
const index = newErrors.findIndex(x => x.rule === error.rule);
if (index === -1) {
errors.splice(i, 1);
this._unrenderError(error, target);
continue;
}
newErrors.splice(index, 1);
i++;
let error;
while (error = errors.pop()) {
this._unrenderError(error, target);
}
i = 0;
while (i < newErrors.length) {
const error = newErrors[i];
for (let i = 0, ii = newErrors.length; i < ii; i++) {
error = newErrors[i];
errors.push(error);
this._renderError(error, target);
i++;
}
}

Expand Down
2 changes: 1 addition & 1 deletion dist/native-modules/validate-binding-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export var ValidateBindingBehavior = (_dec = inject(TaskQueue), _dec(_class = fu
break;
}
}
return controller.view.firstChild.parentElement;
return controller.view.firstChild.parentNode;
};

ValidateBindingBehavior.prototype.bind = function bind(binding, source, rules) {
Expand Down
35 changes: 7 additions & 28 deletions dist/native-modules/validation-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,35 +135,14 @@ export var ValidationController = (_dec = inject(Validator), _dec(_class = funct
};

ValidationController.prototype._updateErrors = function _updateErrors(errors, newErrors, target) {
var _this = this;

var i = 0;

var _loop = function _loop() {
var error = errors[i];
var index = newErrors.findIndex(function (x) {
return x.rule === error.rule;
});
if (index === -1) {
errors.splice(i, 1);
_this._unrenderError(error, target);
return 'continue';
}
newErrors.splice(index, 1);
i++;
};

while (i < errors.length) {
var _ret = _loop();

if (_ret === 'continue') continue;
var error = void 0;
while (error = errors.pop()) {
this._unrenderError(error, target);
}
i = 0;
while (i < newErrors.length) {
var _error = newErrors[i];
errors.push(_error);
this._renderError(_error, target);
i++;
for (var i = 0, ii = newErrors.length; i < ii; i++) {
error = newErrors[i];
errors.push(error);
this._renderError(error, target);
}
};

Expand Down
2 changes: 1 addition & 1 deletion dist/system/validate-binding-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ System.register(['aurelia-dependency-injection', 'aurelia-task-queue', './valida
break;
}
}
return controller.view.firstChild.parentElement;
return controller.view.firstChild.parentNode;
};

ValidateBindingBehavior.prototype.bind = function bind(binding, source, rules) {
Expand Down
35 changes: 7 additions & 28 deletions dist/system/validation-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,35 +146,14 @@ System.register(['aurelia-dependency-injection', './validator', './validate-trig
};

ValidationController.prototype._updateErrors = function _updateErrors(errors, newErrors, target) {
var _this = this;

var i = 0;

var _loop = function _loop() {
var error = errors[i];
var index = newErrors.findIndex(function (x) {
return x.rule === error.rule;
});
if (index === -1) {
errors.splice(i, 1);
_this._unrenderError(error, target);
return 'continue';
}
newErrors.splice(index, 1);
i++;
};

while (i < errors.length) {
var _ret = _loop();

if (_ret === 'continue') continue;
var error = void 0;
while (error = errors.pop()) {
this._unrenderError(error, target);
}
i = 0;
while (i < newErrors.length) {
var _error = newErrors[i];
errors.push(_error);
this._renderError(_error, target);
i++;
for (var i = 0, ii = newErrors.length; i < ii; i++) {
error = newErrors[i];
errors.push(error);
this._renderError(error, target);
}
};

Expand Down
Loading

0 comments on commit a480df2

Please sign in to comment.