scroll-zoom-clamp
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,2 +0,2 @@ | ||
// Version 1.0.1 scroll-zoom-clamp - https://github.com/vasturiano/scroll-zoom-clamp | ||
// Version 1.0.2 scroll-zoom-clamp - https://github.com/vasturiano/scroll-zoom-clamp | ||
(function (global, factory) { | ||
@@ -3,0 +3,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : |
@@ -1,2 +0,2 @@ | ||
// Version 1.0.1 scroll-zoom-clamp - https://github.com/vasturiano/scroll-zoom-clamp | ||
// Version 1.0.2 scroll-zoom-clamp - https://github.com/vasturiano/scroll-zoom-clamp | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).ScrollZoomClamp=t()}(this,(function(){"use strict";function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(o=i.key,r=void 0,"symbol"==typeof(r=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(o,"string"))?r:String(r)),i)}var o,r}function t(e,t){return function(e,t){if(t.get)return t.get.call(e);return t.value}(e,i(e,t,"get"))}function n(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,i(e,t,"set"),n),n}function i(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function o(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function r(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function a(e,t,n){r(e,t),t.set(e,n)}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".scroll-zoom-clamp-message {\n position: absolute;\n top: 0;\n width: 100%;\n height: 100%;\n color: white;\n background-color: rgba(0, 0, 0, 0.3);\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 17px;\n pointer-events: none;\n}");var l=new WeakSet,s=new WeakMap,c=new WeakMap,u=new WeakMap,d=function(){function i(e){var d,p,h,v,m=this,y=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).message;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r(h=this,v=l),v.add(h),a(this,s,{writable:!0,value:void 0}),a(this,c,{writable:!0,value:void 0}),a(this,u,{writable:!0,value:void 0}),n(this,s,document.createElement("div")),t(this,s).style.position="relative",t(this,s).addEventListener("wheel",(function(e){e.metaKey||e.ctrlKey?(e.preventDefault(),o(m,l,f).call(m,!1)):(e.stopPropagation(),o(m,l,f).call(m,!0))}),!0);var b=null!==(d=window)&&void 0!==d&&null!==(d=d.navigator)&&void 0!==d&&null!==(d=d.platform)&&void 0!==d&&d.startsWith("Mac")?"⌘":null!==(p=window)&&void 0!==p&&null!==(p=p.navigator)&&void 0!==p&&null!==(p=p.platform)&&void 0!==p&&p.startsWith("Win")?"⊞":"ctrl";n(this,c,document.createElement("div")),t(this,c).classList.add("scroll-zoom-clamp-message"),t(this,c).style.opacity=0,t(this,c).innerHTML=y||"Use <b>".concat(b,"</b> + <b>scroll</b> to zoom the chart"),t(this,s).appendChild(e),t(this,s).appendChild(t(this,c))}var d,p,h;return d=i,(p=[{key:"node",get:function(){return t(this,s)}}])&&e(d.prototype,p),h&&e(d,h),Object.defineProperty(d,"prototype",{writable:!1}),i}();function f(){var e=this,i=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t(this,c).style.transition="opacity ".concat(i?0:1e3,"ms"),t(this,c).style.opacity=i?"1":"0",clearTimeout(t(this,u)),i&&n(this,u,setTimeout((function(){return o(e,l,f).call(e,!1)}),1e3))}return d})); |
{ | ||
"name": "scroll-zoom-clamp", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Prevent page scrolling interference by zooming components", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
32826