UNPKG

@hyper.fun/ionicons4-ios-add

Version:

👉 https://hyper.fun/c/ionicons4-ios-add/1.3.4

93 lines (87 loc) • 3.37 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"],["x","0px"],["y","0px"],["viewBox","0 0 512 512"],["enable-background","new 0 0 512 512"],["space","preserve"]]; const svgHtml = "<g> <path d=\"M368.5,240H272v-96.5c0-8.8-7.2-16-16-16c-8.8,0-16,7.2-16,16V240h-96.5c-8.8,0-16,7.2-16,16c0,4.4,1.8,8.4,4.7,11.3c2.9,2.9,6.9,4.7,11.3,4.7H240v96.5c0,4.4,1.8,8.4,4.7,11.3c2.9,2.9,6.9,4.7,11.3,4.7c8.8,0,16-7.2,16-16V272h96.5c8.8,0,16-7.2,16-16C384.5,247.2,377.3,240,368.5,240z\"></path> </g>"; 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 };