UNPKG

maille

Version:

Component library for MithrilJS

50 lines (49 loc) 2.42 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", "shape-rendering": "geometricPrecision", "text-rendering": "geometricPrecision", "image-rendering": "optimizeQuality", "fill-rule": "evenodd", "clip-rule": "evenodd", "viewBox": "0 0 640 640" }; class AreaChart { 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="M106.643 365.39V258.712c117.249-119.175 76.347-117.072 215.412-27.343 120.698-108.39 107.352-93.532 265.173-132.096L640 86.375v147.722c-114.013 3.426-213.57 44.942-303.606 111.604-146.86-72.509-106.56-83.316-229.75 19.69zM640 596.05H50.54v-.13c-13.913-.012-26.528-5.67-35.658-14.764l-.059.06C5.776 572.167.143 559.541.12 545.521H0V43.948h65.056v487.045H640v65.056zM106.643 491.013v-80.21c121.868-123.876 79.56-114.486 229.751-21.378C429.171 332.743 527.605 278.235 640 262.986v228.026H106.643z"/>')); } 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 area-chart"; attrs.className = attrs.className ? (attrs.className + " " + additionalClasses) : additionalClasses; return attrs; } } exports.default = AreaChart;