Sha256: 1045f1b50cae5e3be35e93cd4c7d75f8f6894f72d22adc5df1519a22452ec234

Contents?: true

Size: 1.4 KB

Versions: 26

Compression:

Stored size: 1.4 KB

Contents

{"version":3,"file":"is-disabled.mjs","names":["getLocalName","elementsSupportingDisabledAttribute","Set","isDisabled","element","localName","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,SAASA,YAAY,QAAQ,eAAW;AAExC,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;AACA,OAAO,SAASC,UAAUA,CAACC,OAAgB,EAAW;EACrD,IAAMC,SAAS,GAAGL,YAAY,CAACI,OAAO,CAAC;EACvC,OAAOH,mCAAmC,CAACK,GAAG,CAACD,SAAS,CAAC,IACxDD,OAAO,CAACG,YAAY,CAAC,UAAU,CAAC,GAC9B,IAAI,GACJH,OAAO,CAACI,YAAY,CAAC,eAAe,CAAC,KAAK,MAAM;AACpD"}

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.25 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.24 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.23 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.22 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.21 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.20 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.19 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.18 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.17 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.16 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.15 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.14 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.13 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.12 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.11 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.10 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.9 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.8 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map
clapton-0.0.7 lib/clapton/javascripts/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api/dist/is-disabled.mjs.map