From e487173afb3a32125083195b9d079518eabb0261 Mon Sep 17 00:00:00 2001 From: Amphiluke Date: Wed, 14 Dec 2022 01:16:44 +0700 Subject: [PATCH] Bump package version --- 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 | 4 ++-- package.json | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dist/handy-scroll.esm.js b/dist/handy-scroll.esm.js index 7e78f87..174320c 100644 --- a/dist/handy-scroll.esm.js +++ b/dist/handy-scroll.esm.js @@ -1,5 +1,5 @@ /*! -vue-handy-scroll v3.0.1 +vue-handy-scroll v3.0.2 https://amphiluke.github.io/vue-handy-scroll/ */ import { openBlock, createElementBlock, renderSlot, createElementVNode, normalizeClass } from 'vue'; diff --git a/dist/handy-scroll.esm.min.js b/dist/handy-scroll.esm.min.js index a7fdb3e..4d95c52 100644 --- a/dist/handy-scroll.esm.min.js +++ b/dist/handy-scroll.esm.min.js @@ -1,5 +1,5 @@ /*! -vue-handy-scroll v3.0.1 +vue-handy-scroll v3.0.2 https://amphiluke.github.io/vue-handy-scroll/ */ import{openBlock as e,createElementBlock as t,renderSlot as n,createElementVNode as l,normalizeClass as i}from"vue";let o=Object.create(null),d={emit(e,...t){let n=o[e];n&&n.forEach((e=>e(...t)))},on(e,t){let n=o[e];n||(n=[],o[e]=n),n.push(t)},off(e,t){let n=o[e];if(n){let l=n.indexOf(t);l>=0&&(n.splice(l,1),n.length||delete o[e])}}};var s={EventBus:d,props:{customViewport:{type:Boolean,default:!1},unobtrusive:{type:Boolean,default:!1}},data:()=>({visible:!0}),created(){this.skipSyncContainer=this.skipSyncWidget=!1},mounted(){this.queueUpdate().then((()=>{this.addEventHandlers()}))},unmounted(){this.removeEventHandlers()},methods:{queueUpdate(){let e=this;return e.$nextTick().then((()=>{e.update(),e.skipSyncContainer=e.skipSyncWidget=!1}))},addEventHandlers(){let e=this;if(!e.$refs.scrollBody){let t=e.windowScrollHandler=()=>e.checkVisibility(),n=e.windowResizeHandler=()=>e.update();window.addEventListener("scroll",t,!1),window.addEventListener("resize",n,!1)}let t=e.updateHandler=({sourceElement:t}={})=>{t&&!e.$el.contains(t)||e.queueUpdate()};d.on("update",t)},removeEventHandlers(){let e=this;window.removeEventListener("scroll",e.windowScrollHandler,!1),window.removeEventListener("resize",e.windowResizeHandler,!1),d.off("update",e.updateHandler)},handleWidgetScroll(){let e=this;e.visible&&!e.skipSyncContainer&&e.syncContainer(),e.skipSyncContainer=!1},handleContainerScroll(){let e=this;e.skipSyncWidget||e.syncWidget(),e.skipSyncWidget=!1},handleContainerFocus(){setTimeout((()=>{this.$refs&&this.$refs.widget&&this.syncWidget()}),0)},checkVisibility(){let e=this,{widget:t,container:n,scrollBody:l}=e.$refs,i=t.scrollWidth<=t.offsetWidth;if(!i){let e=n.getBoundingClientRect(),t=l?l.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.skipSyncWidget=!0,t.scrollLeft=n)},syncWidget(){let{widget:e,container:t}=this.$refs,{scrollLeft:n}=t;e.scrollLeft!==n&&(this.skipSyncContainer=!0,e.scrollLeft=n)},update(){let{widget:e,strut:t,container:n,scrollBody:l}=this.$refs,{style:i}=e,{clientWidth:o,scrollWidth:d}=n;i.width=`${o}px`,l||(i.left=`${n.getBoundingClientRect().left}px`),t.style.width=`${d}px`,d>o&&(i.height=e.offsetHeight-e.clientHeight+1+"px"),this.syncWidget(),this.checkVisibility()}}};const r={key:0,class:"handy-scroll-viewport"},a={ref:"strut"},c={ref:"strut"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&l.firstChild?l.insertBefore(i,l.firstChild):l.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('.handy-scroll[data-v-71ecdf2e]{bottom:0;min-height:17px;overflow:auto;position:fixed}.handy-scroll div[data-v-71ecdf2e]{height:1px;overflow:hidden;pointer-events:none}.handy-scroll div[data-v-71ecdf2e]:before{content:"\\A0"}.handy-scroll div[data-v-71ecdf2e],.handy-scroll[data-v-71ecdf2e]{font-size:1px;line-height:0;margin:0;padding:0}.handy-scroll-hidden[data-v-71ecdf2e]{bottom:9999px}.handy-scroll-hidden div[data-v-71ecdf2e]:before{content:"\\A0\\A0"}.handy-scroll-viewport[data-v-71ecdf2e]{position:relative}.handy-scroll-area[data-v-71ecdf2e],.handy-scroll-body[data-v-71ecdf2e]{overflow:auto}.handy-scroll-viewport .handy-scroll[data-v-71ecdf2e]{left:0;position:absolute}.handy-scroll-unobtrusive .handy-scroll[data-v-71ecdf2e]{opacity:0;transition:opacity .5s ease .3s}.handy-scroll-unobtrusive:hover .handy-scroll[data-v-71ecdf2e]{opacity:1}'),s.render=function(o,d,s,h,f,u){return s.customViewport?(e(),t("div",r,[n(o.$slots,"viewport-before"),l("div",{ref:"scrollBody",class:"handy-scroll-body",onScroll:d[3]||(d[3]=(...e)=>u.checkVisibility&&u.checkVisibility(...e))},[n(o.$slots,"body-before"),l("div",{ref:"container",class:i(["handy-scroll-area",{"handy-scroll-unobtrusive":s.unobtrusive}]),onScroll:d[1]||(d[1]=(...e)=>u.handleContainerScroll&&u.handleContainerScroll(...e)),onFocusin:d[2]||(d[2]=(...e)=>u.handleContainerFocus&&u.handleContainerFocus(...e))},[n(o.$slots,"default"),l("div",{ref:"widget",class:i(["handy-scroll",{"handy-scroll-hidden":!f.visible}]),onScroll:d[0]||(d[0]=(...e)=>u.handleWidgetScroll&&u.handleWidgetScroll(...e))},[l("div",a,null,512)],34)],34),n(o.$slots,"body-after")],544),n(o.$slots,"viewport-after")])):(e(),t("div",{key:1,ref:"container",class:i(["handy-scroll-area",{"handy-scroll-unobtrusive":s.unobtrusive}]),onScroll:d[5]||(d[5]=(...e)=>u.handleContainerScroll&&u.handleContainerScroll(...e)),onFocusin:d[6]||(d[6]=(...e)=>u.handleContainerFocus&&u.handleContainerFocus(...e))},[n(o.$slots,"default"),l("div",{ref:"widget",class:i(["handy-scroll",{"handy-scroll-hidden":!f.visible}]),onScroll:d[4]||(d[4]=(...e)=>u.handleWidgetScroll&&u.handleWidgetScroll(...e))},[l("div",c,null,512)],34)],34))},s.__scopeId="data-v-71ecdf2e",s.__file="src/handy-scroll.vue";export{s as default}; diff --git a/dist/handy-scroll.umd.js b/dist/handy-scroll.umd.js index 1663b98..09302e3 100644 --- a/dist/handy-scroll.umd.js +++ b/dist/handy-scroll.umd.js @@ -1,5 +1,5 @@ /*! -vue-handy-scroll v3.0.1 +vue-handy-scroll v3.0.2 https://amphiluke.github.io/vue-handy-scroll/ */ (function (global, factory) { diff --git a/dist/handy-scroll.umd.min.js b/dist/handy-scroll.umd.min.js index 654d476..49ee3a5 100644 --- a/dist/handy-scroll.umd.min.js +++ b/dist/handy-scroll.umd.min.js @@ -1,5 +1,5 @@ /*! -vue-handy-scroll v3.0.1 +vue-handy-scroll v3.0.2 https://amphiluke.github.io/vue-handy-scroll/ */ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("vue")):"function"==typeof define&&define.amd?define(["vue"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).HandyScroll=n(e.Vue)}(this,(function(e){"use strict";var n=Object.create(null),t={emit:function(e){for(var t=[],o=arguments.length-1;o-- >0;)t[o]=arguments[o+1];var i=n[e];i&&i.forEach((function(e){return e.apply(void 0,t)}))},on:function(e,t){var o=n[e];o||(o=[],n[e]=o),o.push(t)},off:function(e,t){var o=n[e];if(o){var i=o.indexOf(t);i>=0&&(o.splice(i,1),o.length||delete n[e])}}},o={EventBus:t,props:{customViewport:{type:Boolean,default:!1},unobtrusive:{type:Boolean,default:!1}},data:function(){return{visible:!0}},created:function(){this.skipSyncContainer=this.skipSyncWidget=!1},mounted:function(){var e=this;this.queueUpdate().then((function(){e.addEventHandlers()}))},unmounted:function(){this.removeEventHandlers()},methods:{queueUpdate:function(){var e=this;return e.$nextTick().then((function(){e.update(),e.skipSyncContainer=e.skipSyncWidget=!1}))},addEventHandlers:function(){var e=this;if(!e.$refs.scrollBody){var n=e.windowScrollHandler=function(){return e.checkVisibility()},o=e.windowResizeHandler=function(){return e.update()};window.addEventListener("scroll",n,!1),window.addEventListener("resize",o,!1)}var i=e.updateHandler=function(n){void 0===n&&(n={});var t=n.sourceElement;t&&!e.$el.contains(t)||e.queueUpdate()};t.on("update",i)},removeEventHandlers:function(){var e=this;window.removeEventListener("scroll",e.windowScrollHandler,!1),window.removeEventListener("resize",e.windowResizeHandler,!1),t.off("update",e.updateHandler)},handleWidgetScroll:function(){var e=this;e.visible&&!e.skipSyncContainer&&e.syncContainer(),e.skipSyncContainer=!1},handleContainerScroll:function(){var e=this;e.skipSyncWidget||e.syncWidget(),e.skipSyncWidget=!1},handleContainerFocus:function(){var e=this;setTimeout((function(){e.$refs&&e.$refs.widget&&e.syncWidget()}),0)},checkVisibility:function(){var e=this,n=e.$refs,t=n.widget,o=n.container,i=n.scrollBody,r=t.scrollWidth<=t.offsetWidth;if(!r){var l=o.getBoundingClientRect(),d=i?i.getBoundingClientRect().bottom:window.innerHeight||document.documentElement.clientHeight;r=l.bottom<=d||l.top>d}e.visible===r&&(e.visible=!r)},syncContainer:function(){var e=this.$refs,n=e.widget,t=e.container,o=n.scrollLeft;t.scrollLeft!==o&&(this.skipSyncWidget=!0,t.scrollLeft=o)},syncWidget:function(){var e=this.$refs,n=e.widget,t=e.container.scrollLeft;n.scrollLeft!==t&&(this.skipSyncContainer=!0,n.scrollLeft=t)},update:function(){var e=this.$refs,n=e.widget,t=e.strut,o=e.container,i=e.scrollBody,r=n.style,l=o.clientWidth,d=o.scrollWidth;r.width=l+"px",i||(r.left=o.getBoundingClientRect().left+"px"),t.style.width=d+"px",d>l&&(r.height=n.offsetHeight-n.clientHeight+1+"px"),this.syncWidget(),this.checkVisibility()}}},i={key:0,class:"handy-scroll-viewport"},r={ref:"strut"},l={ref:"strut"};return function(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===t&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('.handy-scroll[data-v-71ecdf2e]{bottom:0;min-height:17px;overflow:auto;position:fixed}.handy-scroll div[data-v-71ecdf2e]{height:1px;overflow:hidden;pointer-events:none}.handy-scroll div[data-v-71ecdf2e]:before{content:"\\A0"}.handy-scroll div[data-v-71ecdf2e],.handy-scroll[data-v-71ecdf2e]{font-size:1px;line-height:0;margin:0;padding:0}.handy-scroll-hidden[data-v-71ecdf2e]{bottom:9999px}.handy-scroll-hidden div[data-v-71ecdf2e]:before{content:"\\A0\\A0"}.handy-scroll-viewport[data-v-71ecdf2e]{position:relative}.handy-scroll-area[data-v-71ecdf2e],.handy-scroll-body[data-v-71ecdf2e]{overflow:auto}.handy-scroll-viewport .handy-scroll[data-v-71ecdf2e]{left:0;position:absolute}.handy-scroll-unobtrusive .handy-scroll[data-v-71ecdf2e]{opacity:0;transition:opacity .5s ease .3s}.handy-scroll-unobtrusive:hover .handy-scroll[data-v-71ecdf2e]{opacity:1}'),o.render=function(n,t,o,d,a,c){return o.customViewport?(e.openBlock(),e.createElementBlock("div",i,[e.renderSlot(n.$slots,"viewport-before"),e.createElementVNode("div",{ref:"scrollBody",class:"handy-scroll-body",onScroll:t[3]||(t[3]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return c.checkVisibility&&c.checkVisibility.apply(c,e)})},[e.renderSlot(n.$slots,"body-before"),e.createElementVNode("div",{ref:"container",class:e.normalizeClass(["handy-scroll-area",{"handy-scroll-unobtrusive":o.unobtrusive}]),onScroll:t[1]||(t[1]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return c.handleContainerScroll&&c.handleContainerScroll.apply(c,e)}),onFocusin:t[2]||(t[2]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return c.handleContainerFocus&&c.handleContainerFocus.apply(c,e)})},[e.renderSlot(n.$slots,"default"),e.createElementVNode("div",{ref:"widget",class:e.normalizeClass(["handy-scroll",{"handy-scroll-hidden":!a.visible}]),onScroll:t[0]||(t[0]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return c.handleWidgetScroll&&c.handleWidgetScroll.apply(c,e)})},[e.createElementVNode("div",r,null,512)],34)],34),e.renderSlot(n.$slots,"body-after")],544),e.renderSlot(n.$slots,"viewport-after")])):(e.openBlock(),e.createElementBlock("div",{key:1,ref:"container",class:e.normalizeClass(["handy-scroll-area",{"handy-scroll-unobtrusive":o.unobtrusive}]),onScroll:t[5]||(t[5]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return c.handleContainerScroll&&c.handleContainerScroll.apply(c,e)}),onFocusin:t[6]||(t[6]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return c.handleContainerFocus&&c.handleContainerFocus.apply(c,e)})},[e.renderSlot(n.$slots,"default"),e.createElementVNode("div",{ref:"widget",class:e.normalizeClass(["handy-scroll",{"handy-scroll-hidden":!a.visible}]),onScroll:t[4]||(t[4]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return c.handleWidgetScroll&&c.handleWidgetScroll.apply(c,e)})},[e.createElementVNode("div",l,null,512)],34)],34))},o.__scopeId="data-v-71ecdf2e",o.__file="src/handy-scroll.vue",o})); diff --git a/package-lock.json b/package-lock.json index 1229815..0ebae27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vue-handy-scroll", - "version": "3.0.1", + "version": "3.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vue-handy-scroll", - "version": "3.0.1", + "version": "3.0.2", "license": "MIT", "devDependencies": { "@rollup/plugin-buble": "^1.0.1", diff --git a/package.json b/package.json index 25ee557..c56a210 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-handy-scroll", - "version": "3.0.1", + "version": "3.0.2", "description": "Handy floating scrollbar component for Vue 3", "main": "dist/handy-scroll.umd.js", "module": "dist/handy-scroll.esm.js",