carbon-custom-elements
Version:
A Carbon Design System variant that's as easy to use as native HTML elements, with no framework tax, no framework silo.
1 lines • 997 B
Source Map (JSON)
{"version":3,"sources":["polyfills/toggle-class.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,QAAA,MAAM,oCAAoC,SAOtC,CAAC","file":"toggle-class.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nconst missingNativeDOMTokenListToggleForce = (() => {\n const elem = document.createElement('div');\n const randomClass = `_random_class_${Math.random()\n .toString(36)\n .slice(2)}`;\n elem.classList.toggle(randomClass, false);\n return elem.classList.contains(randomClass);\n})();\nif (missingNativeDOMTokenListToggleForce) {\n (() => {\n const origToggle = DOMTokenList.prototype.toggle;\n DOMTokenList.prototype.toggle = function toggleDOMTokenList(name: string, add: boolean) {\n return arguments.length < 2 || this.contains(name) === !add ? origToggle.call(this, name) : add;\n };\n })();\n}\n"]}