All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.util.isElementTabbable.js.map Maven / Gradle / Ivy

{"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"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy