vue-window-size
Advanced tools
Comparing version 0.3.0 to 0.4.0-0
@@ -1,1 +0,1 @@ | ||
"use strict";function _interopDefault(i){return i&&"object"==typeof i&&"default"in i?i.default:i}Object.defineProperty(exports,"__esModule",{value:!0});var Vue=_interopDefault(require("vue")),WindowSize=function(){function i(i){var e=void 0===i?{}:i,t=e.defaults,n=void 0===t?{width:800,height:600}:t,o=e.delay,d=void 0===o?50:o;this._width=n.width,this._height=n.height,this._delay=d,this._initialized=!1,this._handler=this._handleResize.bind(this)}return i.prototype._handleResize=function(){var i=this;clearTimeout(this._timer),this._timer=setTimeout(function(){i.update()},this._delay)},Object.defineProperty(i.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),i.prototype.update=function(){this._width=window.innerWidth,this._height=window.innerHeight},i.prototype.setDelay=function(i){this._delay=i},i.prototype.init=function(){return"undefined"==typeof window||this.initialized||(this.update(),window.addEventListener("resize",this._handler),this._initialized=!0),this},i.prototype.destroy=function(){return this.initialized&&(window.removeEventListener("resize",this._handler),this._initialized=!1),this},i}(),windowSize=(new WindowSize).init(),vm=new Vue({data:{windowSize:windowSize}}),mixin={computed:{windowWidth:function(){return vm.windowSize.width},windowHeight:function(){return vm.windowSize.height}}},vueWindowSizeMixin=mixin,vueWindowSize={setDelay:function(i){windowSize.setDelay(i)},init:function(){windowSize.init()},destroy:function(){windowSize.destroy()}},state={installed:!1};function install(i,e){var t=(void 0===e?{}:e).delay,n=void 0===t?50:t;state.installed||(state.installed=!0,windowSize.setDelay(n),i.mixin({mixins:[mixin]}))}var plugin={install:install},GlobalVue=null;"undefined"!=typeof window?GlobalVue=window.Vue:"undefined"!=typeof global&&(GlobalVue=global.Vue),GlobalVue&&GlobalVue.use(plugin),exports.default=plugin,exports.vueWindowSize=vueWindowSize,exports.vueWindowSizeMixin=vueWindowSizeMixin; | ||
"use strict";function _interopDefault(i){return i&&"object"==typeof i&&"default"in i?i.default:i}Object.defineProperty(exports,"__esModule",{value:!0});var Vue=_interopDefault(require("vue")),WindowSize=function(){function i(i){var e=void 0===i?{}:i,t=e.defaults,n=void 0===t?{width:800,height:600}:t,o=e.delay,d=void 0===o?50:o;this._width=n.width,this._height=n.height,this._delay=d,this._initialized=!1,this._handler=this._handleResize.bind(this)}return i.prototype._handleResize=function(){var i=this;clearTimeout(this._timer),this._timer=setTimeout(function(){i.update()},this._delay)},Object.defineProperty(i.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),i.prototype.update=function(){this._width=window.innerWidth,this._height=window.innerHeight},i.prototype.setDelay=function(i){this._delay=i},i.prototype.init=function(){return"undefined"==typeof window||this.initialized||(this.update(),window.addEventListener("resize",this._handler),this._initialized=!0),this},i.prototype.destroy=function(){return this.initialized&&(window.removeEventListener("resize",this._handler),this._initialized=!1),this},i}(),windowSize=(new WindowSize).init(),vm="function"==typeof Vue.observable?Vue.observable({windowSize:windowSize}):new Vue({data:{windowSize:windowSize}}),mixin={computed:{windowWidth:function(){return vm.windowSize.width},windowHeight:function(){return vm.windowSize.height}}},vueWindowSizeMixin=mixin,vueWindowSize={setDelay:function(i){windowSize.setDelay(i)},init:function(){windowSize.init()},destroy:function(){windowSize.destroy()}},state={installed:!1};function install(i,e){var t=(void 0===e?{}:e).delay,n=void 0===t?50:t;state.installed||(state.installed=!0,windowSize.setDelay(n),i.mixin({mixins:[mixin]}))}var plugin={install:install},GlobalVue=null;"undefined"!=typeof window?GlobalVue=window.Vue:"undefined"!=typeof global&&(GlobalVue=global.Vue),GlobalVue&&GlobalVue.use(plugin),exports.default=plugin,exports.vueWindowSize=vueWindowSize,exports.vueWindowSizeMixin=vueWindowSizeMixin; |
@@ -1,1 +0,1 @@ | ||
!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],i):i(((e="undefined"!=typeof globalThis?globalThis:e||self).bundle=e.bundle||{},e.bundle.umd=e.bundle.umd||{},e.bundle.umd.js={}),e.Vue)}(this,function(e,i){"use strict";function t(e){var i=void 0===e?{}:e,t=i.defaults,n=void 0===t?{width:800,height:600}:t,d=i.delay,o=void 0===d?50:d;this._width=n.width,this._height=n.height,this._delay=o,this._initialized=!1,this._handler=this._handleResize.bind(this)}i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i;var d=(new(t.prototype._handleResize=function(){var e=this;clearTimeout(this._timer),this._timer=setTimeout(function(){e.update()},this._delay)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),t.prototype.update=function(){this._width=window.innerWidth,this._height=window.innerHeight},t.prototype.setDelay=function(e){this._delay=e},t.prototype.init=function(){return"undefined"==typeof window||this.initialized||(this.update(),window.addEventListener("resize",this._handler),this._initialized=!0),this},t.prototype.destroy=function(){return this.initialized&&(window.removeEventListener("resize",this._handler),this._initialized=!1),this},t)).init(),n=new i({data:{windowSize:d}}),o={computed:{windowWidth:function(){return n.windowSize.width},windowHeight:function(){return n.windowSize.height}}},u=o,r={setDelay:function(e){d.setDelay(e)},init:function(){d.init()},destroy:function(){d.destroy()}},l={installed:!1};var h={install:function(e,i){var t=(void 0===i?{}:i).delay,n=void 0===t?50:t;l.installed||(l.installed=!0,d.setDelay(n),e.mixin({mixins:[o]}))}},s=null;"undefined"!=typeof window?s=window.Vue:"undefined"!=typeof global&&(s=global.Vue),s&&s.use(h),e.default=h,e.vueWindowSize=r,e.vueWindowSizeMixin=u,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],i):i(((e="undefined"!=typeof globalThis?globalThis:e||self).bundle=e.bundle||{},e.bundle.umd=e.bundle.umd||{},e.bundle.umd.js={}),e.Vue)}(this,function(e,i){"use strict";function t(e){var i=void 0===e?{}:e,t=i.defaults,n=void 0===t?{width:800,height:600}:t,o=i.delay,d=void 0===o?50:o;this._width=n.width,this._height=n.height,this._delay=d,this._initialized=!1,this._handler=this._handleResize.bind(this)}i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i;var o=(new(t.prototype._handleResize=function(){var e=this;clearTimeout(this._timer),this._timer=setTimeout(function(){e.update()},this._delay)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),t.prototype.update=function(){this._width=window.innerWidth,this._height=window.innerHeight},t.prototype.setDelay=function(e){this._delay=e},t.prototype.init=function(){return"undefined"==typeof window||this.initialized||(this.update(),window.addEventListener("resize",this._handler),this._initialized=!0),this},t.prototype.destroy=function(){return this.initialized&&(window.removeEventListener("resize",this._handler),this._initialized=!1),this},t)).init(),n="function"==typeof i.observable?i.observable({windowSize:o}):new i({data:{windowSize:o}}),d={computed:{windowWidth:function(){return n.windowSize.width},windowHeight:function(){return n.windowSize.height}}},u=d,r={setDelay:function(e){o.setDelay(e)},init:function(){o.init()},destroy:function(){o.destroy()}},l={installed:!1};var s={install:function(e,i){var t=(void 0===i?{}:i).delay,n=void 0===t?50:t;l.installed||(l.installed=!0,o.setDelay(n),e.mixin({mixins:[d]}))}},h=null;"undefined"!=typeof window?h=window.Vue:"undefined"!=typeof global&&(h=global.Vue),h&&h.use(s),e.default=s,e.vueWindowSize=r,e.vueWindowSizeMixin=u,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "vue-window-size", | ||
"version": "0.3.0", | ||
"version": "0.4.0-0", | ||
"description": "Reactivity window size for Vue.js.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.common.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10509