1 line
2.5 KiB
JSON
1 line
2.5 KiB
JSON
|
{"ast":null,"code":"function replaceClassName(origClass, classToRemove) {\n return origClass.replace(new RegExp(\"(^|\\\\s)\" + classToRemove + \"(?:\\\\s|$)\", 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\n}\n/**\n * Removes a CSS class from a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\n\nexport default function removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}","map":{"version":3,"names":["replaceClassName","origClass","classToRemove","replace","RegExp","removeClass","element","className","classList","remove","setAttribute","baseVal"],"sources":["/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/node_modules/dom-helpers/esm/removeClass.js"],"sourcesContent":["function replaceClassName(origClass, classToRemove) {\n return origClass.replace(new RegExp(\"(^|\\\\s)\" + classToRemove + \"(?:\\\\s|$)\", 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\n}\n/**\n * Removes a CSS class from a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\n\nexport default function removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}"],"mappings":"AAAA,SAASA,gBAAT,CAA0BC,SAA1B,EAAqCC,aAArC,EAAoD;EAClD,OAAOD,SAAS,CAACE,OAAV,CAAkB,IAAIC,MAAJ,CAAW,YAAYF,aAAZ,GAA4B,WAAvC,EAAoD,GAApD,CAAlB,EAA4E,IAA5E,EAAkFC,OAAlF,CAA0F,MAA1F,EAAkG,GAAlG,EAAuGA,OAAvG,CAA+G,YAA/G,EAA6H,EAA7H,CAAP;AACD;AACD;AACA;AACA;AACA;AACA;AACA;;;AAGA,eAAe,SAASE,WAAT,CAAqBC,OAArB,EAA8BC,SAA9B,EAAyC;EACtD,IAAID,OAAO,CAACE,SAAZ,EAAuB;IACrBF,OAAO,CAACE,SAAR,CAAkBC,MAAlB,CAAyBF,SAAzB;EACD,CAFD,MAEO,IAAI,OAAOD,OAAO,CAACC,SAAf,KAA6B,QAAjC,EAA2C;IAChDD,OAAO,CAACC,SAAR,GAAoBP,gBAAgB,CAACM,OAAO,CAACC,SAAT,EAAoBA,SAApB,CAApC;EACD,CAFM,MAEA;IACLD,OAAO,CAACI,YAAR,CAAqB,OAArB,EAA8BV,gBAAgB,CAACM,OAAO,CAACC,SAAR,IAAqBD,OAAO,CAACC,SAAR,CAAkBI,OAAvC,IAAkD,EAAnD,EAAuDJ,SAAvD,CAA9C;EACD;AACF"},"metadata":{},"sourceType":"module"}
|