{"version":3,"file":"helpers.mjs","names":[],"sources":["../../../../src/data-grid/data-grid-nav/helpers.ts"],"sourcesContent":["/*!\n *\n *  Copyright (c) \"Neo4j\"\n *  Neo4j Sweden AB [http://neo4j.com]\n *\n *  This file is part of Neo4j.\n *\n *  Neo4j is free software: you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation, either version 3 of the License, or\n *  (at your option) any later version.\n *\n *  This program is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/**\n * This function checks that an element is interactive and of a type that doesn't disrupt grid navigation.\n * @param element - The element to check\n * @returns true if the element is an interactive element that doesn't disrupt grid navigation\n */\nexport const isValidInteractiveElement = (element: Element): boolean => {\n  if (!(element instanceof HTMLElement)) {\n    return false;\n  }\n\n  const interactiveTags = new Set(['A', 'BUTTON', 'DETAILS']);\n  const interactiveInputTypes = new Set([\n    'checkbox',\n    'radio',\n    'submit',\n    'reset',\n  ]);\n\n  if (interactiveTags.has(element.tagName)) {\n    return true;\n  }\n\n  if (element.tagName === 'INPUT') {\n    const inputType = (element as HTMLInputElement).type;\n    return interactiveInputTypes.has(inputType);\n  }\n\n  return false;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,6BAA6B,YAA8B;CACtE,IAAI,EAAE,mBAAmB,cACvB,OAAO;CAGT,MAAM,kCAAkB,IAAI,IAAI;EAAC;EAAK;EAAU;CAAS,CAAC;CAC1D,MAAM,wCAAwB,IAAI,IAAI;EACpC;EACA;EACA;EACA;CACF,CAAC;CAED,IAAI,gBAAgB,IAAI,QAAQ,OAAO,GACrC,OAAO;CAGT,IAAI,QAAQ,YAAY,SAAS;EAC/B,MAAM,YAAa,QAA6B;EAChD,OAAO,sBAAsB,IAAI,SAAS;CAC5C;CAEA,OAAO;AACT"}