From c4622246bc7b6e0d315c5d52ee354dbf2f254e5f Mon Sep 17 00:00:00 2001 From: Denis Karabaza Date: Tue, 15 Nov 2016 01:16:59 +0300 Subject: [PATCH] Release 2.1.0 --- CHANGELOG.md | 6 ++++++ README.md | 4 ++-- dist/vue-focus.common.js | 8 +++++++- dist/vue-focus.js | 8 +++++++- dist/vue-focus.min.js | 2 +- index.js | 2 +- package.json | 2 +- 7 files changed, 25 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3c825e..c6e8d49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [2.1.0] - 2016-10-20 + +## Added +- `.lazy` modifier to mimic v1 behavior + ## [2.0.0] - 2016-10-20 No changes from 2.0.0-rc2 @@ -48,3 +53,4 @@ Initial release [2.0.0-rc1]: https://github.com/simplesmiler/vue-focus/compare/1.0.0...2.0.0-rc1 [2.0.0-rc2]: https://github.com/simplesmiler/vue-focus/compare/2.0.0-rc1...2.0.0-rc2 [2.0.0]: https://github.com/simplesmiler/vue-focus/compare/2.0.0-rc2...2.0.0 +[2.1.0]: https://github.com/simplesmiler/vue-focus/compare/2.0.0...2.1.0 diff --git a/README.md b/README.md index 9ba43a1..30842dc 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,9 @@ $ npm install vue-focus --save From CDN: ``` html - + - + ``` ## API diff --git a/dist/vue-focus.common.js b/dist/vue-focus.common.js index 1c1bf6d..7a7e6a1 100644 --- a/dist/vue-focus.common.js +++ b/dist/vue-focus.common.js @@ -3,7 +3,7 @@ var Vue = require('vue'); Vue = 'default' in Vue ? Vue['default'] : Vue; -var version = '2.0.0'; +var version = '2.1.0'; var compatible = (/^2\./).test(Vue.version); if (!compatible) { @@ -17,6 +17,12 @@ var focus = { }, componentUpdated: function(el, binding) { + if (binding.modifiers.lazy) { + if (Boolean(binding.value) === Boolean(binding.oldValue)) { + return; + } + } + if (binding.value) el.focus(); else el.blur(); }, diff --git a/dist/vue-focus.js b/dist/vue-focus.js index 69dfd52..3428f53 100644 --- a/dist/vue-focus.js +++ b/dist/vue-focus.js @@ -2,7 +2,7 @@ Vue = 'default' in Vue ? Vue['default'] : Vue; - var version = '2.0.0'; + var version = '2.1.0'; var compatible = (/^2\./).test(Vue.version); if (!compatible) { @@ -16,6 +16,12 @@ }, componentUpdated: function(el, binding) { + if (binding.modifiers.lazy) { + if (Boolean(binding.value) === Boolean(binding.oldValue)) { + return; + } + } + if (binding.value) el.focus(); else el.blur(); }, diff --git a/dist/vue-focus.min.js b/dist/vue-focus.min.js index 047c8cb..10acd2e 100644 --- a/dist/vue-focus.min.js +++ b/dist/vue-focus.min.js @@ -1 +1 @@ -!function(u,e){"use strict";e="default"in e?e.default:e;var o="2.0.0",s=/^2\./.test(e.version);s||e.util.warn("VueFocus "+o+" only supports Vue 2.x, and does not support Vue "+e.version);var n={inserted:function(u,e){e.value?u.focus():u.blur()},componentUpdated:function(u,e){e.value?u.focus():u.blur()}},t={directives:{focus:n}};u.version=o,u.focus=n,u.mixin=t}(this.VueFocus={},Vue); \ No newline at end of file +!function(e,u){"use strict";u="default"in u?u.default:u;var o="2.1.0",n=/^2\./.test(u.version);n||u.util.warn("VueFocus "+o+" only supports Vue 2.x, and does not support Vue "+u.version);var s={inserted:function(e,u){u.value?e.focus():e.blur()},componentUpdated:function(e,u){u.modifiers.lazy&&Boolean(u.value)===Boolean(u.oldValue)||(u.value?e.focus():e.blur())}},t={directives:{focus:s}};e.version=o,e.focus=s,e.mixin=t}(this.VueFocus={},Vue); \ No newline at end of file diff --git a/index.js b/index.js index 4f80fb9..20c8336 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ import Vue from 'vue'; -export var version = '2.0.0'; +export var version = '2.1.0'; var compatible = (/^2\./).test(Vue.version); if (!compatible) { diff --git a/package.json b/package.json index fe5f5b6..c982b25 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vue-focus", "description": "A set of reusable focus directives for reusable Vue.js components", - "version": "2.0.0", + "version": "2.1.0", "author": "Denis Karabaza ", "browserify": { "transform": [