Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nrk/core-toggle

Package Overview
Dependencies
Maintainers
86
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nrk/core-toggle - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

2

core-toggle.js

@@ -33,3 +33,3 @@ import {name, version} from './package.json'

if (el.contains(target)) setOpen(el, !open) // Click on toggle
else if (pops) setOpen(el, next.contains(target)) // Click in target or outside
else if (pops && open) setOpen(el, next.contains(target)) // Click in target or outside
})

@@ -36,0 +36,0 @@ })

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.coreToggle=e()}(this,function(){"use strict";var t="undefined"!=typeof window,e=t&&/(android)/i.test(navigator.userAgent);t&&/iPad|iPhone|iPod/.test(String(navigator.platform));var n="prevent_recursive_dispatch_maximum_callstack";function i(t){return Date.now().toString(36)+Math.random().toString(36).slice(2,5)}function r(t,e){if(void 0===e&&(e=document),t){if(t.nodeType)return[t];if("string"==typeof t)return[].slice.call(e.querySelectorAll(t));if(t.length)return[].slice.call(t)}return[]}var o,u,a,d,l="data-@nrk/core-toggle-1.1.1".replace(/\W+/g,"-"),c=e?"data":"aria",f="aria-expanded",p="aria-haspopup";function s(t,e){var i=t.nextElementSibling,r="true"===t.getAttribute(f),o="boolean"==typeof e?e:"toggle"===e?!r:r,u=r===o||function(t,e,i){void 0===i&&(i={});var r,o=""+n+e;return!!t[o]||(t[o]=!0,"function"==typeof window.CustomEvent?r=new window.CustomEvent(e,{bubbles:!0,cancelable:!0,detail:i}):(r=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(r),t[o]=null,!r.defaultPrevented)}(t,"toggle",{relatedTarget:i,isOpen:r,willOpen:o})?o:"true"===t.getAttribute(f);t.setAttribute(f,u),t.nextElementSibling[u?"removeAttribute":"setAttribute"]("hidden","")}return u=function(t){var e=t.target;r("["+l+"]").forEach(function(t){var n="true"===t.getAttribute(f),i="true"===t.getAttribute(p),r=t.nextElementSibling;t.contains(e)?s(t,!n):i&&s(t,r.contains(e))})},a="blur"===(o="click")||"focus"===o,d=l+"-"+o,"undefined"==typeof window||window[d]||document.addEventListener(window[d]=o,u,a),function(t,e){var n="object"==typeof e?e:{open:e};return r(t).map(function(t){var e="boolean"==typeof n.open?n.open:"true"===t.getAttribute(f),r="boolean"==typeof n.popup?n.popup:"true"===t.getAttribute(p),o=t.nextElementSibling;return t.setAttribute(l,""),t.setAttribute(p,r),t.setAttribute("aria-controls",o.id=o.id||i()),o.setAttribute(c+"-labelledby",t.id=t.id||i()),s(t,e),t})}});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.coreToggle=e()}(this,function(){"use strict";var t="undefined"!=typeof window,e=t&&/(android)/i.test(navigator.userAgent),n=(t&&/iPad|iPhone|iPod/.test(String(navigator.platform)),function(t){void 0===t&&(t=!1);try{window.addEventListener("test",null,{get passive(){t=!0}})}catch(t){}return t}());var i="prevent_recursive_dispatch_maximum_callstack";function o(t){return Date.now().toString(36)+Math.random().toString(36).slice(2,5)}function r(t,e){if(void 0===e&&(e=document),t){if(t.nodeType)return[t];if("string"==typeof t)return[].slice.call(e.querySelectorAll(t));if(t.length)return[].slice.call(t)}return[]}var u,a,d,l,c="data-@nrk/core-toggle-1.1.2".replace(/\W+/g,"-"),f=e?"data":"aria",p="aria-expanded",s="aria-haspopup";function g(t,e){var n=t.nextElementSibling,o="true"===t.getAttribute(p),r="boolean"==typeof e?e:"toggle"===e?!o:o,u=o===r||function(t,e,n){void 0===n&&(n={});var o,r=""+i+e;return!!t[r]||(t[r]=!0,"function"==typeof window.CustomEvent?o=new window.CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n}):(o=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,n),t.dispatchEvent(o),t[r]=null,!o.defaultPrevented)}(t,"toggle",{relatedTarget:n,isOpen:o,willOpen:r})?r:"true"===t.getAttribute(p);t.setAttribute(p,u),t.nextElementSibling[u?"removeAttribute":"setAttribute"]("hidden","")}return u=c,a="click",d=function(t){var e=t.target;r("["+c+"]").forEach(function(t){var n="true"===t.getAttribute(p),i="true"===t.getAttribute(s),o=t.nextElementSibling;t.contains(e)?g(t,!n):i&&n&&g(t,o.contains(e))})},void 0===l&&(l=!1),"undefined"==typeof window||window[u=u+"-"+a]||(n||"object"!=typeof l||(l=Boolean(l.capture)),("resize"===a?window:document).addEventListener(window[u]=a,d,l)),function(t,e){var n="object"==typeof e?e:{open:e};return r(t).map(function(t){var e="boolean"==typeof n.open?n.open:"true"===t.getAttribute(p),i="boolean"==typeof n.popup?n.popup:"true"===t.getAttribute(s),r=t.nextElementSibling;return t.setAttribute(c,""),t.setAttribute(s,i),t.setAttribute("aria-controls",r.id=r.id||o()),r.setAttribute(f+"-labelledby",t.id=t.id||o()),g(t,e),t})}});
//# sourceMappingURL=core-toggle.min.js.map

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):t.CoreToggle=e(t.React)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e="undefined"!=typeof window,n=e&&/(android)/i.test(navigator.userAgent);e&&/iPad|iPhone|iPod/.test(String(navigator.platform));var o="prevent_recursive_dispatch_maximum_callstack";function r(t){return Date.now().toString(36)+Math.random().toString(36).slice(2,5)}function i(t,e){if(void 0===e&&(e=document),t){if(t.nodeType)return[t];if("string"==typeof t)return[].slice.call(e.querySelectorAll(t));if(t.length)return[].slice.call(t)}return[]}var u,p,a,l,c="data-@nrk/core-toggle-1.1.1".replace(/\W+/g,"-"),d=n?"data":"aria",s="aria-expanded",f="aria-haspopup";function g(t,e){var n="object"==typeof e?e:{open:e};return i(t).map(function(t){var e="boolean"==typeof n.open?n.open:"true"===t.getAttribute(s),o="boolean"==typeof n.popup?n.popup:"true"===t.getAttribute(f),i=t.nextElementSibling;return t.setAttribute(c,""),t.setAttribute(f,o),t.setAttribute("aria-controls",i.id=i.id||r()),i.setAttribute(d+"-labelledby",t.id=t.id||r()),m(t,e),t})}function m(t,e){var n=t.nextElementSibling,r="true"===t.getAttribute(s),i="boolean"==typeof e?e:"toggle"===e?!r:r,u=r===i||function(t,e,n){void 0===n&&(n={});var r,i=""+o+e;return!!t[i]||(t[i]=!0,"function"==typeof window.CustomEvent?r=new window.CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n}):(r=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,n),t.dispatchEvent(r),t[i]=null,!r.defaultPrevented)}(t,"toggle",{relatedTarget:n,isOpen:r,willOpen:i})?i:"true"===t.getAttribute(s);t.setAttribute(s,u),t.nextElementSibling[u?"removeAttribute":"setAttribute"]("hidden","")}p=function(t){var e=t.target;i("["+c+"]").forEach(function(t){var n="true"===t.getAttribute(s),o="true"===t.getAttribute(f),r=t.nextElementSibling;t.contains(e)?m(t,!n):o&&m(t,r.contains(e))})},a="blur"===(u="click")||"focus"===u,l=c+"-"+u,"undefined"==typeof window||window[l]||document.addEventListener(window[l]=u,p,a);var b={open:null,popup:null,onToggle:null};return function(e){function n(){e.apply(this,arguments)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.componentDidMount=function(){g(this.el.firstElementChild),this.el.addEventListener("toggle",this.props.onToggle)},n.prototype.componentDidUpdate=function(){g(this.el.firstElementChild)},n.prototype.componentWillUnmount=function(){this.el.removeEventListener("toggle",this.props.onToggle)},n.prototype.render=function(){var e=this;return t.createElement("div",function(t,e,n){return void 0===n&&(n={}),Object.keys(t).reduce(function(n,o){return e.hasOwnProperty(o)||(n[o]=t[o]),n},n)}(this.props,b,{ref:function(t){return e.el=t}}),t.Children.map(this.props.children,function(n,o){return 0===o?t.cloneElement(n,{"aria-expanded":String(Boolean(e.props.open)),"aria-haspopup":String(Boolean(e.props.popup))}):1===o?t.cloneElement(n,{hidden:!e.props.open}):n}))},n}(t.Component)});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):t.CoreToggle=e(t.React)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e="undefined"!=typeof window,n=e&&/(android)/i.test(navigator.userAgent),o=(e&&/iPad|iPhone|iPod/.test(String(navigator.platform)),function(t){void 0===t&&(t=!1);try{window.addEventListener("test",null,{get passive(){t=!0}})}catch(t){}return t}());var r="prevent_recursive_dispatch_maximum_callstack";function i(t){return Date.now().toString(36)+Math.random().toString(36).slice(2,5)}function u(t,e){if(void 0===e&&(e=document),t){if(t.nodeType)return[t];if("string"==typeof t)return[].slice.call(e.querySelectorAll(t));if(t.length)return[].slice.call(t)}return[]}var p,a,l,d,c="data-@nrk/core-toggle-1.1.2".replace(/\W+/g,"-"),s=n?"data":"aria",f="aria-expanded",g="aria-haspopup";function v(t,e){var n="object"==typeof e?e:{open:e};return u(t).map(function(t){var e="boolean"==typeof n.open?n.open:"true"===t.getAttribute(f),o="boolean"==typeof n.popup?n.popup:"true"===t.getAttribute(g),r=t.nextElementSibling;return t.setAttribute(c,""),t.setAttribute(g,o),t.setAttribute("aria-controls",r.id=r.id||i()),r.setAttribute(s+"-labelledby",t.id=t.id||i()),m(t,e),t})}function m(t,e){var n=t.nextElementSibling,o="true"===t.getAttribute(f),i="boolean"==typeof e?e:"toggle"===e?!o:o,u=o===i||function(t,e,n){void 0===n&&(n={});var o,i=""+r+e;return!!t[i]||(t[i]=!0,"function"==typeof window.CustomEvent?o=new window.CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n}):(o=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,n),t.dispatchEvent(o),t[i]=null,!o.defaultPrevented)}(t,"toggle",{relatedTarget:n,isOpen:o,willOpen:i})?i:"true"===t.getAttribute(f);t.setAttribute(f,u),t.nextElementSibling[u?"removeAttribute":"setAttribute"]("hidden","")}p=c,a="click",l=function(t){var e=t.target;u("["+c+"]").forEach(function(t){var n="true"===t.getAttribute(f),o="true"===t.getAttribute(g),r=t.nextElementSibling;t.contains(e)?m(t,!n):o&&n&&m(t,r.contains(e))})},void 0===d&&(d=!1),"undefined"==typeof window||window[p=p+"-"+a]||(o||"object"!=typeof d||(d=Boolean(d.capture)),("resize"===a?window:document).addEventListener(window[p]=a,l,d));var b={open:null,popup:null,onToggle:null};return function(e){function n(){e.apply(this,arguments)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.componentDidMount=function(){v(this.el.firstElementChild),this.el.addEventListener("toggle",this.props.onToggle)},n.prototype.componentDidUpdate=function(){v(this.el.firstElementChild)},n.prototype.componentWillUnmount=function(){this.el.removeEventListener("toggle",this.props.onToggle)},n.prototype.render=function(){var e=this;return t.createElement("div",function(t,e,n){return void 0===n&&(n={}),Object.keys(t).reduce(function(n,o){return e.hasOwnProperty(o)||(n[o]=t[o]),n},n)}(this.props,b,{ref:function(t){return e.el=t}}),t.Children.map(this.props.children,function(n,o){return 0===o?t.cloneElement(n,{"aria-expanded":String(Boolean(e.props.open)),"aria-haspopup":String(Boolean(e.props.popup))}):1===o?t.cloneElement(n,{hidden:!e.props.open}):n}))},n}(t.Component)});
//# sourceMappingURL=index.js.map

@@ -5,3 +5,3 @@ {

"author": "NRK <opensource@nrk.no> (https://www.nrk.no/)",
"version": "1.1.2",
"version": "1.1.3",
"license": "MIT",

@@ -8,0 +8,0 @@ "main": "core-toggle.min.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc