UNPKG

maille

Version:

Component library for MithrilJS

50 lines (49 loc) 2.61 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 Smartphone { 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="M180.191 0h279.594c30.614 0 55.666 25.075 55.666 55.666v528.668c0 30.602-25.063 55.666-55.666 55.666H180.191c-30.59 0-55.654-25.052-55.654-55.666V55.666C124.537 25.052 149.588 0 180.19 0zM320 524.156c19.89 0 36.048 16.146 36.048 36.048 0 19.901-16.158 36.036-36.048 36.036-19.914 0-36.048-16.135-36.048-36.036 0-19.902 16.134-36.048 36.048-36.048zM262.539 45.048h114.923c.838 0 1.523.697 1.523 1.524v16.783c0 .839-.697 1.524-1.523 1.524H262.539a1.52 1.52 0 0 1-1.524-1.524V46.572a1.52 1.52 0 0 1 1.524-1.524zM173.6 127.006h292.787c4.984 0 9.047 4.098 9.047 9.035v353.591c0 4.96-4.099 9.06-9.047 9.06H173.6c-4.95 0-9.048-4.075-9.048-9.06v-353.59c0-4.973 4.063-9.036 9.048-9.036z"/>')); } 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 smartphone"; attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses; return attrs; } } exports.default = Smartphone;