Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
{"version":3,"file":"isElementTabbable.js","sourceRoot":"","sources":["../../src/util/isElementTabbable.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG,CAAC,EAAe,EAAW,EAAE;IACtD,IAAI,CAAC,EAAE,EAAE;QACR,OAAO,KAAK,CAAC;KACb;IAED,IAAI,EAAE,CAAC,YAAY,CAAC,qBAAqB,CAAC,EAAE;QAC3C,OAAO,KAAK,CAAC;KACb;IAED,IAAI,eAAe,CAAC,EAAE,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC;KACb;IAED,MAAM,QAAQ,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IAC7C,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,EAAE;QAChD,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;KAC/B;IAED,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;IAC3C,IAAI,QAAQ,KAAK,GAAG,IAAI,yCAAyC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;QACjF,OAAO,CAAE,EAAsB,CAAC,QAAQ,CAAC;KACzC;IAED,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import isElementHidden from \"./isElementHidden.js\";\n\n/**\n * Returns if the HTMLElement is tabbable.\n *\n * @public\n * @param { HTMLElement } el the component to operate on (component that slots or contains within its shadow root the items the user navigates among)\n * @returns { boolean } true if the element is tabbable or false - if not\n */\nconst isElementTabbable = (el: HTMLElement): boolean => {\n\tif (!el) {\n\t\treturn false;\n\t}\n\n\tif (el.hasAttribute(\"data-sap-no-tab-ref\")) {\n\t\treturn false;\n\t}\n\n\tif (isElementHidden(el)) {\n\t\treturn false;\n\t}\n\n\tconst tabIndex = el.getAttribute(\"tabindex\");\n\tif (tabIndex !== null && tabIndex !== undefined) {\n\t\treturn parseInt(tabIndex) >= 0;\n\t}\n\n\tconst nodeName = el.nodeName.toLowerCase();\n\tif (nodeName === \"a\" || /^(input|select|textarea|button|object)$/.test(nodeName)) {\n\t\treturn !(el as HTMLLinkElement).disabled;\n\t}\n\n\treturn false;\n};\n\nexport default isElementTabbable;\n"]}