UNPKG

maille

Version:

Component library for MithrilJS

50 lines (49 loc) 2.51 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 ComputerTower { 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="M193.479 0h253.054c19.11 0 34.725 15.638 34.725 34.748v570.528c0 19.098-15.615 34.724-34.725 34.724H193.479c-19.099 0-34.737-15.626-34.737-34.724V34.749C158.742 15.638 174.38 0 193.48 0zm211.916 143.825h25.181v14.35h-25.181v-14.35zm-85.383 352.374c20.835 0 37.737 16.902 37.737 37.748 0 20.847-16.902 37.749-37.737 37.749-20.847 0-37.748-16.902-37.748-37.748 0-20.847 16.901-37.749 37.748-37.749zM205.774 110.895h228.487c3.992 0 7.264 3.26 7.264 7.24v39.296c0 3.98-3.272 7.252-7.264 7.252H205.774c-3.992 0-7.252-3.272-7.252-7.252v-39.296c0-3.98 3.26-7.24 7.252-7.24z"/>')); } 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 computer-tower"; attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses; return attrs; } } exports.default = ComputerTower;