UNPKG

maille

Version:

Component library for MithrilJS

50 lines (49 loc) 2.23 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 3168 3168", "shape-rendering": "geometricPrecision", "text-rendering": "geometricPrecision", "image-rendering": "optimizeQuality", "fill-rule": "evenodd", "clip-rule": "evenodd" }; class CheckMarkCircle { 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="M1584 0c875 0 1584 709 1584 1584s-709 1584-1584 1584S0 2459 0 1584 709 0 1584 0zM879 1745c-20-18-31-43-32-69-1-25 7-51 25-72 0 0 0-1 1-1 18-20 43-31 69-32 25-1 52 7 72 26l334 303 801-839c19-20 44-30 70-31s51 8 71 28c20 19 30 44 31 70s-8 51-28 72l-869 910-2 2c-18 18-43 28-67 29-25 1-51-8-71-26l-406-368z"/>')); } 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 check-mark-circle"; attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses; return attrs; } } exports.default = CheckMarkCircle;