UNPKG

@hyper.fun/carbon-icon-hearing

Version:

👉 https://hyper.fun/c/carbon-icon-hearing/1.3.0

93 lines (87 loc) • 3.95 kB
/******/ // The require scope /******/ var __wp_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __wp_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__wp_require__.o(definition, key) && !__wp_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __wp_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __wp_exports__ = {}; // EXPORTS __wp_require__.d(__wp_exports__, { "Z": () => (/* binding */ AwesomeHfc) }); ;// CONCATENATED MODULE: ./.hfc/propnames.js /* harmony default export */ const propnames = ([["size","class","color"],[],[]]); ;// CONCATENATED MODULE: ./src/index.ts const svgAttrs = [["xmlns","http://www.w3.org/2000/svg"],["viewBox","0 0 32 32"]]; const svgHtml = "<path d=\"M18 30v-2a10.011 10.011 0 0 0 10-10h2a12.013 12.013 0 0 1-12 12z\" fill=\"currentColor\"></path> <path d=\"M18 26v-2a6.007 6.007 0 0 0 6-6h2a8.01 8.01 0 0 1-8 8z\" fill=\"currentColor\"></path> <path d=\"M18 22v-2a2.002 2.002 0 0 0 2-2h2a4.004 4.004 0 0 1-4 4z\" fill=\"currentColor\"></path> <path d=\"M10 2a9.01 9.01 0 0 0-9 9h2a7 7 0 0 1 14 0a7.09 7.09 0 0 1-3.501 6.135l-.499.288v3.073a2.935 2.935 0 0 1-.9 2.151a4.182 4.182 0 0 1-4.633 1.03A4.092 4.092 0 0 1 5 20H3a6.116 6.116 0 0 0 3.67 5.512a5.782 5.782 0 0 0 2.314.486a6.585 6.585 0 0 0 4.478-1.888A4.94 4.94 0 0 0 15 20.496v-1.942A9.108 9.108 0 0 0 19 11a9.01 9.01 0 0 0-9-9z\" fill=\"currentColor\"></path> <path d=\"M9.28 8.082A3.006 3.006 0 0 1 13 11h2a4.979 4.979 0 0 0-1.884-3.911a5.041 5.041 0 0 0-4.281-.957a4.95 4.95 0 0 0-3.703 3.703a5.032 5.032 0 0 0 2.304 5.458A3.078 3.078 0 0 1 9 17.924V20h2v-2.077a5.06 5.06 0 0 0-2.537-4.346a3.002 3.002 0 0 1 .817-5.495z\" fill=\"currentColor\"></path>"; class AwesomeHfc { constructor(container, props) { this.container = container; for (let i = 0; i < svgAttrs.length; i++) { container.setAttribute(svgAttrs[i][0], svgAttrs[i][1]); } this.render(props); container.innerHTML = svgHtml; } changed(props) { this.render(props); } disconnected() { } render(props) { if (props.attrs.size) { this.container.setAttribute("width", props.attrs.size); this.container.setAttribute("height", props.attrs.size); } if (props.attrs.class) { this.container.setAttributeNS(null, "class", props.attrs.class); } if (props.attrs.color) { this.container.style.fill = props.attrs.color; this.container.style.color = props.attrs.color; } bindToElement(this.container, props.others); } } AwesomeHfc.tag = "svg"; AwesomeHfc.props = propnames; function bindToElement(elem, obj) { for (let i = 0, keys = Object.keys(obj); i < keys.length; i++) { const key = keys[i]; const value = obj[key]; if (key === "style") { if (typeof value === "object") { Object.assign(elem.style, value); } else { elem.style.cssText += value; } continue; } if (typeof value === "function") { elem[key] = function (event) { value(event); }; } else { elem.setAttribute(key, value); } } } var __wp_exports__default = __wp_exports__.Z; export { __wp_exports__default as default };