UNPKG

maille

Version:

Component library for MithrilJS

50 lines (49 loc) 2.52 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 ThumbsUp { 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="M20.953 275.85h142.502c11.528 0 20.953 9.425 20.953 20.965V575.51c0 11.528-9.425 20.965-20.953 20.965H20.953c-11.528 0-20.965-9.438-20.965-20.965V296.815c0-11.54 9.437-20.965 20.965-20.965zM328.457 66.78c11.067-55.973 102.71-4.406 108.734 85.82 1.843 27.626-1.04 59.753-7.807 95.647H560.37c54.473 2.126 102.025 41.173 68.434 105.226 7.677 27.91 8.823 60.662-11.989 73.595 2.599 44.08-9.602 71.363-32.374 92.93-1.524 22.028-6.213 41.635-16.843 56.647-17.598 24.839-31.89 18.886-59.587 18.886H286.835c-35.067 0-54.154-9.65-77.08-38.363V310.775c65.93-17.823 100.974-108.049 118.702-167.27V66.78z"/>')); } 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 thumbs-up"; attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses; return attrs; } } exports.default = ThumbsUp;