UNPKG

maille

Version:

Component library for MithrilJS

50 lines (49 loc) 2.37 kB
"use strict"; // THIS FILE WAS AUTO-GENERATED FOR PACKAGING, DO NOT MODIFY Object.defineProperty(exports, "__esModule", { value: true }); const types_1 = require("../../../types"); // tslint:disable-next-line const SVG_PROPS = { "xmlns": "http://www.w3.org/2000/svg", "width": "64", "height": "64", "shape-rendering": "geometricPrecision", "text-rendering": "geometricPrecision", "image-rendering": "optimizeQuality", "fill-rule": "evenodd", "clip-rule": "evenodd", "viewBox": "0 0 640 640" }; class Lightbulb { constructor() { this.defaults = { height: "1em", width: "1em", fill: "black", }; } view(vnode) { return m("svg", Object.assign({}, this.genAttrs(vnode)), // tslint:disable-next-line m.trust('<path d="M389.19 602.748v37.264H250.822v-37.264h-41.34v-71.552h221.035v71.552H389.19zM320-.011c109.112 0 197.542 85.867 197.542 191.802 0 72.792-89.21 261.712-114.639 323.933H237.795C213.063 449.617 122.46 248.957 122.46 191.791 122.46 85.857 210.89-.011 320.001-.011zm0 57.485c80.186 0 145.195 63.154 145.195 141.002 0 53.434-65.552 203.152-84.225 248.885H259.575c-18.201-48.615-84.769-206.884-84.769-248.885 0-77.847 65.009-141.002 145.195-141.002z"/>')); } genAttrs(vnode) { const overrides = Object.values(types_1.GeneralIconAttrName) .reduce((acc, name) => { if (!name) { return acc; } if (vnode && vnode && vnode.attrs[name]) { acc[name] = vnode.attrs[name]; return acc; } if (name in this.defaults) { acc[name] = this.defaults[name]; } return acc; }, {}); const attrs = Object.assign({}, SVG_PROPS, overrides); if (!("style" in attrs) || !attrs.style) { attrs.style = {}; } if (attrs.style && typeof attrs.style !== "object") { throw new Error("attr.style must be an object for icons"); } attrs.style["vertical-align"] = "middle"; attrs.style["min-width"] = "1.25em"; const additionalClasses = "maille maille-uxwing-icon lightbulb"; attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses; return attrs; } } exports.default = Lightbulb;