UNPKG

maille

Version:

Component library for MithrilJS

50 lines (49 loc) 2.26 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 2257 3333", "shape-rendering": "geometricPrecision", "text-rendering": "geometricPrecision", "image-rendering": "optimizeQuality", "fill-rule": "evenodd", "clip-rule": "evenodd" }; class FlagOutline { 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="M0 67C0 30 30 0 67 0s67 30 67 67v116c485 123 759 31 1013-55 296-99 566-190 1071 30 25 11 40 35 40 61v1643c0 37-30 67-67 67-10 0-20-2-29-6-429-195-706-108-999-16-285 89-582 182-1030 57v1304c0 37-30 67-67 67s-67-30-67-67V68zm133 253v1505c431 130 717 41 990-45 296-93 578-181 1000-17V264c-433-178-673-97-935-9-266 89-553 186-1055 65z" 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 flag-outline"; attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses; return attrs; } } exports.default = FlagOutline;