UNPKG

maille

Version:

Component library for MithrilJS

50 lines (49 loc) 2.39 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", "viewBox": "0 0 3118 3197", "shape-rendering": "geometricPrecision", "text-rendering": "geometricPrecision", "image-rendering": "optimizeQuality", "fill-rule": "evenodd", "clip-rule": "evenodd" }; class MagnifyingGlassThin { 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="M1257 0c347 0 661 141 889 368 227 227 368 542 368 889 0 333-130 636-341 861 4 3 8 6 11 9l905 904c38 38 38 99 0 137s-99 38-137 0l-905-904c-6-6-11-12-15-19-214 168-483 268-776 268-347 0-661-141-889-368C140 1918-1 1603-1 1256s141-661 368-889C594 140 909-1 1256-1zm748 509c-192-192-456-310-748-310S700 317 509 509c-192 192-310 456-310 748s118 557 310 748c192 192 456 310 748 310s557-118 748-310c192-192 310-456 310-748s-118-557-310-748z" fill-rule="nonzero"/>')); } 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 magnifying-glass-thin"; attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses; return attrs; } } exports.default = MagnifyingGlassThin;