UNPKG

maille

Version:

Component library for MithrilJS

50 lines (49 loc) 2.4 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", "width": "64", "height": "64", "viewBox": "0 0 640 640", "shape-rendering": "geometricPrecision", "text-rendering": "geometricPrecision", "image-rendering": "optimizeQuality", "fill-rule": "evenodd", "clip-rule": "evenodd" }; class EnvelopeOpen { 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="M35.93 267.818h573.668L323.083 0 35.93 267.818zM187.137 379.02h121.442v23.469H187.137V379.02zm130.927 201.558L432.16 466.47 605.69 640H30.415l173.542-173.53 114.108 114.108zM30.403 597.905l148.986-148.986L30.403 299.933v297.972zm578.865 14.256L446.026 448.92l163.242-163.242v326.484zm-272.33-233.14H458.38v23.468H336.938V379.02zM107.53 312.463h121.454v23.469H107.53v-23.469zm303.157 0H532.14v23.469H410.687v-23.469zm-149.79 0H382.34v23.469H260.898v-23.469z"/>')); } 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 envelope-open"; attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses; return attrs; } } exports.default = EnvelopeOpen;