From 8d6fce8c2a64ce2c99788ad23ff4be889ec234eb Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Mon, 15 Feb 2016 00:07:16 +0900 Subject: [PATCH] release v2.0.0-alpha.19 --- CHANGELOG.md | 16 ++++++++++++++++ README.md | 2 +- dist/vue-validator.common.js | 29 +++++++++++++---------------- dist/vue-validator.js | 29 +++++++++++++---------------- dist/vue-validator.min.js | 4 ++-- package.json | 2 +- src/index.js | 2 +- 7 files changed, 47 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7aa16c..e7472d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ + +# [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` + + + # [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) diff --git a/README.md b/README.md index 2ec7885..e477662 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ You don't need to do this when using the standalone build, as it installs itself ## CDN jsdelivr ```html - + ``` diff --git a/dist/vue-validator.common.js b/dist/vue-validator.common.js index 36732b0..c924dec 100644 --- a/dist/vue-validator.common.js +++ b/dist/vue-validator.common.js @@ -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. */ @@ -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) { @@ -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; @@ -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); @@ -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, @@ -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; @@ -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); @@ -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. ...)'); 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(); @@ -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); diff --git a/dist/vue-validator.js b/dist/vue-validator.js index 6a0e5bc..1bcb7e2 100644 --- a/dist/vue-validator.js +++ b/dist/vue-validator.js @@ -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. */ @@ -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) { @@ -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; @@ -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); @@ -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, @@ -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; @@ -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); @@ -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. ...)'); 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(); @@ -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); diff --git a/dist/vue-validator.min.js b/dist/vue-validator.min.js index 78dcfc7..47cd218 100644 --- a/dist/vue-validator.min.js +++ b/dist/vue-validator.min.js @@ -1,6 +1,6 @@ /*! - * vue-validator v2.0.0-alpha.18 + * vue-validator v2.0.0-alpha.19 * (c) 2016 kazuya kawaguchi * Released under the MIT License. */ -!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):t.VueValidator=i()}(this,function(){"use strict";function t(t,i){window.console&&(console.warn("[vue-validator] "+t),i&&console.warn(i.stack))}function i(t){if(null===t)return!0;if(Array.isArray(t)){if(t.length>0)return!1;if(0===t.length)return!0}else if(g.Vue.util.isPlainObject(t))for(var i in t)if(g.Vue.util.hasOwn(t,i))return!1;return!0}function e(t,i,e){if(Array.isArray(t))for(var n=0;ne&&(i=s(t[e]),i);e++);return i}return!1}return"number"==typeof t||"function"==typeof t?!0:"boolean"==typeof t?t:"string"==typeof t?t.length>0:null!==t&&"object"===("undefined"==typeof t?"undefined":m["typeof"](t))?Object.keys(t).length>0:null===t||void 0===t?!1:void 0}function o(t,i){if("string"!=typeof i)return!1;var e=i.match(new RegExp("^/(.*?)/([gimy]*)$"));return e?new RegExp(e[1],e[2]).test(t):!1}function l(t,i){return"string"==typeof t?h(i,10)&&t.length>=parseInt(i,10):Array.isArray(t)?t.length>=parseInt(i,10):!1}function r(t,i){return"string"==typeof t?h(i,10)&&t.length<=parseInt(i,10):Array.isArray(t)?t.length<=parseInt(i,10):!1}function u(t,i){return!isNaN(+t)&&!isNaN(+i)&&+t>=+i}function d(t,i){return!isNaN(+t)&&!isNaN(+i)&&+i>=+t}function h(t){return/^(-?[1-9]\d*|0)$/.test(t)}function c(t){var i=t.util.extend,e=Object.create(null);i(e,y),t.options.validators=e;var n=t.config.optionMergeStrategies;n&&(n.validators=function(t,e){if(!e)return t;if(!t)return e;var n=Object.create(null);i(n,t);for(var a in e)n[a]=e[a];return n}),t.validator=function(i,e){return e?void(t.options.validators[i]=e):t.options.validators[i]}}function v(t){var i=t.prototype._init;t.prototype._init=function(t){this._validatorMaps||(this._validatorMaps=Object.create(null)),i.call(this,t)};var e=t.prototype._destroy;t.prototype._destroy=function(){e.apply(this,arguments),this._validatorMaps=null}}function f(i){var n=i.util,a=i.directive("if"),s=i.FragmentFactory;i.compiler.terminalDirectives.push("validate"),i.directive("validate",{priority:a.priority+1,params:["group","field"],bind:function(){if(this.el.__vue__)return void t('v-validate="'+this.expression+'" cannot be used on an instance root element.');var i=this.vm.$options._validator;return i?(this.model=this.el.getAttribute("v-model"),this.setupFragment(),this.setupValidate(i,this.model),void this.listen()):void t('v-validate need to use into validator element directive: (e.g. ).')},update:function(t,i){t&&(n.isPlainObject(t)?this.handleObject(t):Array.isArray(t)&&this.handleArray(t),this.validator.validate(this.validation))},unbind:function(){this.unlisten(),this.teardownValidate(),this.teardownFragment(),this.model=null},setupValidate:function(t,i){var e=this.params,a=this.validator=this.vm._validatorMaps[t];this.field=n.camelize(this.arg?this.arg:e.field),this.validation=a.manageValidation(this.field,i,this.vm,this.frag.node,this._scope),e.group&&a.addGroupValidation(e.group,this.field)},listen:function(){var t=this.model,i=this.validation,e=this.frag.node;this.onBlur=n.bind(i.listener,i),n.on(e,"blur",this.onBlur),"radio"!==e.type&&"SELECT"!==e.tagName||t?"checkbox"===e.type?t?(this.onClick=n.bind(i.listener,i),n.on(e,"click",this.onClick)):(this.onChange=n.bind(i.listener,i),n.on(e,"change",this.onChange)):t||(this.onInput=n.bind(i.listener,i),n.on(e,"input",this.onInput)):(this.onChange=n.bind(i.listener,i),n.on(e,"change",this.onChange))},unlisten:function(){var t=this.frag.node;this.onInput&&(n.off(t,"input",this.onInput),this.onInput=null),this.onClick&&(n.off(t,"click",this.onClick),this.onClick=null),this.onChange&&(n.off(t,"change",this.onChange),this.onChange=null),this.onBlur&&(n.off(t,"blur",this.onBlur),this.onBlur=null)},teardownValidate:function(){if(this.validator&&this.validation){var t=this.frag.node;this.params.group&&this.validator.removeGroupValidation(this.params.group,this.field),this.validator.unmanageValidation(this.field,t),this.validator=null,this.validation=null,this.field=null}},setupFragment:function(){this.anchor=n.createAnchor("v-validate"),n.replace(this.el,this.anchor),this.factory=new s(this.vm,this.el),this.frag=this.factory.create(this._host,this._scope,this._frag),this.frag.before(this.anchor)},teardownFragment:function(){this.frag&&(this.frag.remove(),this.frag=null,this.factory=null),n.replace(this.anchor,this.el),this.anchor=null},handleArray:function(t){var i=this;e(t,function(t){i.validation.setValidation(t)},this)},handleObject:function(t){var i=this;e(t,function(t,e){if(n.isPlainObject(t)){if("rule"in t){var a="message"in t?t.message:null;i.validation.setValidation(e,t.rule,a)}}else i.validation.setValidation(e,t)},this)}})}function _(i){var e=i.util,n=i.FragmentFactory,a=i.directive("if"),s=i.util.camelize;i.elementDirective("validator",{params:["name","groups","lazy"],bind:function(){return this.params.name?(this.validatorName="$"+s(this.params.name),this.vm._validatorMaps?(this.setupValidator(),void this.setupFragment(this.params.lazy)):void t("TODO: should be implemented error message")):void t("TODO: should be implemented validator:bind name params nothing error")},unbind:function(){this.teardownFragment(),this.teardownValidator()},getGroups:function(){var t=[];return this.params.groups&&(e.isArray(this.params.groups)?t=this.params.groups:e.isPlainObject(this.params.groups)||"string"!=typeof this.params.groups||t.push(this.params.groups)),t},setupValidator:function(){var t=this.validator=new C(this.validatorName,this,this.getGroups());t.enableReactive(),t.setupScope(),t.registerEvents()},teardownValidator:function(){this.validator.unregisterEvents(),this.validator.disableReactive(),this.validatorName&&(this.validatorName=null,this.validator=null)},setupFragment:function(t){var i=this;this.validator.waitFor(function(){i.anchor=e.createAnchor("vue-validator"),e.replace(i.el,i.anchor),e.extend(i.vm.$options,{_validator:i.validatorName}),i.factory=new n(i.vm,i.el.innerHTML),a.insert.call(i),i.validator.validate()}),t||this.vm.$activateValidator()},teardownFragment:function(){a.unbind.call(this)}})}function p(i){arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return p.installed?void t("already installed."):(g.Vue=i,c(i),v(i),_(i),void f(i))}var m={};m["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},m.classCallCheck=function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")},m.createClass=function(){function t(t,i){for(var e=0;ee;e++){var a=t[e];i.disabled||i.value!==a||i.checked||(i.checked=!0)}}},{key:"_getValue",value:function(t){var i=this;if(!this._inits||0===this._inits.length)return t.checked;var n=function(){var t=[];return e(i._inits,function(i,e){i.el.checked&&t.push(i.el.value)}),{v:t}}();return"object"===("undefined"==typeof n?"undefined":m["typeof"](n))?n.v:void 0}},{key:"_checkModified",value:function(t){var i=this;if(0===this._inits.length)return this._init!==t.checked;var n=function(){var t=!1;return e(i._inits,function(i,e){t||(t=i.init!==i.el.checked)}),{v:t}}();return"object"===("undefined"==typeof n?"undefined":m["typeof"](n))?n.v:void 0}}]),i}(k),b=function(t){function i(t,e,n,a,s,o){m.classCallCheck(this,i);var l=m.possibleConstructorReturn(this,Object.getPrototypeOf(i).call(this,t,e,n,a,s,o));return l._inits=[],l}return m.inherits(i,t),m.createClass(i,[{key:"manageElement",value:function(t){var i=this,e=this._addItem(t),n=this._getScope(),a=e.model=this._model;if(a){var s=n.$get(a);this._setChecked(s,t,e),e.unwatch=n.$watch(a,function(e,n){e!==n&&i.handleValidate(t)})}else this._validator.validate()}},{key:"unmanageElement",value:function(t){var i=-1;e(this._inits,function(e,n){e.el===t&&(i=n)}),-1!==i&&(this._inits.splice(i,1),this._validator.validate())}},{key:"willUpdateFlags",value:function(){var t=this;e(this._inits,function(i,e){t.willUpdateDirty(i.el),t.willUpdateModified(i.el)},this)}},{key:"reset",value:function(){this.resetFlags(),e(this._inits,function(t,i){t.init=t.el.checked,t.value=t.el.value})}},{key:"_addItem",value:function(t){var i={el:t,init:t.checked,value:t.value};return this._inits.push(i),i}},{key:"_setChecked",value:function(t,i,e){i.value===t&&(i.checked=!0,this._init=i.checked,e.init=i.checked,e.value=t)}},{key:"_getValue",value:function(t){var i=this;if(!this._inits||0===this._inits.length)return t.checked;var n=function(){var t=[];return e(i._inits,function(i,e){i.el.checked&&t.push(i.el.value)}),{v:t}}();return"object"===("undefined"==typeof n?"undefined":m["typeof"](n))?n.v:void 0}},{key:"_checkModified",value:function(t){var i=this;if(0===this._inits.length)return this._init!==t.checked;var n=function(){var t=!1;return e(i._inits,function(i,e){t||(t=i.init!==i.el.checked)}),{v:t}}();return"object"===("undefined"==typeof n?"undefined":m["typeof"](n))?n.v:void 0}}]),i}(k),w=function(t){function i(t,e,n,a,s,o){m.classCallCheck(this,i);var l=m.possibleConstructorReturn(this,Object.getPrototypeOf(i).call(this,t,e,n,a,s,o));return l._multiple=l._el.hasAttribute("multiple"),l}return m.inherits(i,t),m.createClass(i,[{key:"manageElement",value:function(t){var i=this,e=this._getScope(),n=this._model;if(n){var a=e.$get(n),s=Array.isArray(a)?a:[a];this._setOption(s,t),this._unwatch=e.$watch(n,function(e,n){var a=Array.isArray(e)?e:[e],s=Array.isArray(n)?n:[n];a.slice().sort().toString()!==s.slice().sort().toString()&&i.handleValidate(t)})}}},{key:"unmanageElement",value:function(t){this._unwatch&&this._unwatch()}},{key:"reset",value:function(){this.resetFlags()}},{key:"_getValue",value:function(t){for(var i=[],e=0,n=t.options.length;n>e;e++){var a=t.options[e];!a.disabled&&a.selected&&i.push(a.value)}return i}},{key:"_setOption",value:function(t,i){for(var e=0,n=t.length;n>e;e++)for(var a=t[e],s=0,o=i.options.length;o>s;s++){var l=i.options[s];l.disabled||l.value!==a||l.hasAttribute("selected")&&l.selected||(l.selected=!0)}}},{key:"_checkModified",value:function(t){var i=this._getValue(t).slice().sort();if(this._init.length!==i.length)return!0;var e=this._init.slice().sort();return e.toString()!==i.toString()}}]),i}(k),E=/^v-on:|^@/,C=function(){function t(i,n,a){var s=this;m.classCallCheck(this,t),this.name=i,this._scope={},this._dir=n,this._validations={},this._checkboxValidations={},this._radioValidations={},this._groups=a,this._groupValidations={},this._events={},this._modified=!1,e(a,function(t){s._groupValidations[t]=[]},this)}return m.createClass(t,[{key:"enableReactive",value:function(){var t=this;g.Vue.util.defineReactive(this._dir.vm,this.name,this._scope),this._dir.vm._validatorMaps[this.name]=this,this._dir.vm.$validatorReset=function(){t.resetValidation()},this._dir.vm.$validate=function(i){t._validate(i)}}},{key:"disableReactive",value:function(){this._dir.vm.$validate=null,this._dir.vm.$validatorReset=null,this._dir.vm._validatorMaps[this.name]=null,this._dir.vm[this.name]=null}},{key:"registerEvents",value:function(){for(var t=this._dir.el.attributes,i=0,e=t.length;e>i;i++){var n=t[i].name;E.test(n)&&(n=n.replace(E,""),this._events[this._getEventName(n)]=this._dir.vm.$eval(t[i].value,!0))}}},{key:"unregisterEvents",value:function(){var t=this;e(this._events,function(i,e){t._events[e]=null,delete t._events[e]},this)}},{key:"_validate",value:function(t){var i=this._validations[t];if(!i&&this._checkboxValidations[t]?i=this._checkboxValidations[t].validation:!i&&this._radioValidations[t]&&(i=this._radioValidations[t].validation),i){i.willUpdateFlags();var e=i.validate();g.Vue.set(this._scope,t,e),this._scope.dirty&&this._fireEvent("dirty"),this._modified!==this._scope.modified&&(this._fireEvent("modified",this._scope.modified),this._modified=this._scope.modified);var n=this._scope.valid;this._fireEvent(n?"valid":"invalid")}}},{key:"resetValidation",value:function(){e(this._validations,function(t,i){t.reset()},this),e(this._checkboxValidations,function(t,i){t.validation.reset()},this),e(this._radioValidations,function(t,i){t.validation.reset()},this),this.validate()}},{key:"manageValidation",value:function(t,i,e,n,a){var s=null;return s="SELECT"===n.tagName?this._manageSelectValidation(t,i,e,n,a):"checkbox"===n.type?this._manageCheckboxValidation(t,i,e,n,a):"radio"===n.type?this._manageRadioValidation(t,i,e,n,a):this._manageBaseValidation(t,i,e,n,a)}},{key:"unmanageValidation",value:function(t,i){"checkbox"===i.type?this._unmanageCheckboxValidation(t,i):"radio"===i.type?this._unmanageRadioValidation(t,i):"SELECT"===i.tagName?this._unmanageSelectValidation(t,i):this._unmanageBaseValidation(t,i)}},{key:"_manageBaseValidation",value:function(t,i,e,n,a){var s=this._validations[t]=new k(t,i,e,n,a,this);return s.manageElement(n),s}},{key:"_unmanageBaseValidation",value:function(t,i){var e=this._validations[t];e&&(e.unmanageElement(i),g.Vue["delete"](this._scope,t),this._validations[t]=null,delete this._validations[t])}},{key:"_manageCheckboxValidation",value:function(t,i,e,n,a){var s=this._checkboxValidations[t];if(!s){var o=new V(t,i,e,n,a,this);s={validation:o,elements:0},this._checkboxValidations[t]=s}return s.elements++,s.validation.manageElement(n),s.validation}},{key:"_unmanageCheckboxValidation",value:function(t,i){var e=this._checkboxValidations[t];e&&(e.elements--,e.validation.unmanageElement(i),0===e.elements&&(g.Vue["delete"](this._scope,t),this._checkboxValidations[t]=null,delete this._checkboxValidations[t]))}},{key:"_manageRadioValidation",value:function(t,i,e,n,a){var s=this._radioValidations[t];if(!s){var o=new b(t,i,e,n,a,this);s={validation:o,elements:0},this._radioValidations[t]=s}return s.elements++,s.validation.manageElement(n),s.validation}},{key:"_unmanageRadioValidation",value:function(t,i){var e=this._radioValidations[t];e&&(e.elements--,e.validation.unmanageElement(i),0===e.elements&&(g.Vue["delete"](this._scope,t),this._radioValidations[t]=null,delete this._radioValidations[t]))}},{key:"_manageSelectValidation",value:function(t,i,e,n,a){var s=this._validations[t]=new w(t,i,e,n,a,this);return s.manageElement(n),s}},{key:"_unmanageSelectValidation",value:function(t,i){var e=this._validations[t];e&&(e.unmanageElement(i),g.Vue["delete"](this._scope,t),this._validations[t]=null,delete this._validations[t])}},{key:"addGroupValidation",value:function(t,i){var e=g.Vue.util.indexOf,n=this._validations[i]||this._checkboxValidations[i].validation||this._radioValidations[i].validation,a=this._groupValidations[t];a&&(~e(a,n)||a.push(n))}},{key:"removeGroupValidation",value:function(t,i){var e=this._validations[i]||this._checkboxValidations[i].validation||this._radioValidations[i].validation,a=this._groupValidations[t];a&&n(a,e)}},{key:"validate",value:function(t){var i=this;e(this._validations,function(t,e){var n=t.validate();g.Vue.set(i._scope,e,n)},this),e(this._checkboxValidations,function(t,e){var n=t.validation.validate();g.Vue.set(i._scope,e,n)},this),e(this._radioValidations,function(t,e){var n=t.validation.validate();g.Vue.set(i._scope,e,n)},this),this._scope.touched&&this._fireEvent("touched"),this._scope.dirty&&this._fireEvent("dirty"),this._modified!==this._scope.modified&&(this._fireEvent("modified",this._scope.modified),this._modified=this._scope.modified);var n=this._scope.valid;this._fireEvent(n?"valid":"invalid")}},{key:"setupScope",value:function(){var t=this,i=function(){return t.validations},n=function(){return t._scope};this._defineProperties(i,n),e(this._groups,function(i){var e=t._groupValidations[i],n={};g.Vue.set(t._scope,i,n),t._defineProperties(function(){return e},function(){return n})},this)}},{key:"waitFor",value:function(t){var i=this._dir.vm,e="$activateValidator";this._dir.vm[e]=function(){t(),i[e]=null}}},{key:"_fireEvent",value:function(t){for(var i=this._events[this._getEventName(t)],e=arguments.length,n=Array(e>1?e-1:0),a=1;e>a;a++)n[a-1]=arguments[a];i&&i.apply(null,n)}},{key:"_getEventName",value:function(t){return this.name+":"+t}},{key:"_defineProperties",value:function(t,i){var n=this,a=g.Vue.util.bind;e({valid:{fn:this._defineValid,arg:t},invalid:{fn:this._defineInvalid,arg:i},touched:{fn:this._defineTouched,arg:t},untouched:{fn:this._defineUntouched,arg:i},modified:{fn:this._defineModified,arg:t},dirty:{fn:this._defineDirty,arg:t},pristine:{fn:this._definePristine,arg:i},messages:{fn:this._defineMessages,arg:t}},function(t,e){Object.defineProperty(i(),e,{enumerable:!0,configurable:!0,get:function(){return a(t.fn,n)(t.arg)}})},this)}},{key:"_walkValidations",value:function(t,i,n){var a=this,s=g.Vue.util.hasOwn,o=n;return e(t,function(t,e){if(o!==!n&&s(a._scope,t.field)){var l=a._scope[t.field];l&&l[i]===!n&&(o=!n)}},this),o}},{key:"_defineValid",value:function(t){return this._walkValidations(t(),"valid",!0)}},{key:"_defineInvalid",value:function(t){return!t().valid}},{key:"_defineTouched",value:function(t){return this._walkValidations(t(),"touched",!1)}},{key:"_defineUntouched",value:function(t){return!t().touched}},{key:"_defineModified",value:function(t){return this._walkValidations(t(),"modified",!1)}},{key:"_defineDirty",value:function(t){return this._walkValidations(t(),"dirty",!1)}},{key:"_definePristine",value:function(t){return!t().dirty}},{key:"_defineMessages",value:function(t){var n=this,a=g.Vue.util.extend,s=g.Vue.util.hasOwn,o={};return e(t(),function(t,e){if(s(n._scope,t.field)){var l=n._scope[t.field];l&&!i(l.messages)&&(o[t.field]=a({},l.messages))}},this),i(o)?void 0:o}},{key:"validations",get:function(){var t=g.Vue.util.extend,i={};return t(i,this._validations),e(this._checkboxValidations,function(t,e){i[e]=t.validation},this),e(this._radioValidations,function(t,e){i[e]=t.validation},this),i}}]),t}();return p.version="2.0.0-alpha.18","undefined"!=typeof window&&window.Vue&&window.Vue.use(p),p}); \ No newline at end of file +!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):t.VueValidator=i()}(this,function(){"use strict";function t(t,i){window.console&&(console.warn("[vue-validator] "+t),i&&console.warn(i.stack))}function i(t){if(null===t)return!0;if(Array.isArray(t)){if(t.length>0)return!1;if(0===t.length)return!0}else if(g.Vue.util.isPlainObject(t))for(var i in t)if(g.Vue.util.hasOwn(t,i))return!1;return!0}function e(t,i,e){if(Array.isArray(t))for(var n=0;ne&&(i=s(t[e]),i);e++);return i}return!1}return"number"==typeof t||"function"==typeof t?!0:"boolean"==typeof t?t:"string"==typeof t?t.length>0:null!==t&&"object"===("undefined"==typeof t?"undefined":m["typeof"](t))?Object.keys(t).length>0:null===t||void 0===t?!1:void 0}function o(t,i){if("string"!=typeof i)return!1;var e=i.match(new RegExp("^/(.*?)/([gimy]*)$"));return e?new RegExp(e[1],e[2]).test(t):!1}function r(t,i){return"string"==typeof t?h(i,10)&&t.length>=parseInt(i,10):Array.isArray(t)?t.length>=parseInt(i,10):!1}function l(t,i){return"string"==typeof t?h(i,10)&&t.length<=parseInt(i,10):Array.isArray(t)?t.length<=parseInt(i,10):!1}function u(t,i){return!isNaN(+t)&&!isNaN(+i)&&+t>=+i}function d(t,i){return!isNaN(+t)&&!isNaN(+i)&&+i>=+t}function h(t){return/^(-?[1-9]\d*|0)$/.test(t)}function c(t){var i=t.util.extend,e=Object.create(null);i(e,y),t.options.validators=e;var n=t.config.optionMergeStrategies;n&&(n.validators=function(t,e){if(!e)return t;if(!t)return e;var n=Object.create(null);i(n,t);for(var a in e)n[a]=e[a];return n}),t.validator=function(i,e){return e?void(t.options.validators[i]=e):t.options.validators[i]}}function v(t){var i=t.prototype._init;t.prototype._init=function(t){this._validatorMaps||(this._validatorMaps=Object.create(null)),i.call(this,t)};var e=t.prototype._destroy;t.prototype._destroy=function(){e.apply(this,arguments),this._validatorMaps=null}}function f(i){var n=i.util,a=i.directive("if"),s=i.FragmentFactory;i.compiler.terminalDirectives.push("validate"),i.directive("validate",{priority:a.priority+1,params:["group","field"],bind:function(){if(this.el.__vue__)return void t('v-validate="'+this.expression+'" cannot be used on an instance root element.');var i=this.vm.$options._validator;return i?(this.model=this.el.getAttribute("v-model"),this.setupFragment(),this.setupValidate(i,this.model),void this.listen()):void t('v-validate need to use into validator element directive: (e.g. ).')},update:function(t,i){t&&(n.isPlainObject(t)?this.handleObject(t):Array.isArray(t)&&this.handleArray(t),this.validator.validate(this.validation))},unbind:function(){this.unlisten(),this.teardownValidate(),this.teardownFragment(),this.model=null},setupValidate:function(t,i){var e=this.params,a=this.validator=this.vm._validatorMaps[t];this.field=n.camelize(this.arg?this.arg:e.field),this.validation=a.manageValidation(this.field,i,this.vm,this.frag.node,this._scope),e.group&&a.addGroupValidation(e.group,this.field)},listen:function(){var t=this.model,i=this.validation,e=this.frag.node;this.onBlur=n.bind(i.listener,i),n.on(e,"blur",this.onBlur),"radio"!==e.type&&"SELECT"!==e.tagName||t?"checkbox"===e.type?t?(this.onClick=n.bind(i.listener,i),n.on(e,"click",this.onClick)):(this.onChange=n.bind(i.listener,i),n.on(e,"change",this.onChange)):t||(this.onInput=n.bind(i.listener,i),n.on(e,"input",this.onInput)):(this.onChange=n.bind(i.listener,i),n.on(e,"change",this.onChange))},unlisten:function(){var t=this.frag.node;this.onInput&&(n.off(t,"input",this.onInput),this.onInput=null),this.onClick&&(n.off(t,"click",this.onClick),this.onClick=null),this.onChange&&(n.off(t,"change",this.onChange),this.onChange=null),this.onBlur&&(n.off(t,"blur",this.onBlur),this.onBlur=null)},teardownValidate:function(){if(this.validator&&this.validation){var t=this.frag.node;this.params.group&&this.validator.removeGroupValidation(this.params.group,this.field),this.validator.unmanageValidation(this.field,t),this.validator=null,this.validation=null,this.field=null}},setupFragment:function(){this.anchor=n.createAnchor("v-validate"),n.replace(this.el,this.anchor),this.factory=new s(this.vm,this.el),this.frag=this.factory.create(this._host,this._scope,this._frag),this.frag.before(this.anchor)},teardownFragment:function(){this.frag&&(this.frag.remove(),this.frag=null,this.factory=null),n.replace(this.anchor,this.el),this.anchor=null},handleArray:function(t){var i=this;e(t,function(t){i.validation.setValidation(t)},this)},handleObject:function(t){var i=this;e(t,function(t,e){if(n.isPlainObject(t)){if("rule"in t){var a="message"in t?t.message:null;i.validation.setValidation(e,t.rule,a)}}else i.validation.setValidation(e,t)},this)}})}function _(i){var e=i.util,n=i.FragmentFactory,a=i.directive("if"),s=i.util.camelize;i.elementDirective("validator",{params:["name","groups","lazy"],bind:function(){if(!this.params.name)return void t("validator element directive need to specify 'name' param attribute: (e.g. ...)");if(this.validatorName="$"+s(this.params.name),!this.vm._validatorMaps)throw new Error("Invalid validator management error");this.setupValidator(),this.setupFragment(this.params.lazy)},unbind:function(){this.teardownFragment(),this.teardownValidator()},getGroups:function(){var t=[];return this.params.groups&&(e.isArray(this.params.groups)?t=this.params.groups:e.isPlainObject(this.params.groups)||"string"!=typeof this.params.groups||t.push(this.params.groups)),t},setupValidator:function(){var t=this.validator=new C(this.validatorName,this,this.getGroups());t.enableReactive(),t.setupScope(),t.registerEvents()},teardownValidator:function(){this.validator.unregisterEvents(),this.validator.disableReactive(),this.validatorName&&(this.validatorName=null,this.validator=null)},setupFragment:function(t){var i=this;this.validator.waitFor(function(){i.anchor=e.createAnchor("vue-validator"),e.replace(i.el,i.anchor),e.extend(i.vm.$options,{_validator:i.validatorName}),i.factory=new n(i.vm,i.el.innerHTML),a.insert.call(i),i.validator.validate()}),t||this.vm.$activateValidator()},teardownFragment:function(){a.unbind.call(this)}})}function p(i){arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return p.installed?void t("already installed."):(g.Vue=i,c(i),v(i),_(i),void f(i))}var m={};m["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},m.classCallCheck=function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")},m.createClass=function(){function t(t,i){for(var e=0;ee;e++){var a=t[e];i.disabled||i.value!==a||i.checked||(i.checked=!0)}}},{key:"_getValue",value:function(t){var i=this;if(!this._inits||0===this._inits.length)return t.checked;var n=function(){var t=[];return e(i._inits,function(i,e){i.el.checked&&t.push(i.el.value)}),{v:t}}();return"object"===("undefined"==typeof n?"undefined":m["typeof"](n))?n.v:void 0}},{key:"_checkModified",value:function(t){var i=this;if(0===this._inits.length)return this._init!==t.checked;var n=function(){var t=!1;return e(i._inits,function(i,e){t||(t=i.init!==i.el.checked)}),{v:t}}();return"object"===("undefined"==typeof n?"undefined":m["typeof"](n))?n.v:void 0}}]),i}(k),b=function(t){function i(t,e,n,a,s,o){m.classCallCheck(this,i);var r=m.possibleConstructorReturn(this,Object.getPrototypeOf(i).call(this,t,e,n,a,s,o));return r._inits=[],r}return m.inherits(i,t),m.createClass(i,[{key:"manageElement",value:function(t){var i=this,e=this._addItem(t),n=this._getScope(),a=e.model=this._model;if(a){var s=n.$get(a);this._setChecked(s,t,e),e.unwatch=n.$watch(a,function(e,n){e!==n&&i.handleValidate(t)})}else this._validator.validate()}},{key:"unmanageElement",value:function(t){var i=-1;e(this._inits,function(e,n){e.el===t&&(i=n)}),-1!==i&&(this._inits.splice(i,1),this._validator.validate())}},{key:"willUpdateFlags",value:function(){var t=this;e(this._inits,function(i,e){t.willUpdateDirty(i.el),t.willUpdateModified(i.el)},this)}},{key:"reset",value:function(){this.resetFlags(),e(this._inits,function(t,i){t.init=t.el.checked,t.value=t.el.value})}},{key:"_addItem",value:function(t){var i={el:t,init:t.checked,value:t.value};return this._inits.push(i),i}},{key:"_setChecked",value:function(t,i,e){i.value===t&&(i.checked=!0,this._init=i.checked,e.init=i.checked,e.value=t)}},{key:"_getValue",value:function(t){var i=this;if(!this._inits||0===this._inits.length)return t.checked;var n=function(){var t=[];return e(i._inits,function(i,e){i.el.checked&&t.push(i.el.value)}),{v:t}}();return"object"===("undefined"==typeof n?"undefined":m["typeof"](n))?n.v:void 0}},{key:"_checkModified",value:function(t){var i=this;if(0===this._inits.length)return this._init!==t.checked;var n=function(){var t=!1;return e(i._inits,function(i,e){t||(t=i.init!==i.el.checked)}),{v:t}}();return"object"===("undefined"==typeof n?"undefined":m["typeof"](n))?n.v:void 0}}]),i}(k),w=function(t){function i(t,e,n,a,s,o){m.classCallCheck(this,i);var r=m.possibleConstructorReturn(this,Object.getPrototypeOf(i).call(this,t,e,n,a,s,o));return r._multiple=r._el.hasAttribute("multiple"),r}return m.inherits(i,t),m.createClass(i,[{key:"manageElement",value:function(t){var i=this,e=this._getScope(),n=this._model;if(n){var a=e.$get(n),s=Array.isArray(a)?a:[a];this._setOption(s,t),this._unwatch=e.$watch(n,function(e,n){var a=Array.isArray(e)?e:[e],s=Array.isArray(n)?n:[n];a.slice().sort().toString()!==s.slice().sort().toString()&&i.handleValidate(t)})}}},{key:"unmanageElement",value:function(t){this._unwatch&&this._unwatch()}},{key:"reset",value:function(){this.resetFlags()}},{key:"_getValue",value:function(t){for(var i=[],e=0,n=t.options.length;n>e;e++){var a=t.options[e];!a.disabled&&a.selected&&i.push(a.value)}return i}},{key:"_setOption",value:function(t,i){for(var e=0,n=t.length;n>e;e++)for(var a=t[e],s=0,o=i.options.length;o>s;s++){var r=i.options[s];r.disabled||r.value!==a||r.hasAttribute("selected")&&r.selected||(r.selected=!0)}}},{key:"_checkModified",value:function(t){var i=this._getValue(t).slice().sort();if(this._init.length!==i.length)return!0;var e=this._init.slice().sort();return e.toString()!==i.toString()}}]),i}(k),E=/^v-on:|^@/,C=function(){function t(i,n,a){var s=this;m.classCallCheck(this,t),this.name=i,this._scope={},this._dir=n,this._validations={},this._checkboxValidations={},this._radioValidations={},this._groups=a,this._groupValidations={},this._events={},this._modified=!1,e(a,function(t){s._groupValidations[t]=[]},this)}return m.createClass(t,[{key:"enableReactive",value:function(){var t=this;g.Vue.util.defineReactive(this._dir.vm,this.name,this._scope),this._dir.vm._validatorMaps[this.name]=this,this._dir.vm.$validatorReset=function(){t.resetValidation()},this._dir.vm.$validate=function(i){t._validate(i)}}},{key:"disableReactive",value:function(){this._dir.vm.$validate=null,this._dir.vm.$validatorReset=null,this._dir.vm._validatorMaps[this.name]=null,this._dir.vm[this.name]=null}},{key:"registerEvents",value:function(){for(var t=this._dir.el.attributes,i=0,e=t.length;e>i;i++){var n=t[i].name;E.test(n)&&(n=n.replace(E,""),this._events[this._getEventName(n)]=this._dir.vm.$eval(t[i].value,!0))}}},{key:"unregisterEvents",value:function(){var t=this;e(this._events,function(i,e){t._events[e]=null,delete t._events[e]},this)}},{key:"_validate",value:function(t){var i=this._validations[t];if(!i&&this._checkboxValidations[t]?i=this._checkboxValidations[t].validation:!i&&this._radioValidations[t]&&(i=this._radioValidations[t].validation),i){i.willUpdateFlags();var e=i.validate();g.Vue.set(this._scope,t,e),this._scope.dirty&&this._fireEvent("dirty"),this._modified!==this._scope.modified&&(this._fireEvent("modified",this._scope.modified),this._modified=this._scope.modified);var n=this._scope.valid;this._fireEvent(n?"valid":"invalid")}}},{key:"resetValidation",value:function(){e(this._validations,function(t,i){t.reset()},this),e(this._checkboxValidations,function(t,i){t.validation.reset()},this),e(this._radioValidations,function(t,i){t.validation.reset()},this),this.validate()}},{key:"manageValidation",value:function(t,i,e,n,a){var s=null;return s="SELECT"===n.tagName?this._manageSelectValidation(t,i,e,n,a):"checkbox"===n.type?this._manageCheckboxValidation(t,i,e,n,a):"radio"===n.type?this._manageRadioValidation(t,i,e,n,a):this._manageBaseValidation(t,i,e,n,a)}},{key:"unmanageValidation",value:function(t,i){"checkbox"===i.type?this._unmanageCheckboxValidation(t,i):"radio"===i.type?this._unmanageRadioValidation(t,i):"SELECT"===i.tagName?this._unmanageSelectValidation(t,i):this._unmanageBaseValidation(t,i)}},{key:"_manageBaseValidation",value:function(t,i,e,n,a){var s=this._validations[t]=new k(t,i,e,n,a,this);return s.manageElement(n),s}},{key:"_unmanageBaseValidation",value:function(t,i){var e=this._validations[t];e&&(e.unmanageElement(i),g.Vue["delete"](this._scope,t),this._validations[t]=null,delete this._validations[t])}},{key:"_manageCheckboxValidation",value:function(t,i,e,n,a){var s=this._checkboxValidations[t];if(!s){var o=new V(t,i,e,n,a,this);s={validation:o,elements:0},this._checkboxValidations[t]=s}return s.elements++,s.validation.manageElement(n),s.validation}},{key:"_unmanageCheckboxValidation",value:function(t,i){var e=this._checkboxValidations[t];e&&(e.elements--,e.validation.unmanageElement(i),0===e.elements&&(g.Vue["delete"](this._scope,t),this._checkboxValidations[t]=null,delete this._checkboxValidations[t]))}},{key:"_manageRadioValidation",value:function(t,i,e,n,a){var s=this._radioValidations[t];if(!s){var o=new b(t,i,e,n,a,this);s={validation:o,elements:0},this._radioValidations[t]=s}return s.elements++,s.validation.manageElement(n),s.validation}},{key:"_unmanageRadioValidation",value:function(t,i){var e=this._radioValidations[t];e&&(e.elements--,e.validation.unmanageElement(i),0===e.elements&&(g.Vue["delete"](this._scope,t),this._radioValidations[t]=null,delete this._radioValidations[t]))}},{key:"_manageSelectValidation",value:function(t,i,e,n,a){var s=this._validations[t]=new w(t,i,e,n,a,this);return s.manageElement(n),s}},{key:"_unmanageSelectValidation",value:function(t,i){var e=this._validations[t];e&&(e.unmanageElement(i),g.Vue["delete"](this._scope,t),this._validations[t]=null,delete this._validations[t])}},{key:"addGroupValidation",value:function(t,i){var e=g.Vue.util.indexOf,n=this._validations[i]||this._checkboxValidations[i].validation||this._radioValidations[i].validation,a=this._groupValidations[t];a&&(~e(a,n)||a.push(n))}},{key:"removeGroupValidation",value:function(t,i){var e=this._validations[i]||this._checkboxValidations[i].validation||this._radioValidations[i].validation,a=this._groupValidations[t];a&&n(a,e)}},{key:"validate",value:function(t){var i=this;e(this._validations,function(t,e){var n=t.validate();g.Vue.set(i._scope,e,n)},this),e(this._checkboxValidations,function(t,e){var n=t.validation.validate();g.Vue.set(i._scope,e,n)},this),e(this._radioValidations,function(t,e){var n=t.validation.validate();g.Vue.set(i._scope,e,n)},this),this._scope.touched&&this._fireEvent("touched"),this._scope.dirty&&this._fireEvent("dirty"),this._modified!==this._scope.modified&&(this._fireEvent("modified",this._scope.modified),this._modified=this._scope.modified);var n=this._scope.valid;this._fireEvent(n?"valid":"invalid")}},{key:"setupScope",value:function(){var t=this,i=function(){return t.validations},n=function(){return t._scope};this._defineProperties(i,n),e(this._groups,function(i){var e=t._groupValidations[i],n={};g.Vue.set(t._scope,i,n),t._defineProperties(function(){return e},function(){return n})},this)}},{key:"waitFor",value:function(t){var i=this._dir.vm,e="$activateValidator";this._dir.vm[e]=function(){t(),i[e]=null}}},{key:"_fireEvent",value:function(t){for(var i=this._events[this._getEventName(t)],e=arguments.length,n=Array(e>1?e-1:0),a=1;e>a;a++)n[a-1]=arguments[a];i&&i.apply(null,n)}},{key:"_getEventName",value:function(t){return this.name+":"+t}},{key:"_defineProperties",value:function(t,i){var n=this,a=g.Vue.util.bind;e({valid:{fn:this._defineValid,arg:t},invalid:{fn:this._defineInvalid,arg:i},touched:{fn:this._defineTouched,arg:t},untouched:{fn:this._defineUntouched,arg:i},modified:{fn:this._defineModified,arg:t},dirty:{fn:this._defineDirty,arg:t},pristine:{fn:this._definePristine,arg:i},errors:{fn:this._defineErrors,arg:t}},function(t,e){Object.defineProperty(i(),e,{enumerable:!0,configurable:!0,get:function(){return a(t.fn,n)(t.arg)}})},this)}},{key:"_walkValidations",value:function(t,i,n){var a=this,s=g.Vue.util.hasOwn,o=n;return e(t,function(t,e){if(o!==!n&&s(a._scope,t.field)){var r=a._scope[t.field];r&&r[i]===!n&&(o=!n)}},this),o}},{key:"_defineValid",value:function(t){return this._walkValidations(t(),"valid",!0)}},{key:"_defineInvalid",value:function(t){return!t().valid}},{key:"_defineTouched",value:function(t){return this._walkValidations(t(),"touched",!1)}},{key:"_defineUntouched",value:function(t){return!t().touched}},{key:"_defineModified",value:function(t){return this._walkValidations(t(),"modified",!1)}},{key:"_defineDirty",value:function(t){return this._walkValidations(t(),"dirty",!1)}},{key:"_definePristine",value:function(t){return!t().dirty}},{key:"_defineErrors",value:function(t){var n=this,a=g.Vue.util.extend,s=g.Vue.util.hasOwn,o={};return e(t(),function(t,e){if(s(n._scope,t.field)){var r=n._scope[t.field];r&&!i(r.errors)&&(o[t.field]=a({},r.errors))}},this),i(o)?void 0:o}},{key:"validations",get:function(){var t=g.Vue.util.extend,i={};return t(i,this._validations),e(this._checkboxValidations,function(t,e){i[e]=t.validation},this),e(this._radioValidations,function(t,e){i[e]=t.validation},this),i}}]),t}();return p.version="2.0.0-alpha.19","undefined"!=typeof window&&window.Vue&&window.Vue.use(p),p}); \ No newline at end of file diff --git a/package.json b/package.json index d3f2048..cc2b1d3 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/src/index.js b/src/index.js index 45252a1..2365217 100644 --- a/src/index.js +++ b/src/index.js @@ -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