scroll-zoom-clamp
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,2 +0,2 @@ | ||
// Version 1.0.0 scroll-zoom-clamp - https://github.com/vasturiano/scroll-zoom-clamp | ||
// Version 1.0.1 scroll-zoom-clamp - https://github.com/vasturiano/scroll-zoom-clamp | ||
(function (global, factory) { | ||
@@ -132,3 +132,4 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
var _this = this, | ||
_window; | ||
_window, | ||
_window2; | ||
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, | ||
@@ -161,6 +162,7 @@ message = _ref.message; | ||
}, true); | ||
var keyChar = (_window = window) !== null && _window !== void 0 && (_window = _window.navigator) !== null && _window !== void 0 && (_window = _window.platform) !== null && _window !== void 0 && _window.startsWith('Mac') ? '⌘' : (_window2 = window) !== null && _window2 !== void 0 && (_window2 = _window2.navigator) !== null && _window2 !== void 0 && (_window2 = _window2.platform) !== null && _window2 !== void 0 && _window2.startsWith('Win') ? '⊞' : 'ctrl'; | ||
_classPrivateFieldSet(this, _msgNode, document.createElement('div')); | ||
_classPrivateFieldGet(this, _msgNode).classList.add('scroll-zoom-clamp-message'); | ||
_classPrivateFieldGet(this, _msgNode).style.opacity = 0; | ||
_classPrivateFieldGet(this, _msgNode).innerHTML = message || "Use <b>".concat((_window = window) !== null && _window !== void 0 && (_window = _window.navigator) !== null && _window !== void 0 && (_window = _window.platform) !== null && _window !== void 0 && _window.startsWith('Mac') ? '⌘' : 'ctrl', "</b> + <b>scroll</b> to zoom the chart"); | ||
_classPrivateFieldGet(this, _msgNode).innerHTML = message || "Use <b>".concat(keyChar, "</b> + <b>scroll</b> to zoom the chart"); | ||
_classPrivateFieldGet(this, _node).appendChild(childNode); | ||
@@ -167,0 +169,0 @@ _classPrivateFieldGet(this, _node).appendChild(_classPrivateFieldGet(this, _msgNode)); |
@@ -1,2 +0,2 @@ | ||
// Version 1.0.0 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,m=this,v=(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(p=this,h=l),h.add(p),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),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=v||"Use <b>".concat(null!==(d=window)&&void 0!==d&&null!==(d=d.navigator)&&void 0!==d&&null!==(d=d.platform)&&void 0!==d&&d.startsWith("Mac")?"⌘":"ctrl","</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})); | ||
// Version 1.0.1 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.0", | ||
"version": "1.0.1", | ||
"description": "Prevent page scrolling interference by zooming components", | ||
@@ -5,0 +5,0 @@ "type": "module", |
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
32804
384