Please wait. This can take some minutes ...
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.
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"]}