@interop-ui/tabbable
Advanced tools
Comparing version 0.0.1-0 to 0.0.1-1
@@ -1,2 +0,2 @@ | ||
let e=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],t=e.join(","),n="undefined"==typeof Element?()=>!1:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;export function tabbable(e,o={}){o=o||{};let i,l,c=[],d=[],f=e.querySelectorAll(t);o.includeContainer&&n.call(e,t)&&(f=Array.prototype.slice.apply(f),f.unshift(e));for(let e=0;e<f.length;e++)i=f[e],r(i)&&(l=u(i),0===l?c.push(i):d.push({documentOrder:e,tabIndex:l,node:i}));return d.sort(a).map(e=>e.node).concat(c)}function r(e){return!(!o(e)||function(e){return function(e){return l(e)&&"radio"===e.type}(e)&&!function(e){let t=e;if(!t.name)return!0;let n=function(e){for(let t=0;t<e.length;t++){let n=e[t];if(l(n)&&n.checked)return n}return}(t.ownerDocument.querySelectorAll('input[type="radio"][name="'+t.name+'"]'));return!n||n===t}(e)}(e)||u(e)<0)}function o(e){return!(e.disabled||function(e){return l(e)&&"hidden"===e.type}(e)||function(e){return null===e.offsetParent||"hidden"===getComputedStyle(e).visibility}(e))}tabbable.isTabbable=function(e){if(!e)throw new Error("No node provided");if(!1===n.call(e,t))return!1;return r(e)},tabbable.isFocusable=function(e){if(!e)throw new Error("No node provided");if(!1===n.call(e,i))return!1;return o(e)};let i=e.concat("iframe").join(",");function u(e){let t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:e.tabIndex:t}function a(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex}function l(e){return"INPUT"===e.tagName} | ||
const t=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],e=t.join(","),n="undefined"==typeof Element?()=>!1:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;export function tabbable(t,o={}){o=o||{};const i=[],a=[];let l,d,f=t.querySelectorAll(e);o.includeContainer&&n.call(t,e)&&(f=Array.prototype.slice.apply(f),f.unshift(t));for(let t=0;t<f.length;t++)l=f[t],r(l)&&(d=u(l),0===d?i.push(l):a.push({documentOrder:t,tabIndex:d,node:l}));return a.sort(c).map(t=>t.node).concat(i)}function r(t){return!(!o(t)||function(t){return function(t){return a(t)&&"radio"===t.type}(t)&&!function(t){const e=t;if(!e.name)return!0;const n=function(t){for(let e=0;e<t.length;e++){const n=t[e];if(a(n)&&n.checked)return n}return}(e.ownerDocument.querySelectorAll('input[type="radio"][name="'+e.name+'"]'));return!n||n===e}(t)}(t)||u(t)<0)}function o(t){return!(t.disabled||function(t){return a(t)&&"hidden"===t.type}(t)||function(t){return null===t.offsetParent||"hidden"===getComputedStyle(t).visibility}(t))}tabbable.isTabbable=function(t){if(!t)throw new Error("No node provided");if(!1===n.call(t,e))return!1;return r(t)},tabbable.isFocusable=function(t){if(!t)throw new Error("No node provided");if(!1===n.call(t,i))return!1;return o(t)};const i=t.concat("iframe").join(",");function u(t){const e=parseInt(t.getAttribute("tabindex"),10);return isNaN(e)?function(t){return"true"===t.contentEditable}(t)?0:t.tabIndex:e}function c(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex}function a(t){return"INPUT"===t.tagName} | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@interop-ui/tabbable", | ||
"version": "0.0.1-0", | ||
"version": "0.0.1-1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "source": "src/index.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
20626
1