New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fabiocaccamo/tabbo.js

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fabiocaccamo/tabbo.js - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

8

dist/tabbo.js

@@ -188,3 +188,3 @@ (function () {

parent = parent || document;
const selectors = [
const tags = [
'a',

@@ -198,3 +198,7 @@ 'button',

];
const selector = selectors.join(':not([tabindex="-1"]), ');
const selector = tags
.map(function (tag) {
return tag + ':not([tabindex="-1"])';
})
.join(', ');
const elements = getFocusableElementsBySelector(parent, selector);

@@ -201,0 +205,0 @@ return elements;

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

!function(){const t={activate:function(t){window.addEventListener("focus",o,!0),window.addEventListener("blur",r,!0),window.addEventListener("keydown",u,!0)},deactivate:function(){window.removeEventListener("focus",o),window.removeEventListener("blur",r),window.removeEventListener("keydown",u)}};let n=null,e=null,i=null;function o(t){c(t.target)||(n=t.target)}function r(t){n=null}function u(t){if(!c(t.target))return"Tab"===t.key?function(t){const o=d(document,'[aria-modal="true"]');let r=null;o.length>0&&(r=o[o.length-1],e||(e=i||n||t.target));const u=function(t){const n=function(t){t=t||document;const n=["a","button","input","select","summary","textarea","[tabindex]"].join(':not([tabindex="-1"]), ');return d(t,n)}(t);return n.sort(function(t,n){return(parseInt(t.getAttribute("tabindex"))||0)-(parseInt(n.getAttribute("tabindex"))||0)}),n}(r);if(0===u.length)return t.preventDefault(),t.stopImmediatePropagation(),!1;let a=[e,i,n,t.target].find(function(t){return t&&-1!==u.indexOf(t)}),c=null,l=u.indexOf(a);-1===l?l=0:(t.shiftKey?l--:l++,l<=-1?l=u.length-1:l>=u.length&&(l=0));c=u[l],0===o.length&&(e=null);if(n=null,i=null,c)return t.preventDefault(),t.stopImmediatePropagation(),c.focus(),!1;return!0}(t):"Enter"===t.key?function(t){const n=t.target,e=n.tagName.toLowerCase();if(n===document.activeElement){if("a"===e||"button"===e)setTimeout(function(){n.blur()},10);else if("input"===e&&"checkbox"===t.target.type){n.checked=!n.checked;const t=new Event("change",{bubbles:!0});n.dispatchEvent(t)}i=n}}(t):void 0}function a(t){return 0===parseInt(t,10)}function c(t){return t===window||t===document}function l(t){if(t.hasAttribute("disabled")||t.classList.contains("disabled")||t.classList.contains("hidden"))return!1;const n=window.getComputedStyle(t);return!("none"===n.display||"hidden"===n.visibility||"0"===n.opacity||"none"===n.pointerEvents||a(n.width)||a(n.maxWidth)||a(n.height)||a(n.maxHeight))}function d(t,n){return Array.from(t.querySelectorAll(n)).filter(function(t){return function(t){do{if(!l(t))return!1;t=t.parentElement}while(t);return!0}(t)})}window.tabbo=t}();
!function(){const t={activate:function(t){window.addEventListener("focus",r,!0),window.addEventListener("blur",o,!0),window.addEventListener("keydown",u,!0)},deactivate:function(){window.removeEventListener("focus",r),window.removeEventListener("blur",o),window.removeEventListener("keydown",u)}};let n=null,e=null,i=null;function r(t){c(t.target)||(n=t.target)}function o(t){n=null}function u(t){if(!c(t.target))return"Tab"===t.key?function(t){const r=d(document,'[aria-modal="true"]');let o=null;r.length>0&&(o=r[r.length-1],e||(e=i||n||t.target));const u=function(t){const n=function(t){t=t||document;const n=["a","button","input","select","summary","textarea","[tabindex]"].map(function(t){return t+':not([tabindex="-1"])'}).join(", ");return d(t,n)}(t);return n.sort(function(t,n){return(parseInt(t.getAttribute("tabindex"))||0)-(parseInt(n.getAttribute("tabindex"))||0)}),n}(o);if(0===u.length)return t.preventDefault(),t.stopImmediatePropagation(),!1;let a=[e,i,n,t.target].find(function(t){return t&&-1!==u.indexOf(t)}),c=null,l=u.indexOf(a);-1===l?l=0:(t.shiftKey?l--:l++,l<=-1?l=u.length-1:l>=u.length&&(l=0));c=u[l],0===r.length&&(e=null);if(n=null,i=null,c)return t.preventDefault(),t.stopImmediatePropagation(),c.focus(),!1;return!0}(t):"Enter"===t.key?function(t){const n=t.target,e=n.tagName.toLowerCase();if(n===document.activeElement){if("a"===e||"button"===e)setTimeout(function(){n.blur()},10);else if("input"===e&&"checkbox"===t.target.type){n.checked=!n.checked;const t=new Event("change",{bubbles:!0});n.dispatchEvent(t)}i=n}}(t):void 0}function a(t){return 0===parseInt(t,10)}function c(t){return t===window||t===document}function l(t){if(t.hasAttribute("disabled")||t.classList.contains("disabled")||t.classList.contains("hidden"))return!1;const n=window.getComputedStyle(t);return!("none"===n.display||"hidden"===n.visibility||"0"===n.opacity||"none"===n.pointerEvents||a(n.width)||a(n.maxWidth)||a(n.height)||a(n.maxHeight))}function d(t,n){return Array.from(t.querySelectorAll(n)).filter(function(t){return function(t){do{if(!l(t))return!1;t=t.parentElement}while(t);return!0}(t)})}window.tabbo=t}();
{
"name": "@fabiocaccamo/tabbo.js",
"version": "0.1.0",
"version": "0.1.1",
"description": "enhanced keyboard tabbing usability on any website / webapp with one line of code.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -0,1 +1,8 @@

[![](https://img.shields.io/npm/v/@fabiocaccamo/tabbo.js?color=blue&logo=npm)](https://www.npmjs.com/package/@fabiocaccamo/tabbo.js)
[![](https://img.shields.io/npm/dt/@fabiocaccamo/tabbo.js?color=blue)](https://www.npmjs.com/package/@fabiocaccamo/tabbo.js)
[![](https://img.shields.io/github/stars/fabiocaccamo/tabbo.js?color=blue&logo=github&logoColor=white&style=flat)](https://github.com/fabiocaccamo/tabbo.js/stargazers)
[![](https://img.shields.io/bundlephobia/min/@fabiocaccamo/tabbo.js?color=blue)](https://www.npmjs.com/package/@fabiocaccamo/tabbo.js)
[![](https://img.shields.io/bundlephobia/minzip/@fabiocaccamo/tabbo.js?color=blue)](https://www.npmjs.com/package/@fabiocaccamo/tabbo.js)
[![](https://img.shields.io/github/license/fabiocaccamo/tabbo.js.svg?color=blue)](https://github.com/fabiocaccamo/tabbo.js/blob/main/README.md)
# tabbo.js

@@ -2,0 +9,0 @@

@@ -188,3 +188,3 @@ (function () {

parent = parent || document;
const selectors = [
const tags = [
'a',

@@ -198,3 +198,7 @@ 'button',

];
const selector = selectors.join(':not([tabindex="-1"]), ');
const selector = tags
.map(function (tag) {
return tag + ':not([tabindex="-1"])';
})
.join(', ');
const elements = getFocusableElementsBySelector(parent, selector);

@@ -201,0 +205,0 @@ return elements;

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