Sha256: 5fd0eb71c721b79f6c008c1f35b35947e5cbf94f7fc3e1d96b7a075d39854958
Contents?: true
Size: 1.43 KB
Versions: 26
Compression:
Stored size: 1.43 KB
Contents
{"version":3,"file":"is-disabled.js","names":["_getRole","require","elementsSupportingDisabledAttribute","Set","isDisabled","element","localName","getLocalName","has","hasAttribute","getAttribute"],"sources":["../sources/is-disabled.ts"],"sourcesContent":["import { getLocalName } from \"./getRole\";\n\nconst elementsSupportingDisabledAttribute = new Set([\n\t\"button\",\n\t\"fieldset\",\n\t\"input\",\n\t\"optgroup\",\n\t\"option\",\n\t\"select\",\n\t\"textarea\",\n]);\n\n/**\n * Check if an element is disabled\n * https://www.w3.org/TR/html-aam-1.0/#html-attribute-state-and-property-mappings\n * https://www.w3.org/TR/wai-aria-1.1/#aria-disabled\n *\n * @param element\n * @returns {boolean} true if disabled, otherwise false\n */\nexport function isDisabled(element: Element): boolean {\n\tconst localName = getLocalName(element);\n\treturn elementsSupportingDisabledAttribute.has(localName) &&\n\t\telement.hasAttribute(\"disabled\")\n\t\t? true\n\t\t: element.getAttribute(\"aria-disabled\") === \"true\";\n}\n"],"mappings":";;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAMC,mCAAmC,GAAG,IAAIC,GAAG,CAAC,CACnD,QAAQ,EACR,UAAU,EACV,OAAO,EACP,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,UAAU,CACV,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAACC,OAAgB,EAAW;EACrD,IAAMC,SAAS,GAAG,IAAAC,qBAAY,EAACF,OAAO,CAAC;EACvC,OAAOH,mCAAmC,CAACM,GAAG,CAACF,SAAS,CAAC,IACxDD,OAAO,CAACI,YAAY,CAAC,UAAU,CAAC,GAC9B,IAAI,GACJJ,OAAO,CAACK,YAAY,CAAC,eAAe,CAAC,KAAK,MAAM;AACpD"}
Version data entries
26 entries across 26 versions & 1 rubygems