UNPKG

maille

Version:

Component library for MithrilJS

50 lines (49 loc) 2.5 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 3328 3328", "shape-rendering": "geometricPrecision", "text-rendering": "geometricPrecision", "image-rendering": "optimizeQuality", "fill-rule": "evenodd", "clip-rule": "evenodd" }; class CloseCircleOutline { 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="M1664 0c460 0 876 186 1177 487s487 717 487 1177-186 876-487 1177-717 487-1177 487-876-186-1177-487S0 2124 0 1664 186 788 487 487 1204 0 1664 0zm507 1012c35-35 92-35 128 0 35 35 35 92 0 128l-524 524 524 524c35 35 35 92 0 128-35 35-92 35-128 0l-524-524-524 524c-35 35-92 35-128 0-35-35-35-92 0-128l524-524-524-524c-35-35-35-92 0-128 35-35 92-35 128 0l524 524 524-524zm542-397c-268-268-639-435-1049-435S883 346 615 615c-268 268-435 639-435 1049s166 781 435 1049c268 268 639 435 1049 435s781-166 1049-435c268-268 435-639 435-1049s-166-781-435-1049z" 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 close-circle-outline"; attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses; return attrs; } } exports.default = CloseCircleOutline;