From 882da5156634f7199df2e1997b5981abf6964909 Mon Sep 17 00:00:00 2001 From: Amphiluke Date: Wed, 4 Dec 2019 18:09:06 +0700 Subject: [PATCH] Bump version and rebuild --- dist/handy-scroll.esm.js | 2 +- dist/handy-scroll.esm.min.js | 2 +- dist/handy-scroll.umd.js | 2 +- dist/handy-scroll.umd.min.js | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/handy-scroll.esm.js b/dist/handy-scroll.esm.js index 76a77d7..0782e17 100644 --- a/dist/handy-scroll.esm.js +++ b/dist/handy-scroll.esm.js @@ -1,5 +1,5 @@ /*! -vue-handy-scroll v1.0.0 +vue-handy-scroll v1.0.1 https://amphiluke.github.io/vue-handy-scroll/dist/ */ import Vue from 'vue'; diff --git a/dist/handy-scroll.esm.min.js b/dist/handy-scroll.esm.min.js index eb7d68d..c0ae9d0 100644 --- a/dist/handy-scroll.esm.min.js +++ b/dist/handy-scroll.esm.min.js @@ -1,5 +1,5 @@ /*! -vue-handy-scroll v1.0.0 +vue-handy-scroll v1.0.1 https://amphiluke.github.io/vue-handy-scroll/dist/ */ import e from"vue";var t=new e,n={props:{customViewport:{type:Boolean,default:!1},unobtrusive:{type:Boolean,default:!1}},skipSyncContainer:!1,skipSyncWidget:!1,data:()=>({visible:!0}),mounted(){this.queueUpdate().then(()=>{this.addEventHandlers()})},methods:{queueUpdate(){let e=this;return e.$nextTick().then(()=>{e.update(),e.$options.skipSyncContainer=e.$options.skipSyncWidget=!1})},addEventHandlers(){let e=this;if(!e.$refs.scrollBody){let t=()=>e.checkVisibility(),n=()=>e.update();window.addEventListener("scroll",t,!1),window.addEventListener("resize",n,!1),e.$once("hook:beforeDestroy",()=>{window.removeEventListener("scroll",t,!1),window.removeEventListener("resize",n,!1)})}t.$on("update",({sourceElement:t}={})=>{t&&!e.$el.contains(t)||e.queueUpdate()})},handleWidgetScroll(){let e=this;e.visible&&!e.$options.skipSyncContainer&&e.syncContainer(),e.$options.skipSyncContainer=!1},handleContainerScroll(){let e=this;e.$options.skipSyncWidget||e.syncWidget(),e.$options.skipSyncWidget=!1},handleContainerFocus(){setTimeout(()=>this.syncWidget(),0)},checkVisibility(){let e=this,{widget:t,container:n,scrollBody:o}=e.$refs,i=t.scrollWidth<=t.offsetWidth;if(!i){let e=n.getBoundingClientRect(),t=o?o.getBoundingClientRect().bottom:window.innerHeight||document.documentElement.clientHeight;i=e.bottom<=t||e.top>t}e.visible===i&&(e.visible=!i)},syncContainer(){let{widget:e,container:t}=this.$refs,{scrollLeft:n}=e;t.scrollLeft!==n&&(this.$options.skipSyncWidget=!0,t.scrollLeft=n)},syncWidget(){let{widget:e,container:t}=this.$refs,{scrollLeft:n}=t;e.scrollLeft!==n&&(this.$options.skipSyncContainer=!0,e.scrollLeft=n)},update(){let{widget:e,strut:t,container:n,scrollBody:o}=this.$refs,{style:i}=e,{clientWidth:s,scrollWidth:l}=n;i.width=`${s}px`,o||(i.left=`${n.getBoundingClientRect().left}px`),t.style.width=`${l}px`,l>s&&(i.height=`${e.offsetHeight-e.clientHeight+1}px`),this.syncWidget(),this.checkVisibility()}}};const o="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());let i;const s={};const l=function(e,t,n,o,i,s,l,d,a,r){"boolean"!=typeof l&&(a=d,d=l,l=!1);const c="function"==typeof n?n.options:n;let h;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,i&&(c.functional=!0)),o&&(c._scopeId=o),s?(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(s)},c._ssrRegister=h):t&&(h=l?function(e){t.call(this,r(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,d(e))}),h)if(c.functional){const e=c.render;c.render=function(t,n){return h.call(n),e(t,n)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,h):[h]}return n}({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.customViewport?n("div",{staticClass:"handy-scroll-viewport"},[e._t("viewport-before"),n("div",{ref:"scrollBody",staticClass:"handy-scroll-body",on:{scroll:e.checkVisibility}},[e._t("body-before"),n("div",{ref:"container",staticClass:"handy-scroll-area",class:{"handy-scroll-unobtrusive":e.unobtrusive},on:{scroll:e.handleContainerScroll,focusin:e.handleContainerFocus}},[e._t("default"),n("div",{ref:"widget",staticClass:"handy-scroll",class:{"handy-scroll-hidden":!e.visible},on:{scroll:e.handleWidgetScroll}},[n("div",{ref:"strut"})])],2),e._t("body-after")],2),e._t("viewport-after")],2):n("div",{ref:"container",staticClass:"handy-scroll-area",class:{"handy-scroll-unobtrusive":e.unobtrusive},on:{scroll:e.handleContainerScroll,focusin:e.handleContainerFocus}},[e._t("default"),n("div",{ref:"widget",staticClass:"handy-scroll",class:{"handy-scroll-hidden":!e.visible},on:{scroll:e.handleWidgetScroll}},[n("div",{ref:"strut"})])],2)},staticRenderFns:[]},(function(e){e&&e("data-v-2d44a402_0",{source:'.handy-scroll[data-v-2d44a402]{bottom:0;min-height:17px;overflow:auto;position:fixed}.handy-scroll div[data-v-2d44a402]{height:1px;overflow:hidden;pointer-events:none}.handy-scroll div[data-v-2d44a402]:before{content:"\\A0"}.handy-scroll[data-v-2d44a402],.handy-scroll div[data-v-2d44a402]{font-size:1px;line-height:0;margin:0;padding:0}.handy-scroll-hidden[data-v-2d44a402]{bottom:9999px}.handy-scroll-hidden div[data-v-2d44a402]:before{content:"\\A0\\A0"}.handy-scroll-viewport[data-v-2d44a402]{position:relative}.handy-scroll-area[data-v-2d44a402],.handy-scroll-body[data-v-2d44a402]{overflow:auto}.handy-scroll-viewport .handy-scroll[data-v-2d44a402]{left:0;position:absolute}.handy-scroll-unobtrusive .handy-scroll[data-v-2d44a402]{opacity:0;transition:opacity .5s ease .3s}.handy-scroll-unobtrusive:hover .handy-scroll[data-v-2d44a402]{opacity:1}',map:void 0,media:void 0})}),n,"data-v-2d44a402",!1,void 0,!1,(function(e){return(e,t)=>(function(e,t){const n=o?t.media||"default":e,l=s[n]||(s[n]={ids:new Set,styles:[]});if(!l.ids.has(e)){l.ids.add(e);let n=t.source;if(t.map&&(n+="\n/*# sourceURL="+t.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),l.element||(l.element=document.createElement("style"),l.element.type="text/css",t.media&&l.element.setAttribute("media",t.media),void 0===i&&(i=document.head||document.getElementsByTagName("head")[0]),i.appendChild(l.element)),"styleSheet"in l.element)l.styles.push(n),l.element.styleSheet.cssText=l.styles.filter(Boolean).join("\n");else{const e=l.ids.size-1,t=document.createTextNode(n),o=l.element.childNodes;o[e]&&l.element.removeChild(o[e]),o.length?l.element.insertBefore(t,o[e]):l.element.appendChild(t)}}})(e,t)}),void 0,void 0);function d(e){d.installed||(Object.defineProperty(d,"installed",{value:!0}),e.component("HandyScroll",l))}let a=null;"undefined"!=typeof window?a=window.Vue:"undefined"!=typeof global&&(a=global.Vue),a&&a.use({install:d});export default l;export{t as EventBus,d as install}; diff --git a/dist/handy-scroll.umd.js b/dist/handy-scroll.umd.js index 90e2d4c..3e46ade 100644 --- a/dist/handy-scroll.umd.js +++ b/dist/handy-scroll.umd.js @@ -1,5 +1,5 @@ /*! -vue-handy-scroll v1.0.0 +vue-handy-scroll v1.0.1 https://amphiluke.github.io/vue-handy-scroll/dist/ */ (function (global, factory) { diff --git a/dist/handy-scroll.umd.min.js b/dist/handy-scroll.umd.min.js index 3fa6f14..0e5fe48 100644 --- a/dist/handy-scroll.umd.min.js +++ b/dist/handy-scroll.umd.min.js @@ -1,5 +1,5 @@ /*! -vue-handy-scroll v1.0.0 +vue-handy-scroll v1.0.1 https://amphiluke.github.io/vue-handy-scroll/dist/ */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e=e||self).HandyScroll={},e.Vue)}(this,(function(e,t){"use strict";var n=new(t=t&&t.hasOwnProperty("default")?t.default:t),i={props:{customViewport:{type:Boolean,default:!1},unobtrusive:{type:Boolean,default:!1}},skipSyncContainer:!1,skipSyncWidget:!1,data:function(){return{visible:!0}},mounted:function(){var e=this;this.queueUpdate().then((function(){e.addEventHandlers()}))},methods:{queueUpdate:function(){var e=this;return e.$nextTick().then((function(){e.update(),e.$options.skipSyncContainer=e.$options.skipSyncWidget=!1}))},addEventHandlers:function(){var e=this;if(!e.$refs.scrollBody){var t=function(){return e.checkVisibility()},i=function(){return e.update()};window.addEventListener("scroll",t,!1),window.addEventListener("resize",i,!1),e.$once("hook:beforeDestroy",(function(){window.removeEventListener("scroll",t,!1),window.removeEventListener("resize",i,!1)}))}n.$on("update",(function(t){void 0===t&&(t={});var n=t.sourceElement;n&&!e.$el.contains(n)||e.queueUpdate()}))},handleWidgetScroll:function(){this.visible&&!this.$options.skipSyncContainer&&this.syncContainer(),this.$options.skipSyncContainer=!1},handleContainerScroll:function(){this.$options.skipSyncWidget||this.syncWidget(),this.$options.skipSyncWidget=!1},handleContainerFocus:function(){var e=this;setTimeout((function(){return e.syncWidget()}),0)},checkVisibility:function(){var e=this.$refs,t=e.widget,n=e.container,i=e.scrollBody,o=t.scrollWidth<=t.offsetWidth;if(!o){var s=n.getBoundingClientRect(),a=i?i.getBoundingClientRect().bottom:window.innerHeight||document.documentElement.clientHeight;o=s.bottom<=a||s.top>a}this.visible===o&&(this.visible=!o)},syncContainer:function(){var e=this.$refs,t=e.widget,n=e.container,i=t.scrollLeft;n.scrollLeft!==i&&(this.$options.skipSyncWidget=!0,n.scrollLeft=i)},syncWidget:function(){var e=this.$refs,t=e.widget,n=e.container.scrollLeft;t.scrollLeft!==n&&(this.$options.skipSyncContainer=!0,t.scrollLeft=n)},update:function(){var e=this.$refs,t=e.widget,n=e.strut,i=e.container,o=e.scrollBody,s=t.style,a=i.clientWidth,d=i.scrollWidth;s.width=a+"px",o||(s.left=i.getBoundingClientRect().left+"px"),n.style.width=d+"px",d>a&&(s.height=t.offsetHeight-t.clientHeight+1+"px"),this.syncWidget(),this.checkVisibility()}}};var o,s="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());var a={};var d=function(e,t,n,i,o,s,a,d,r,l){"boolean"!=typeof a&&(r=d,d=a,a=!1);var c,u="function"==typeof n?n.options:n;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,o&&(u.functional=!0)),i&&(u._scopeId=i),s?(c=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,r(e)),e&&e._registeredComponents&&e._registeredComponents.add(s)},u._ssrRegister=c):t&&(c=a?function(e){t.call(this,l(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,d(e))}),c)if(u.functional){var f=u.render;u.render=function(e,t){return c.call(t),f(e,t)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,c):[c]}return n}({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.customViewport?n("div",{staticClass:"handy-scroll-viewport"},[e._t("viewport-before"),n("div",{ref:"scrollBody",staticClass:"handy-scroll-body",on:{scroll:e.checkVisibility}},[e._t("body-before"),n("div",{ref:"container",staticClass:"handy-scroll-area",class:{"handy-scroll-unobtrusive":e.unobtrusive},on:{scroll:e.handleContainerScroll,focusin:e.handleContainerFocus}},[e._t("default"),n("div",{ref:"widget",staticClass:"handy-scroll",class:{"handy-scroll-hidden":!e.visible},on:{scroll:e.handleWidgetScroll}},[n("div",{ref:"strut"})])],2),e._t("body-after")],2),e._t("viewport-after")],2):n("div",{ref:"container",staticClass:"handy-scroll-area",class:{"handy-scroll-unobtrusive":e.unobtrusive},on:{scroll:e.handleContainerScroll,focusin:e.handleContainerFocus}},[e._t("default"),n("div",{ref:"widget",staticClass:"handy-scroll",class:{"handy-scroll-hidden":!e.visible},on:{scroll:e.handleWidgetScroll}},[n("div",{ref:"strut"})])],2)},staticRenderFns:[]},(function(e){e&&e("data-v-2d44a402_0",{source:'.handy-scroll[data-v-2d44a402]{bottom:0;min-height:17px;overflow:auto;position:fixed}.handy-scroll div[data-v-2d44a402]{height:1px;overflow:hidden;pointer-events:none}.handy-scroll div[data-v-2d44a402]:before{content:"\\A0"}.handy-scroll[data-v-2d44a402],.handy-scroll div[data-v-2d44a402]{font-size:1px;line-height:0;margin:0;padding:0}.handy-scroll-hidden[data-v-2d44a402]{bottom:9999px}.handy-scroll-hidden div[data-v-2d44a402]:before{content:"\\A0\\A0"}.handy-scroll-viewport[data-v-2d44a402]{position:relative}.handy-scroll-area[data-v-2d44a402],.handy-scroll-body[data-v-2d44a402]{overflow:auto}.handy-scroll-viewport .handy-scroll[data-v-2d44a402]{left:0;position:absolute}.handy-scroll-unobtrusive .handy-scroll[data-v-2d44a402]{opacity:0;transition:opacity .5s ease .3s}.handy-scroll-unobtrusive:hover .handy-scroll[data-v-2d44a402]{opacity:1}',map:void 0,media:void 0})}),i,"data-v-2d44a402",!1,void 0,!1,(function(e){return function(e,t){return function(e,t){var n=s?t.media||"default":e,i=a[n]||(a[n]={ids:new Set,styles:[]});if(!i.ids.has(e)){i.ids.add(e);var d=t.source;if(t.map&&(d+="\n/*# sourceURL="+t.map.sources[0]+" */",d+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),i.element||(i.element=document.createElement("style"),i.element.type="text/css",t.media&&i.element.setAttribute("media",t.media),void 0===o&&(o=document.head||document.getElementsByTagName("head")[0]),o.appendChild(i.element)),"styleSheet"in i.element)i.styles.push(d),i.element.styleSheet.cssText=i.styles.filter(Boolean).join("\n");else{var r=i.ids.size-1,l=document.createTextNode(d),c=i.element.childNodes;c[r]&&i.element.removeChild(c[r]),c.length?i.element.insertBefore(l,c[r]):i.element.appendChild(l)}}}(e,t)}}),void 0,void 0);function r(e){r.installed||(Object.defineProperty(r,"installed",{value:!0}),e.component("HandyScroll",d))}var l=null;"undefined"!=typeof window?l=window.Vue:"undefined"!=typeof global&&(l=global.Vue),l&&l.use({install:r}),e.EventBus=n,e.default=d,e.install=r,Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/package-lock.json b/package-lock.json index bf098af..0406b56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vue-handy-scroll", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d6093cd..ab44a01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-handy-scroll", - "version": "1.0.0", + "version": "1.0.1", "description": "Handy floating scrollbar component for Vue.js", "main": "dist/handy-scroll.umd.js", "module": "dist/handy-scroll.esm.js",