From 94b45cc1a6af591126d010de2e6ef6fd244902d2 Mon Sep 17 00:00:00 2001 From: Dolphin Wood Date: Mon, 1 Nov 2021 18:02:56 +0900 Subject: [PATCH] [build] 8.7.0 --- bower.json | 2 +- dist/smooth-scrollbar.js | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/bower.json b/bower.json index 6182140..dcef02c 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "smooth-scrollbar", - "version": "8.6.3", + "version": "8.7.0", "authors": [ "Dolphin Wood " ], diff --git a/dist/smooth-scrollbar.js b/dist/smooth-scrollbar.js index 027de72..d8b35f5 100644 --- a/dist/smooth-scrollbar.js +++ b/dist/smooth-scrollbar.js @@ -13,13 +13,4 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0;c--)(o=t[c])&&(u=(i<3?o(u):i>3?o(e,n,u):o(e,n))||u);return i>3&&u&&Object.defineProperty(e,n,u),u}n(68),n(90),n(92),n(98),n(102);var c=/\s/,a=/^\s+/,s=function(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&c.test(t.charAt(e)););return e}(t)+1).replace(a,""):t},f=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},l=n(66),p="object"==typeof self&&self&&self.Object===Object&&self,h=l.a||p||Function("return this")(),d=h.Symbol,v=Object.prototype,y=v.hasOwnProperty,m=v.toString,g=d?d.toStringTag:void 0,b=Object.prototype.toString,x=d?d.toStringTag:void 0,w=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":x&&x in Object(t)?function(t){var e=y.call(t,g),n=t[g];try{t[g]=void 0;var r=!0}catch(t){}var o=m.call(t);return r&&(e?t[g]=n:delete t[g]),o}(t):function(t){return b.call(t)}(t)},S=/^[-+]0x[0-9a-f]+$/i,O=/^0b[01]+$/i,_=/^0o[0-7]+$/i,E=parseInt,T=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&"[object Symbol]"==w(t)}(t))return NaN;if(f(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=f(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=s(t);var n=O.test(t);return n||_.test(t)?E(t.slice(2),n?2:8):S.test(t)?NaN:+t},A=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=T(n))==n?n:0),void 0!==e&&(e=(e=T(e))==e?e:0),function(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}(T(t),e,n)};function j(t,e){return void 0===t&&(t=-1/0),void 0===e&&(e=1/0),function(n,r){var o="_"+r;Object.defineProperty(n,r,{get:function(){return this[o]},set:function(n){Object.defineProperty(this,o,{value:A(n,t,e),enumerable:!1,writable:!0,configurable:!0})},enumerable:!0,configurable:!0})}}function P(t,e){var n="_"+e;Object.defineProperty(t,e,{get:function(){return this[n]},set:function(t){Object.defineProperty(this,n,{value:!!t,enumerable:!1,writable:!0,configurable:!0})},enumerable:!0,configurable:!0})}var M=function(){return h.Date.now()},k=Math.max,z=Math.min,D=function(t,e,n){var r,o,i,u,c,a,s=0,l=!1,p=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){var n=r,i=o;return r=o=void 0,s=e,u=t.apply(i,n)}function v(t){var n=t-a;return void 0===a||n>=e||n<0||p&&t-s>=i}function y(){var t=M();if(v(t))return m(t);c=setTimeout(y,function(t){var n=e-(t-a);return p?z(n,i-(t-s)):n}(t))}function m(t){return c=void 0,h&&r?d(t):(r=o=void 0,u)}function g(){var t=M(),n=v(t);if(r=arguments,o=this,a=t,n){if(void 0===c)return function(t){return s=t,c=setTimeout(y,e),l?d(t):u}(a);if(p)return clearTimeout(c),c=setTimeout(y,e),d(a)}return void 0===c&&(c=setTimeout(y,e)),u}return e=T(e)||0,f(n)&&(l=!!n.leading,i=(p="maxWait"in n)?k(T(n.maxWait)||0,e):i,h="trailing"in n?!!n.trailing:h),g.cancel=function(){void 0!==c&&clearTimeout(c),s=0,r=a=o=c=void 0},g.flush=function(){return void 0===c?u:m(M())},g};function L(){for(var t=[],e=0;eo-20?f.x=a-o+20:ai-20?f.y=s-i+20:s=r)"function"==typeof a&&a.call(t);else{var i=requestAnimationFrame(e);$.set(t,i)}}()}(this,t,e,n,r)},t.prototype.scrollIntoView=function(t,e){void 0===e&&(e={}),function(t,e,n){var r=void 0===n?{}:n,o=r.alignToTop,i=void 0===o||o,u=r.onlyScrollIfNeeded,c=void 0!==u&&u,a=r.offsetTop,s=void 0===a?0:a,f=r.offsetLeft,l=void 0===f?0:f,p=r.offsetBottom,h=void 0===p?0:p,d=t.containerEl,v=t.bounding,y=t.offset,m=t.limit;if(e&&d.contains(e)){var g=e.getBoundingClientRect();if(!c||!t.isVisible(e)){var b=i?g.top-v.top-s:g.bottom-v.bottom+h;t.setMomentum(g.left-v.left-l,A(b,-y.y,m.y-y.y))}}}(this,t,e)},t.prototype.addListener=function(t){if("function"!=typeof t)throw new TypeError("[smooth-scrollbar] scrolling listener should be a function");this._listeners.add(t)},t.prototype.removeListener=function(t){this._listeners.delete(t)},t.prototype.addTransformableMomentum=function(t,e,n,r){this._updateDebounced();var o=this._plugins.reduce((function(t,e){return e.transformDelta(t,n)||t}),{x:t,y:e}),i=!this._shouldPropagateMomentum(o.x,o.y);i&&this.addMomentum(o.x,o.y),r&&r.call(this,i)},t.prototype.addMomentum=function(t,e){this.setMomentum(this._momentum.x+t,this._momentum.y+e)},t.prototype.setMomentum=function(t,e){0===this.limit.x&&(t=0),0===this.limit.y&&(e=0),this.options.renderByPixels&&(t=Math.round(t),e=Math.round(e)),this._momentum.x=t,this._momentum.y=e},t.prototype.updatePluginOptions=function(t,e){this._plugins.forEach((function(n){n.name===t&&Object.assign(n.options,e)}))},t.prototype.destroy=function(){var t=this.containerEl,e=this.contentEl;!function(t){var e=N.get(t);e&&(e.forEach((function(t){var e=t.elem,n=t.eventName,r=t.handler;e.removeEventListener(n,r,R())})),N.delete(t))}(this),this._listeners.clear(),this.setMomentum(0,0),cancelAnimationFrame(this._renderID),this._observer&&this._observer.disconnect(),ht.delete(this.containerEl);for(var n=Array.from(e.childNodes);t.firstChild;)t.removeChild(t.firstChild);n.forEach((function(e){t.appendChild(e)})),U(t,{overflow:""}),t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,this._plugins.forEach((function(t){t.onDestroy()})),this._plugins.length=0},t.prototype._init=function(){var t=this;this.update(),Object.keys(r).forEach((function(e){r[e](t)})),this._plugins.forEach((function(t){t.onInit()})),this._render()},t.prototype._updateDebounced=function(){this.update()},t.prototype._shouldPropagateMomentum=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0);var n=this.options,r=this.offset,o=this.limit;if(!n.continuousScrolling)return!1;0===o.x&&0===o.y&&this._updateDebounced();var i=A(t+r.x,0,o.x),u=A(e+r.y,0,o.y),c=!0;return(c=(c=c&&i===r.x)&&u===r.y)&&(r.x===o.x||0===r.x||r.y===o.y||0===r.y)},t.prototype._render=function(){var t=this._momentum;if(t.x||t.y){var e=this._nextTick("x"),n=this._nextTick("y");t.x=e.momentum,t.y=n.momentum,this.setPosition(e.position,n.position)}var r=i({},this._momentum);this._plugins.forEach((function(t){t.onRender(r)})),this._renderID=requestAnimationFrame(this._render.bind(this))},t.prototype._nextTick=function(t){var e=this.options,n=this.offset,r=this._momentum,o=n[t],i=r[t];if(Math.abs(i)<=.1)return{momentum:0,position:o+i};var u=i*(1-e.damping);return e.renderByPixels&&(u|=0),{momentum:u,position:o+i-u}},u([L(100,{leading:!0})],t.prototype,"_updateDebounced",null),t}(),vt="smooth-scrollbar-style",yt=!1;function mt(){if(!yt&&"undefined"!=typeof window){var t=document.createElement("style");t.id=vt,t.textContent="\n[data-scrollbar] {\n display: block;\n position: relative;\n}\n\n.scroll-content {\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n}\n\n.scrollbar-track {\n position: absolute;\n opacity: 0;\n z-index: 1;\n background: rgba(222, 222, 222, .75);\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-transition: opacity 0.5s 0.5s ease-out;\n transition: opacity 0.5s 0.5s ease-out;\n}\n.scrollbar-track.show,\n.scrollbar-track:hover {\n opacity: 1;\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n}\n\n.scrollbar-track-x {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 8px;\n}\n.scrollbar-track-y {\n top: 0;\n right: 0;\n width: 8px;\n height: 100%;\n}\n.scrollbar-thumb {\n position: absolute;\n top: 0;\n left: 0;\n width: 8px;\n height: 8px;\n background: rgba(0, 0, 0, .5);\n border-radius: 4px;\n}\n",document.head&&document.head.appendChild(t),yt=!0}}n.d(e,"ScrollbarPlugin",(function(){return nt})); -/*! - * cast `I.Scrollbar` to `Scrollbar` to avoid error - * - * `I.Scrollbar` is not assignable to `Scrollbar`: - * "privateProp" is missing in `I.Scrollbar` - * - * @see https://github.com/Microsoft/TypeScript/issues/2672 - */ -var gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.init=function(t,e){if(!t||1!==t.nodeType)throw new TypeError("expect element to be DOM Element, but got "+t);return mt(),ht.has(t)?ht.get(t):new dt(t,e)},e.initAll=function(t){return Array.from(document.querySelectorAll("[data-scrollbar]"),(function(n){return e.init(n,t)}))},e.has=function(t){return ht.has(t)},e.get=function(t){return ht.get(t)},e.getAll=function(){return Array.from(ht.values())},e.destroy=function(t){var e=ht.get(t);e&&e.destroy()},e.destroyAll=function(){ht.forEach((function(t){t.destroy()}))},e.use=function(){for(var t=[],e=0;e=0;c--)(o=t[c])&&(u=(i<3?o(u):i>3?o(e,n,u):o(e,n))||u);return i>3&&u&&Object.defineProperty(e,n,u),u}n(68),n(90),n(92),n(98),n(102);var c=/\s/,a=/^\s+/,s=function(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&c.test(t.charAt(e)););return e}(t)+1).replace(a,""):t},f=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},l=n(66),p="object"==typeof self&&self&&self.Object===Object&&self,h=l.a||p||Function("return this")(),d=h.Symbol,v=Object.prototype,y=v.hasOwnProperty,m=v.toString,g=d?d.toStringTag:void 0,b=Object.prototype.toString,x=d?d.toStringTag:void 0,w=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":x&&x in Object(t)?function(t){var e=y.call(t,g),n=t[g];try{t[g]=void 0;var r=!0}catch(t){}var o=m.call(t);return r&&(e?t[g]=n:delete t[g]),o}(t):function(t){return b.call(t)}(t)},S=/^[-+]0x[0-9a-f]+$/i,O=/^0b[01]+$/i,_=/^0o[0-7]+$/i,E=parseInt,T=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&"[object Symbol]"==w(t)}(t))return NaN;if(f(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=f(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=s(t);var n=O.test(t);return n||_.test(t)?E(t.slice(2),n?2:8):S.test(t)?NaN:+t},A=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=T(n))==n?n:0),void 0!==e&&(e=(e=T(e))==e?e:0),function(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}(T(t),e,n)};function j(t,e){return void 0===t&&(t=-1/0),void 0===e&&(e=1/0),function(n,r){var o="_"+r;Object.defineProperty(n,r,{get:function(){return this[o]},set:function(n){Object.defineProperty(this,o,{value:A(n,t,e),enumerable:!1,writable:!0,configurable:!0})},enumerable:!0,configurable:!0})}}function P(t,e){var n="_"+e;Object.defineProperty(t,e,{get:function(){return this[n]},set:function(t){Object.defineProperty(this,n,{value:!!t,enumerable:!1,writable:!0,configurable:!0})},enumerable:!0,configurable:!0})}var M=function(){return h.Date.now()},k=Math.max,z=Math.min,D=function(t,e,n){var r,o,i,u,c,a,s=0,l=!1,p=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){var n=r,i=o;return r=o=void 0,s=e,u=t.apply(i,n)}function v(t){var n=t-a;return void 0===a||n>=e||n<0||p&&t-s>=i}function y(){var t=M();if(v(t))return m(t);c=setTimeout(y,function(t){var n=e-(t-a);return p?z(n,i-(t-s)):n}(t))}function m(t){return c=void 0,h&&r?d(t):(r=o=void 0,u)}function g(){var t=M(),n=v(t);if(r=arguments,o=this,a=t,n){if(void 0===c)return function(t){return s=t,c=setTimeout(y,e),l?d(t):u}(a);if(p)return clearTimeout(c),c=setTimeout(y,e),d(a)}return void 0===c&&(c=setTimeout(y,e)),u}return e=T(e)||0,f(n)&&(l=!!n.leading,i=(p="maxWait"in n)?k(T(n.maxWait)||0,e):i,h="trailing"in n?!!n.trailing:h),g.cancel=function(){void 0!==c&&clearTimeout(c),s=0,r=a=o=c=void 0},g.flush=function(){return void 0===c?u:m(M())},g};function L(){for(var t=[],e=0;eo-20?f.x=a-o+20:ai-20?f.y=s-i+20:s=r)"function"==typeof a&&a.call(t);else{var i=requestAnimationFrame(e);$.set(t,i)}}()}(this,t,e,n,r)},t.prototype.scrollIntoView=function(t,e){void 0===e&&(e={}),function(t,e,n){var r=void 0===n?{}:n,o=r.alignToTop,i=void 0===o||o,u=r.onlyScrollIfNeeded,c=void 0!==u&&u,a=r.offsetTop,s=void 0===a?0:a,f=r.offsetLeft,l=void 0===f?0:f,p=r.offsetBottom,h=void 0===p?0:p,d=t.containerEl,v=t.bounding,y=t.offset,m=t.limit;if(e&&d.contains(e)){var g=e.getBoundingClientRect();if(!c||!t.isVisible(e)){var b=i?g.top-v.top-s:g.bottom-v.bottom+h;t.setMomentum(g.left-v.left-l,A(b,-y.y,m.y-y.y))}}}(this,t,e)},t.prototype.addListener=function(t){if("function"!=typeof t)throw new TypeError("[smooth-scrollbar] scrolling listener should be a function");this._listeners.add(t)},t.prototype.removeListener=function(t){this._listeners.delete(t)},t.prototype.addTransformableMomentum=function(t,e,n,r){this._updateDebounced();var o=this._plugins.reduce((function(t,e){return e.transformDelta(t,n)||t}),{x:t,y:e}),i=!this._shouldPropagateMomentum(o.x,o.y);i&&this.addMomentum(o.x,o.y),r&&r.call(this,i)},t.prototype.addMomentum=function(t,e){this.setMomentum(this._momentum.x+t,this._momentum.y+e)},t.prototype.setMomentum=function(t,e){0===this.limit.x&&(t=0),0===this.limit.y&&(e=0),this.options.renderByPixels&&(t=Math.round(t),e=Math.round(e)),this._momentum.x=t,this._momentum.y=e},t.prototype.updatePluginOptions=function(t,e){this._plugins.forEach((function(n){n.name===t&&Object.assign(n.options,e)}))},t.prototype.destroy=function(){var t=this.containerEl,e=this.contentEl;!function(t){var e=N.get(t);e&&(e.forEach((function(t){var e=t.elem,n=t.eventName,r=t.handler;e.removeEventListener(n,r,R())})),N.delete(t))}(this),this._listeners.clear(),this.setMomentum(0,0),cancelAnimationFrame(this._renderID),this._observer&&this._observer.disconnect(),ht.delete(this.containerEl);for(var n=Array.from(e.childNodes);t.firstChild;)t.removeChild(t.firstChild);n.forEach((function(e){t.appendChild(e)})),U(t,{overflow:""}),t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,this._plugins.forEach((function(t){t.onDestroy()})),this._plugins.length=0},t.prototype._init=function(){var t=this;this.update(),Object.keys(r).forEach((function(e){r[e](t)})),this._plugins.forEach((function(t){t.onInit()})),this._render()},t.prototype._updateDebounced=function(){this.update()},t.prototype._shouldPropagateMomentum=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0);var n=this.options,r=this.offset,o=this.limit;if(!n.continuousScrolling)return!1;0===o.x&&0===o.y&&this._updateDebounced();var i=A(t+r.x,0,o.x),u=A(e+r.y,0,o.y),c=!0;return(c=(c=c&&i===r.x)&&u===r.y)&&(r.x===o.x||0===r.x||r.y===o.y||0===r.y)},t.prototype._render=function(){var t=this._momentum;if(t.x||t.y){var e=this._nextTick("x"),n=this._nextTick("y");t.x=e.momentum,t.y=n.momentum,this.setPosition(e.position,n.position)}var r=i({},this._momentum);this._plugins.forEach((function(t){t.onRender(r)})),this._renderID=requestAnimationFrame(this._render.bind(this))},t.prototype._nextTick=function(t){var e=this.options,n=this.offset,r=this._momentum,o=n[t],i=r[t];if(Math.abs(i)<=.1)return{momentum:0,position:o+i};var u=i*(1-e.damping);return e.renderByPixels&&(u|=0),{momentum:u,position:o+i-u}},u([L(100,{leading:!0})],t.prototype,"_updateDebounced",null),t}(),vt="smooth-scrollbar-style",yt=!1;function mt(){if(!yt&&"undefined"!=typeof window){var t=document.createElement("style");t.id=vt,t.textContent="\n[data-scrollbar] {\n display: block;\n position: relative;\n}\n\n.scroll-content {\n display: flow-root;\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n}\n\n.scrollbar-track {\n position: absolute;\n opacity: 0;\n z-index: 1;\n background: rgba(222, 222, 222, .75);\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-transition: opacity 0.5s 0.5s ease-out;\n transition: opacity 0.5s 0.5s ease-out;\n}\n.scrollbar-track.show,\n.scrollbar-track:hover {\n opacity: 1;\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n}\n\n.scrollbar-track-x {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 8px;\n}\n.scrollbar-track-y {\n top: 0;\n right: 0;\n width: 8px;\n height: 100%;\n}\n.scrollbar-thumb {\n position: absolute;\n top: 0;\n left: 0;\n width: 8px;\n height: 8px;\n background: rgba(0, 0, 0, .5);\n border-radius: 4px;\n}\n",document.head&&document.head.appendChild(t),yt=!0}}n.d(e,"ScrollbarPlugin",(function(){return nt}));var gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.init=function(t,e){if(!t||1!==t.nodeType)throw new TypeError("expect element to be DOM Element, but got "+t);return mt(),ht.has(t)?ht.get(t):new dt(t,e)},e.initAll=function(t){return Array.from(document.querySelectorAll("[data-scrollbar]"),(function(n){return e.init(n,t)}))},e.has=function(t){return ht.has(t)},e.get=function(t){return ht.get(t)},e.getAll=function(){return Array.from(ht.values())},e.destroy=function(t){var e=ht.get(t);e&&e.destroy()},e.destroyAll=function(){ht.forEach((function(t){t.destroy()}))},e.use=function(){for(var t=[],e=0;e