Skip to content
This repository has been archived by the owner on Dec 25, 2017. It is now read-only.

Commit

Permalink
release v2.0.0-alpha.19
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Feb 14, 2016
1 parent 681f2f0 commit 8d6fce8
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 37 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<a name="2.0.0-alpha.19"></a>
# [2.0.0-alpha.19](https://github.com/vuejs/vue-validator/compare/v2.0.0-alpha.18...v2.0.0-alpha.19) (2016-02-14)


### Features

* **messages:** change error messages feature ([681f2f0](https://github.com/vuejs/vue-validator/commit/681f2f0))
* **validator:** update warnning message ([c6495e0](https://github.com/vuejs/vue-validator/commit/c6495e0))


### BREAKING CHANGES

* messages: change `messages` to `errors`



<a name="2.0.0-alpha.18"></a>
# [2.0.0-alpha.18](https://github.com/vuejs/vue-validator/compare/v2.0.0-alpha.17...v2.0.0-alpha.18) (2016-02-03)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ You don't need to do this when using the standalone build, as it installs itself
## CDN
jsdelivr
```html
<script src="https://cdn.jsdelivr.net/vue.validator/2.0.0-alpha.18/vue-validator.min.js"></script>
<script src="https://cdn.jsdelivr.net/vue.validator/2.0.0-alpha.19/vue-validator.min.js"></script>
```


Expand Down
29 changes: 13 additions & 16 deletions dist/vue-validator.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-validator v2.0.0-alpha.18
* vue-validator v2.0.0-alpha.19
* (c) 2016 kazuya kawaguchi
* Released under the MIT License.
*/
Expand Down Expand Up @@ -683,7 +683,7 @@ var BaseValidation = function () {
var _ = exports$1.Vue.util;

var results = {};
var messages = {};
var errors = {};
var valid = true;

each(this._validators, function (descriptor, name) {
Expand Down Expand Up @@ -711,7 +711,7 @@ var BaseValidation = function () {
if (!ret) {
valid = false;
if (msg) {
messages[name] = typeof msg === 'function' ? msg.call(_this2._vm, _this2.field, descriptor.arg) : msg;
errors[name] = typeof msg === 'function' ? msg.call(_this2._vm, _this2.field, descriptor.arg) : msg;
}
}
results[name] = !ret;
Expand All @@ -729,8 +729,8 @@ var BaseValidation = function () {
pristine: !this.dirty,
modified: this.modified
};
if (!empty(messages)) {
props.messages = messages;
if (!empty(errors)) {
props.errors = errors;
}
_.extend(results, props);

Expand Down Expand Up @@ -1543,7 +1543,7 @@ var Validator$1 = function () {
modified: { fn: this._defineModified, arg: validationsGetter },
dirty: { fn: this._defineDirty, arg: validationsGetter },
pristine: { fn: this._definePristine, arg: targetGetter },
messages: { fn: this._defineMessages, arg: validationsGetter }
errors: { fn: this._defineErrors, arg: validationsGetter }
}, function (descriptor, name) {
Object.defineProperty(targetGetter(), name, {
enumerable: true,
Expand Down Expand Up @@ -1612,8 +1612,8 @@ var Validator$1 = function () {
return !scopeGetter().dirty;
}
}, {
key: '_defineMessages',
value: function _defineMessages(validationsGetter) {
key: '_defineErrors',
value: function _defineErrors(validationsGetter) {
var _this8 = this;

var extend = exports$1.Vue.util.extend;
Expand All @@ -1623,8 +1623,8 @@ var Validator$1 = function () {
each(validationsGetter(), function (validation, key) {
if (hasOwn(_this8._scope, validation.field)) {
var target = _this8._scope[validation.field];
if (target && !empty(target['messages'])) {
ret[validation.field] = extend({}, target['messages']);
if (target && !empty(target['errors'])) {
ret[validation.field] = extend({}, target['errors']);
}
}
}, this);
Expand Down Expand Up @@ -1664,16 +1664,13 @@ function Validator (Vue) {

bind: function bind() {
if (!this.params.name) {
// TODO: should be implemented validator:bind name params nothing error'
warn('TODO: should be implemented validator:bind name params nothing error');
warn('validator element directive need to specify \'name\' param attribute: ' + '(e.g. <validator name="validator1">...</validator>)');
return;
}

this.validatorName = '$' + camelize(this.params.name);
if (!this.vm._validatorMaps) {
// TODO: should be implemented error message'
warn('TODO: should be implemented error message');
return;
throw new Error('Invalid validator management error');
}

this.setupValidator();
Expand Down Expand Up @@ -1757,7 +1754,7 @@ function plugin(Vue) {
Validate(Vue);
}

plugin.version = '2.0.0-alpha.18';
plugin.version = '2.0.0-alpha.19';

if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(plugin);
Expand Down
29 changes: 13 additions & 16 deletions dist/vue-validator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-validator v2.0.0-alpha.18
* vue-validator v2.0.0-alpha.19
* (c) 2016 kazuya kawaguchi
* Released under the MIT License.
*/
Expand Down Expand Up @@ -687,7 +687,7 @@ var validators = Object.freeze({
var _ = exports$1.Vue.util;

var results = {};
var messages = {};
var errors = {};
var valid = true;

each(this._validators, function (descriptor, name) {
Expand Down Expand Up @@ -715,7 +715,7 @@ var validators = Object.freeze({
if (!ret) {
valid = false;
if (msg) {
messages[name] = typeof msg === 'function' ? msg.call(_this2._vm, _this2.field, descriptor.arg) : msg;
errors[name] = typeof msg === 'function' ? msg.call(_this2._vm, _this2.field, descriptor.arg) : msg;
}
}
results[name] = !ret;
Expand All @@ -733,8 +733,8 @@ var validators = Object.freeze({
pristine: !this.dirty,
modified: this.modified
};
if (!empty(messages)) {
props.messages = messages;
if (!empty(errors)) {
props.errors = errors;
}
_.extend(results, props);

Expand Down Expand Up @@ -1547,7 +1547,7 @@ var validators = Object.freeze({
modified: { fn: this._defineModified, arg: validationsGetter },
dirty: { fn: this._defineDirty, arg: validationsGetter },
pristine: { fn: this._definePristine, arg: targetGetter },
messages: { fn: this._defineMessages, arg: validationsGetter }
errors: { fn: this._defineErrors, arg: validationsGetter }
}, function (descriptor, name) {
Object.defineProperty(targetGetter(), name, {
enumerable: true,
Expand Down Expand Up @@ -1616,8 +1616,8 @@ var validators = Object.freeze({
return !scopeGetter().dirty;
}
}, {
key: '_defineMessages',
value: function _defineMessages(validationsGetter) {
key: '_defineErrors',
value: function _defineErrors(validationsGetter) {
var _this8 = this;

var extend = exports$1.Vue.util.extend;
Expand All @@ -1627,8 +1627,8 @@ var validators = Object.freeze({
each(validationsGetter(), function (validation, key) {
if (hasOwn(_this8._scope, validation.field)) {
var target = _this8._scope[validation.field];
if (target && !empty(target['messages'])) {
ret[validation.field] = extend({}, target['messages']);
if (target && !empty(target['errors'])) {
ret[validation.field] = extend({}, target['errors']);
}
}
}, this);
Expand Down Expand Up @@ -1668,16 +1668,13 @@ var validators = Object.freeze({

bind: function bind() {
if (!this.params.name) {
// TODO: should be implemented validator:bind name params nothing error'
warn('TODO: should be implemented validator:bind name params nothing error');
warn('validator element directive need to specify \'name\' param attribute: ' + '(e.g. <validator name="validator1">...</validator>)');
return;
}

this.validatorName = '$' + camelize(this.params.name);
if (!this.vm._validatorMaps) {
// TODO: should be implemented error message'
warn('TODO: should be implemented error message');
return;
throw new Error('Invalid validator management error');
}

this.setupValidator();
Expand Down Expand Up @@ -1761,7 +1758,7 @@ var validators = Object.freeze({
Validate(Vue);
}

plugin.version = '2.0.0-alpha.18';
plugin.version = '2.0.0-alpha.19';

if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(plugin);
Expand Down
4 changes: 2 additions & 2 deletions dist/vue-validator.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-validator",
"description": "Validator component for Vue.js",
"version": "2.0.0-alpha.18",
"version": "2.0.0-alpha.19",
"author": {
"name": "kazuya kawaguchi",
"email": "kawakazu80@gmail.com"
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function plugin (Vue, options = {}) {
Validate(Vue)
}

plugin.version = '2.0.0-alpha.18'
plugin.version = '2.0.0-alpha.19'

export default plugin

Expand Down

0 comments on commit 8d6fce8

Please sign in to comment.