vue-resize
Advanced tools
Comparing version 0.5.0 to 1.0.0
@@ -1,2 +0,2 @@ | ||
import babel from 'rollup-plugin-babel' | ||
import { babel } from '@rollup/plugin-babel' | ||
import resolve from '@rollup/plugin-node-resolve' | ||
@@ -6,3 +6,3 @@ import vue from 'rollup-plugin-vue' | ||
import replace from '@rollup/plugin-replace' | ||
import { eslint } from 'rollup-plugin-eslint' | ||
import eslint from '@rollup/plugin-eslint' | ||
import css from 'rollup-plugin-css-only' | ||
@@ -9,0 +9,0 @@ import autoprefixer from 'autoprefixer' |
@@ -30,5 +30,6 @@ function getInternetExplorerVersion() { | ||
// | ||
var isIE; | ||
function initCompat() { | ||
let isIE; | ||
function initCompat () { | ||
if (!initCompat.init) { | ||
@@ -42,11 +43,30 @@ initCompat.init = true; | ||
name: 'ResizeObserver', | ||
mounted: function mounted() { | ||
var _this = this; | ||
props: { | ||
emitOnMount: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
ignoreWidth: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
ignoreHeight: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
}, | ||
mounted () { | ||
initCompat(); | ||
this.$nextTick(function () { | ||
_this._w = _this.$el.offsetWidth; | ||
_this._h = _this.$el.offsetHeight; | ||
this.$nextTick(() => { | ||
this._w = this.$el.offsetWidth; | ||
this._h = this.$el.offsetHeight; | ||
if (this.emitOnMount) { | ||
this.emitSize(); | ||
} | ||
}); | ||
var object = document.createElement('object'); | ||
const object = document.createElement('object'); | ||
this._resizeObject = object; | ||
@@ -57,9 +77,6 @@ object.setAttribute('aria-hidden', 'true'); | ||
object.type = 'text/html'; | ||
if (isIE) { | ||
this.$el.appendChild(object); | ||
} | ||
object.data = 'about:blank'; | ||
if (!isIE) { | ||
@@ -69,22 +86,29 @@ this.$el.appendChild(object); | ||
}, | ||
beforeDestroy: function beforeDestroy() { | ||
beforeDestroy () { | ||
this.removeResizeHandlers(); | ||
}, | ||
methods: { | ||
compareAndNotify: function compareAndNotify() { | ||
if (this._w !== this.$el.offsetWidth || this._h !== this.$el.offsetHeight) { | ||
compareAndNotify () { | ||
if ((!this.ignoreWidth && this._w !== this.$el.offsetWidth) || (!this.ignoreHeight && this._h !== this.$el.offsetHeight)) { | ||
this._w = this.$el.offsetWidth; | ||
this._h = this.$el.offsetHeight; | ||
this.$emit('notify', { | ||
width: this._w, | ||
height: this._h | ||
}); | ||
this.emitSize(); | ||
} | ||
}, | ||
addResizeHandlers: function addResizeHandlers() { | ||
emitSize () { | ||
this.$emit('notify', { | ||
width: this._w, | ||
height: this._h, | ||
}); | ||
}, | ||
addResizeHandlers () { | ||
this._resizeObject.contentDocument.defaultView.addEventListener('resize', this.compareAndNotify); | ||
this.compareAndNotify(); | ||
}, | ||
removeResizeHandlers: function removeResizeHandlers() { | ||
removeResizeHandlers () { | ||
if (this._resizeObject && this._resizeObject.onload) { | ||
@@ -94,3 +118,2 @@ if (!isIE && this._resizeObject.contentDocument) { | ||
} | ||
this.$el.removeChild(this._resizeObject); | ||
@@ -100,79 +123,87 @@ this._resizeObject.onload = null; | ||
} | ||
}, | ||
}, | ||
}; | ||
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier | ||
/* server only */ | ||
, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { | ||
if (typeof shadowMode !== 'boolean') { | ||
createInjectorSSR = createInjector; | ||
createInjector = shadowMode; | ||
shadowMode = false; | ||
} // Vue.extend constructor export interop. | ||
var options = typeof script === 'function' ? script.options : script; // render functions | ||
if (template && template.render) { | ||
options.render = template.render; | ||
options.staticRenderFns = template.staticRenderFns; | ||
options._compiled = true; // functional template | ||
if (isFunctionalTemplate) { | ||
options.functional = true; | ||
} | ||
} // scopedId | ||
if (scopeId) { | ||
options._scopeId = scopeId; | ||
} | ||
}; | ||
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { | ||
if (typeof shadowMode !== 'boolean') { | ||
createInjectorSSR = createInjector; | ||
createInjector = shadowMode; | ||
shadowMode = false; | ||
var hook; | ||
if (moduleIdentifier) { | ||
// server build | ||
hook = function hook(context) { | ||
// 2.3 injection | ||
context = context || // cached call | ||
this.$vnode && this.$vnode.ssrContext || // stateful | ||
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional | ||
// 2.2 with runInNewContext: true | ||
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { | ||
context = __VUE_SSR_CONTEXT__; | ||
} // inject component styles | ||
if (style) { | ||
style.call(this, createInjectorSSR(context)); | ||
} // register component module identifier for async chunk inference | ||
if (context && context._registeredComponents) { | ||
context._registeredComponents.add(moduleIdentifier); | ||
} | ||
}; // used by ssr in case component is cached and beforeCreate | ||
// never gets called | ||
options._ssrRegister = hook; | ||
} else if (style) { | ||
hook = shadowMode ? function (context) { | ||
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot)); | ||
} : function (context) { | ||
style.call(this, createInjector(context)); | ||
}; | ||
} | ||
if (hook) { | ||
if (options.functional) { | ||
// register for functional component in vue file | ||
var originalRender = options.render; | ||
options.render = function renderWithStyleInjection(h, context) { | ||
hook.call(context); | ||
return originalRender(h, context); | ||
}; | ||
} else { | ||
// inject component registration as beforeCreate hook | ||
var existing = options.beforeCreate; | ||
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; | ||
} | ||
// Vue.extend constructor export interop. | ||
const options = typeof script === 'function' ? script.options : script; | ||
// render functions | ||
if (template && template.render) { | ||
options.render = template.render; | ||
options.staticRenderFns = template.staticRenderFns; | ||
options._compiled = true; | ||
// functional template | ||
if (isFunctionalTemplate) { | ||
options.functional = true; | ||
} | ||
} | ||
// scopedId | ||
if (scopeId) { | ||
options._scopeId = scopeId; | ||
} | ||
let hook; | ||
if (moduleIdentifier) { | ||
// server build | ||
hook = function (context) { | ||
// 2.3 injection | ||
context = | ||
context || // cached call | ||
(this.$vnode && this.$vnode.ssrContext) || // stateful | ||
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional | ||
// 2.2 with runInNewContext: true | ||
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { | ||
context = __VUE_SSR_CONTEXT__; | ||
} | ||
// inject component styles | ||
if (style) { | ||
style.call(this, createInjectorSSR(context)); | ||
} | ||
// register component module identifier for async chunk inference | ||
if (context && context._registeredComponents) { | ||
context._registeredComponents.add(moduleIdentifier); | ||
} | ||
}; | ||
// used by ssr in case component is cached and beforeCreate | ||
// never gets called | ||
options._ssrRegister = hook; | ||
} | ||
else if (style) { | ||
hook = shadowMode | ||
? function (context) { | ||
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot)); | ||
} | ||
: function (context) { | ||
style.call(this, createInjector(context)); | ||
}; | ||
} | ||
if (hook) { | ||
if (options.functional) { | ||
// register for functional component in vue file | ||
const originalRender = options.render; | ||
options.render = function renderWithStyleInjection(h, context) { | ||
hook.call(context); | ||
return originalRender(h, context); | ||
}; | ||
} | ||
else { | ||
// inject component registration as beforeCreate hook | ||
const existing = options.beforeCreate; | ||
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; | ||
} | ||
} | ||
return script; | ||
} | ||
return script; | ||
} | ||
@@ -198,3 +229,3 @@ | ||
/* scoped */ | ||
const __vue_scope_id__ = "data-v-2b830392"; | ||
const __vue_scope_id__ = "data-v-8859cc6c"; | ||
/* module identifier */ | ||
@@ -212,3 +243,3 @@ const __vue_module_identifier__ = undefined; | ||
const __vue_component__ = normalizeComponent( | ||
const __vue_component__ = /*#__PURE__*/normalizeComponent( | ||
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, | ||
@@ -227,2 +258,3 @@ __vue_inject_styles__, | ||
function install(Vue) { | ||
// eslint-disable-next-line vue/component-definition-name-casing | ||
Vue.component('resize-observer', __vue_component__); | ||
@@ -234,3 +266,3 @@ Vue.component('ResizeObserver', __vue_component__); | ||
// eslint-disable-next-line no-undef | ||
version: "0.5.0", | ||
version: "1.0.0", | ||
install: install | ||
@@ -237,0 +269,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
var VueResize=function(e){"use strict";var t;function i(){i.init||(i.init=!0,t=-1!==function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var i=e.indexOf("rv:");return parseInt(e.substring(i+3,e.indexOf(".",i)),10)}var n=e.indexOf("Edge/");return n>0?parseInt(e.substring(n+5,e.indexOf(".",n)),10):-1}())}const n={name:"ResizeObserver",mounted:function(){var e=this;i(),this.$nextTick((function(){e._w=e.$el.offsetWidth,e._h=e.$el.offsetHeight}));var n=document.createElement("object");this._resizeObject=n,n.setAttribute("aria-hidden","true"),n.setAttribute("tabindex",-1),n.onload=this.addResizeHandlers,n.type="text/html",t&&this.$el.appendChild(n),n.data="about:blank",t||this.$el.appendChild(n)},beforeDestroy:function(){this.removeResizeHandlers()},methods:{compareAndNotify:function(){this._w===this.$el.offsetWidth&&this._h===this.$el.offsetHeight||(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.$emit("notify",{width:this._w,height:this._h}))},addResizeHandlers:function(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers:function(){this._resizeObject&&this._resizeObject.onload&&(!t&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};var s=function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"resize-observer",attrs:{tabindex:"-1"}})};s._withStripped=!0;const r=function(e,t,i,n,s,r,o,d,a,c){"boolean"!=typeof o&&(a=d,d=o,o=!1);const f="function"==typeof i?i.options:i;let h;if(e&&e.render&&(f.render=e.render,f.staticRenderFns=e.staticRenderFns,f._compiled=!0,s&&(f.functional=!0)),n&&(f._scopeId=n),r?(h=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,a(e)),e&&e._registeredComponents&&e._registeredComponents.add(r)},f._ssrRegister=h):t&&(h=o?function(e){t.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,d(e))}),h)if(f.functional){const e=f.render;f.render=function(t,i){return h.call(i),e(t,i)}}else{const e=f.beforeCreate;f.beforeCreate=e?[].concat(e,h):[h]}return i}({render:s,staticRenderFns:[]},void 0,n,"data-v-2b830392",!1,void 0,!1,void 0,void 0,void 0);function o(e){e.component("resize-observer",r),e.component("ResizeObserver",r)}var d={version:"0.5.0",install:o},a=null;return"undefined"!=typeof window?a=window.Vue:"undefined"!=typeof global&&(a=global.Vue),a&&a.use(d),e.ResizeObserver=r,e.default=d,e.install=o,e}({}); | ||
var VueResize=function(e){"use strict";let t;function i(){i.init||(i.init=!0,t=-1!==function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var i=e.indexOf("rv:");return parseInt(e.substring(i+3,e.indexOf(".",i)),10)}var n=e.indexOf("Edge/");return n>0?parseInt(e.substring(n+5,e.indexOf(".",n)),10):-1}())}function n(e,t,i,n,s,r,o,d,a,h){"boolean"!=typeof o&&(a=d,d=o,o=!1);var l,c="function"==typeof i?i.options:i;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,s&&(c.functional=!0)),n&&(c._scopeId=n),r?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,a(e)),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=l):t&&(l=o?function(e){t.call(this,h(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,d(e))}),l)if(c.functional){var f=c.render;c.render=function(e,t){return l.call(t),f(e,t)}}else{var u=c.beforeCreate;c.beforeCreate=u?[].concat(u,l):[l]}return i}const s={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},mounted(){i(),this.$nextTick(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",t&&this.$el.appendChild(e),e.data="about:blank",t||this.$el.appendChild(e)},beforeDestroy(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!t&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};var r=function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"resize-observer",attrs:{tabindex:"-1"}})};r._withStripped=!0;const o=n({render:r,staticRenderFns:[]},void 0,s,"data-v-8859cc6c",!1,void 0,!1,void 0,void 0,void 0);function d(e){e.component("resize-observer",o),e.component("ResizeObserver",o)}var a={version:"1.0.0",install:d},h=null;return"undefined"!=typeof window?h=window.Vue:"undefined"!=typeof global&&(h=global.Vue),h&&h.use(a),e.ResizeObserver=o,e.default=a,e.install=d,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); | ||
//# sourceMappingURL=vue-resize.min.js.map |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(global = global || self, factory(global['vue-resize'] = {})); | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['vue-resize'] = {})); | ||
}(this, (function (exports) { 'use strict'; | ||
@@ -36,5 +36,6 @@ | ||
// | ||
var isIE; | ||
function initCompat() { | ||
let isIE; | ||
function initCompat () { | ||
if (!initCompat.init) { | ||
@@ -48,11 +49,30 @@ initCompat.init = true; | ||
name: 'ResizeObserver', | ||
mounted: function mounted() { | ||
var _this = this; | ||
props: { | ||
emitOnMount: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
ignoreWidth: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
ignoreHeight: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
}, | ||
mounted () { | ||
initCompat(); | ||
this.$nextTick(function () { | ||
_this._w = _this.$el.offsetWidth; | ||
_this._h = _this.$el.offsetHeight; | ||
this.$nextTick(() => { | ||
this._w = this.$el.offsetWidth; | ||
this._h = this.$el.offsetHeight; | ||
if (this.emitOnMount) { | ||
this.emitSize(); | ||
} | ||
}); | ||
var object = document.createElement('object'); | ||
const object = document.createElement('object'); | ||
this._resizeObject = object; | ||
@@ -63,9 +83,6 @@ object.setAttribute('aria-hidden', 'true'); | ||
object.type = 'text/html'; | ||
if (isIE) { | ||
this.$el.appendChild(object); | ||
} | ||
object.data = 'about:blank'; | ||
if (!isIE) { | ||
@@ -75,22 +92,29 @@ this.$el.appendChild(object); | ||
}, | ||
beforeDestroy: function beforeDestroy() { | ||
beforeDestroy () { | ||
this.removeResizeHandlers(); | ||
}, | ||
methods: { | ||
compareAndNotify: function compareAndNotify() { | ||
if (this._w !== this.$el.offsetWidth || this._h !== this.$el.offsetHeight) { | ||
compareAndNotify () { | ||
if ((!this.ignoreWidth && this._w !== this.$el.offsetWidth) || (!this.ignoreHeight && this._h !== this.$el.offsetHeight)) { | ||
this._w = this.$el.offsetWidth; | ||
this._h = this.$el.offsetHeight; | ||
this.$emit('notify', { | ||
width: this._w, | ||
height: this._h | ||
}); | ||
this.emitSize(); | ||
} | ||
}, | ||
addResizeHandlers: function addResizeHandlers() { | ||
emitSize () { | ||
this.$emit('notify', { | ||
width: this._w, | ||
height: this._h, | ||
}); | ||
}, | ||
addResizeHandlers () { | ||
this._resizeObject.contentDocument.defaultView.addEventListener('resize', this.compareAndNotify); | ||
this.compareAndNotify(); | ||
}, | ||
removeResizeHandlers: function removeResizeHandlers() { | ||
removeResizeHandlers () { | ||
if (this._resizeObject && this._resizeObject.onload) { | ||
@@ -100,3 +124,2 @@ if (!isIE && this._resizeObject.contentDocument) { | ||
} | ||
this.$el.removeChild(this._resizeObject); | ||
@@ -106,79 +129,87 @@ this._resizeObject.onload = null; | ||
} | ||
}, | ||
}, | ||
}; | ||
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier | ||
/* server only */ | ||
, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { | ||
if (typeof shadowMode !== 'boolean') { | ||
createInjectorSSR = createInjector; | ||
createInjector = shadowMode; | ||
shadowMode = false; | ||
} // Vue.extend constructor export interop. | ||
var options = typeof script === 'function' ? script.options : script; // render functions | ||
if (template && template.render) { | ||
options.render = template.render; | ||
options.staticRenderFns = template.staticRenderFns; | ||
options._compiled = true; // functional template | ||
if (isFunctionalTemplate) { | ||
options.functional = true; | ||
} | ||
} // scopedId | ||
if (scopeId) { | ||
options._scopeId = scopeId; | ||
} | ||
}; | ||
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { | ||
if (typeof shadowMode !== 'boolean') { | ||
createInjectorSSR = createInjector; | ||
createInjector = shadowMode; | ||
shadowMode = false; | ||
var hook; | ||
if (moduleIdentifier) { | ||
// server build | ||
hook = function hook(context) { | ||
// 2.3 injection | ||
context = context || // cached call | ||
this.$vnode && this.$vnode.ssrContext || // stateful | ||
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional | ||
// 2.2 with runInNewContext: true | ||
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { | ||
context = __VUE_SSR_CONTEXT__; | ||
} // inject component styles | ||
if (style) { | ||
style.call(this, createInjectorSSR(context)); | ||
} // register component module identifier for async chunk inference | ||
if (context && context._registeredComponents) { | ||
context._registeredComponents.add(moduleIdentifier); | ||
} | ||
}; // used by ssr in case component is cached and beforeCreate | ||
// never gets called | ||
options._ssrRegister = hook; | ||
} else if (style) { | ||
hook = shadowMode ? function (context) { | ||
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot)); | ||
} : function (context) { | ||
style.call(this, createInjector(context)); | ||
}; | ||
} | ||
if (hook) { | ||
if (options.functional) { | ||
// register for functional component in vue file | ||
var originalRender = options.render; | ||
options.render = function renderWithStyleInjection(h, context) { | ||
hook.call(context); | ||
return originalRender(h, context); | ||
}; | ||
} else { | ||
// inject component registration as beforeCreate hook | ||
var existing = options.beforeCreate; | ||
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; | ||
} | ||
// Vue.extend constructor export interop. | ||
const options = typeof script === 'function' ? script.options : script; | ||
// render functions | ||
if (template && template.render) { | ||
options.render = template.render; | ||
options.staticRenderFns = template.staticRenderFns; | ||
options._compiled = true; | ||
// functional template | ||
if (isFunctionalTemplate) { | ||
options.functional = true; | ||
} | ||
} | ||
// scopedId | ||
if (scopeId) { | ||
options._scopeId = scopeId; | ||
} | ||
let hook; | ||
if (moduleIdentifier) { | ||
// server build | ||
hook = function (context) { | ||
// 2.3 injection | ||
context = | ||
context || // cached call | ||
(this.$vnode && this.$vnode.ssrContext) || // stateful | ||
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional | ||
// 2.2 with runInNewContext: true | ||
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { | ||
context = __VUE_SSR_CONTEXT__; | ||
} | ||
// inject component styles | ||
if (style) { | ||
style.call(this, createInjectorSSR(context)); | ||
} | ||
// register component module identifier for async chunk inference | ||
if (context && context._registeredComponents) { | ||
context._registeredComponents.add(moduleIdentifier); | ||
} | ||
}; | ||
// used by ssr in case component is cached and beforeCreate | ||
// never gets called | ||
options._ssrRegister = hook; | ||
} | ||
else if (style) { | ||
hook = shadowMode | ||
? function (context) { | ||
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot)); | ||
} | ||
: function (context) { | ||
style.call(this, createInjector(context)); | ||
}; | ||
} | ||
if (hook) { | ||
if (options.functional) { | ||
// register for functional component in vue file | ||
const originalRender = options.render; | ||
options.render = function renderWithStyleInjection(h, context) { | ||
hook.call(context); | ||
return originalRender(h, context); | ||
}; | ||
} | ||
else { | ||
// inject component registration as beforeCreate hook | ||
const existing = options.beforeCreate; | ||
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; | ||
} | ||
} | ||
return script; | ||
} | ||
return script; | ||
} | ||
@@ -204,3 +235,3 @@ | ||
/* scoped */ | ||
const __vue_scope_id__ = "data-v-2b830392"; | ||
const __vue_scope_id__ = "data-v-8859cc6c"; | ||
/* module identifier */ | ||
@@ -218,3 +249,3 @@ const __vue_module_identifier__ = undefined; | ||
const __vue_component__ = normalizeComponent( | ||
const __vue_component__ = /*#__PURE__*/normalizeComponent( | ||
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, | ||
@@ -233,2 +264,3 @@ __vue_inject_styles__, | ||
function install(Vue) { | ||
// eslint-disable-next-line vue/component-definition-name-casing | ||
Vue.component('resize-observer', __vue_component__); | ||
@@ -240,3 +272,3 @@ Vue.component('ResizeObserver', __vue_component__); | ||
// eslint-disable-next-line no-undef | ||
version: "0.5.0", | ||
version: "1.0.0", | ||
install: install | ||
@@ -243,0 +275,0 @@ }; |
{ | ||
"name": "vue-resize", | ||
"description": "Detect DOM element resizing", | ||
"version": "0.5.0", | ||
"description": "Detects DOM element resizing", | ||
"version": "1.0.0", | ||
"author": { | ||
@@ -25,3 +25,4 @@ "name": "Guillaume Chau", | ||
"dev": "cross-env NODE_ENV=development rollup --config build/rollup.config.es.js --watch", | ||
"test": "yarn run build && cd ./docs-src && yarn run test" | ||
"test": "yarn run build && yarn run lint && cd ../demo && yarn run test", | ||
"lint": "eslint --ext .js,.vue src" | ||
}, | ||
@@ -33,3 +34,4 @@ "watch": { | ||
"type": "git", | ||
"url": "git+https://github.com/Akryum/vue-resize.git" | ||
"url": "git+https://github.com/Akryum/vue-resize.git", | ||
"directory": "packages/vue-resize" | ||
}, | ||
@@ -43,3 +45,5 @@ "bugs": { | ||
"@babel/preset-env": "^7.9.0", | ||
"@rollup/plugin-babel": "^5.2.2", | ||
"@rollup/plugin-commonjs": "^11.0.2", | ||
"@rollup/plugin-eslint": "^8.0.1", | ||
"@rollup/plugin-node-resolve": "^7.1.1", | ||
@@ -51,23 +55,21 @@ "@rollup/plugin-replace": "^2.3.1", | ||
"cross-env": "^7.0.2", | ||
"eslint": "^6.8.0", | ||
"eslint-config-standard": "^14.1.1", | ||
"eslint-plugin-html": "^6.0.0", | ||
"eslint-plugin-import": "^2.7.0", | ||
"eslint-plugin-node": "^11.0.0", | ||
"eslint-plugin-promise": "^4.0.1", | ||
"eslint-plugin-standard": "^4.0.0", | ||
"eslint-plugin-vue": "^6.2.2", | ||
"eslint": "^7.16.0", | ||
"eslint-config-standard": "^16.0.2", | ||
"eslint-plugin-html": "^6.1.1", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-standard": "^5.0.0", | ||
"eslint-plugin-vue": "^7.4.0", | ||
"fs-extra": "^9.0.0", | ||
"rollup": "^2.2.0", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-css-only": "^2.0.0", | ||
"rollup-plugin-css-porter": "^1.0.2", | ||
"rollup-plugin-eslint": "^7.0.0", | ||
"rollup-plugin-terser": "^5.3.0", | ||
"rollup-plugin-vue": "^5.1.6", | ||
"vue": "^2.5.17", | ||
"vue": "^2.6.11", | ||
"vue-template-compiler": "^2.6.11" | ||
}, | ||
"peerDependencies": { | ||
"vue": "^2.6.11" | ||
"vue": "^2.6.0" | ||
}, | ||
@@ -74,0 +76,0 @@ "browserslist": [ |
@@ -18,34 +18,4 @@ # vue-resize | ||
### Gold | ||
[![sponsors logos](https://guillaume-chau.info/sponsors.png)](https://guillaume-chau.info/sponsors) | ||
<p align="center"> | ||
<a href="https://www.sumcumo.com/en/" target="_blank"> | ||
<img src="https://cdn.discordapp.com/attachments/258614093362102272/570728242399674380/logo-sumcumo.png" alt="sum.cumo logo" width="400px"> | ||
</a> | ||
</p> | ||
### Silver | ||
<p align="center"> | ||
<a href="https://vueschool.io/" target="_blank"> | ||
<img src="https://vueschool.io/img/logo/vueschool_logo_multicolor.svg" alt="VueSchool logo" width="200px"> | ||
</a> | ||
<a href="https://www.vuemastery.com/" target="_blank"> | ||
<img src="https://cdn.discordapp.com/attachments/258614093362102272/557267759130607630/Vue-Mastery-Big.png" alt="Vue Mastery logo" width="200px"> | ||
</a> | ||
</p> | ||
### Bronze | ||
<p align="center"> | ||
<a href="https://vuetifyjs.com" target="_blank"> | ||
<img src="https://cdn.discordapp.com/attachments/537832759985700914/537832771691872267/Horizontal_Logo_-_Dark.png" width="100"> | ||
</a> | ||
<a href="https://www.frontenddeveloperlove.com/" target="_blank" title="Frontend Developer Love"> | ||
<img src="https://cdn.discordapp.com/attachments/258614093362102272/557267744249085953/frontend_love-logo.png" width="56"> | ||
</a> | ||
</p> | ||
<br> | ||
@@ -52,0 +22,0 @@ |
@@ -5,2 +5,3 @@ import ResizeObserver from './components/ResizeObserver.vue' | ||
export function install (Vue) { | ||
// eslint-disable-next-line vue/component-definition-name-casing | ||
Vue.component('resize-observer', ResizeObserver) | ||
@@ -7,0 +8,0 @@ Vue.component('ResizeObserver', ResizeObserver) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
0
47667
20
635
113