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

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

{"version":3,"file":"isElementClickable.js","sourceRoot":"","sources":["../../src/util/isElementClickable.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,eAAe,CAAC;AACnC,MAAM,UAAU,GAAG,qCAAqC,CAAC;AAEzD,MAAM,kBAAkB,GAAG,CAAC,EAAe,EAAW,EAAE;IACvD,IAAK,EAAwB,CAAC,QAAQ,EAAE;QACvC,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,OAAO,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC;WAC/B,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC;eAC7B,CAAC,CAAE,EAAsB,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["const rClickable = /^(?:a|area)$/i;\nconst rFocusable = /^(?:input|select|textarea|button)$/i;\n\nconst isElementClickable = (el: HTMLElement): boolean => {\n\tif ((el as HTMLButtonElement).disabled) {\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\treturn rFocusable.test(el.nodeName)\n\t\t|| (rClickable.test(el.nodeName)\n\t\t&& !!(el as HTMLLinkElement).href);\n};\n\nexport default isElementClickable;\n"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy