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 3352 3352", "shape-rendering": "geometricPrecision", "text-rendering": "geometricPrecision", "image-rendering": "optimizeQuality", "fill-rule": "evenodd", "clip-rule": "evenodd" }; class CloseSquareOutline { 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="M239 0h2873c66 0 126 27 169 70s70 103 70 169v2873c0 66-27 126-70 169s-103 70-169 70H239c-66 0-126-27-169-70S0 3178 0 3112V239c0-66 27-126 70-169S173 0 239 0zm1958 1017c38-38 100-38 137 0 38 38 38 100 0 137l-521 521 521 521c38 38 38 100 0 137-38 38-100 38-137 0l-521-521-521 521c-38 38-100 38-137 0-38-38-38-100 0-137l521-521-521-521c-38-38-38-100 0-137 38-38 100-38 137 0l521 521 521-521zm915-823H239c-12 0-23 5-32 13-8 8-13 19-13 32v2873c0 12 5 23 13 32 8 8 19 13 32 13h2873c12 0 23-5 32-13 8-8 13-19 13-32V239c0-12-5-23-13-32-8-8-19-13-32-13z" 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-square-outline"; attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses; return attrs; } } exports.default = CloseSquareOutline;